<?php
/*
* OIDplus 2.0
* Copyright 2019 - 2021 Daniel Marschall, ViaThinkSoft
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class OIDplusPageAdminSoftwareUpdate extends OIDplusPagePluginAdmin {
public function init($html=true) {
}
public function gui($id, &$out, &$handled) {
if (!isset($parts[1])) $parts[1] = '';
if ($parts[0] != 'oidplus:software_update') return;
$handled = true;
$out['title'] = _L('Software update');
$out['icon'] = OIDplus::webpath(__DIR__).'icon_big.png';
if (!OIDplus::authUtils()::isAdminLoggedIn()) {
$out['icon'] = 'img/error_big.png';
$out['text'] = '<p>'._L
('You need to <a %1>log in</a> as administrator.',OIDplus
::gui()->link('oidplus:login')).'</p>';
return;
}
$out['text'] = '<p>'._L('You can perform a system update by clicking the button below.').'</p>';
$out['text'] .= '<p><input type="button" onclick="document.location=\'update/\'" value="'._L('Start update assistant').'"></p>';
}
public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
if (!OIDplus::authUtils()::isAdminLoggedIn()) return false;
$tree_icon = OIDplus::webpath(__DIR__).'treeicon.png';
} else {
$tree_icon = null; // default icon (folder)
}
'id' => 'oidplus:software_update',
'icon' => $tree_icon,
'text' => _L('Software update')
);
return true;
}
public function tree_search($request) {
return false;
}
}