This commit is contained in:
Mike Macgirvin 2022-09-03 09:45:58 +10:00
parent c3465ba2ad
commit cdaefc3fd7
4 changed files with 16 additions and 27 deletions

View file

@ -18,7 +18,7 @@ use Code\Lib\Navbar;
use Code\Lib\Addon;
use Code\Render\Theme;
/**
* @brief Admin area.
*
@ -162,11 +162,10 @@ class Admin extends Controller
$upgrade = EMPTY_STR;
if ((!defined('PLATFORM_ARCHITECTURE')) || (PLATFORM_ARCHITECTURE === 'zap')) {
$vrelease = get_repository_version('release');
$vdev = get_repository_version('dev');
$upgrade = ((version_compare(STD_VERSION, $vrelease) < 0) ? t('Your software should be updated') : '');
}
$vrelease = get_repository_version('release');
$vdev = get_repository_version('dev');
$upgrade = ((version_compare(STD_VERSION, $vrelease) < 0) ? t('Your software should be updated') : '');
$t = Theme::get_template('admin_summary.tpl');
return replace_macros($t, [

View file

@ -48,15 +48,6 @@ class Dbsync
return $o;
// remove the old style config if it exists
del_config('database', 'update_r' . intval(argv(3)));
set_config('database', '_' . intval(argv(3)), 'success');
if (intval(get_config('system', 'db_version')) < intval(argv(3))) {
set_config('system', 'db_version', intval(argv(3)));
}
info(t('Update has been marked successful') . EOL);
goaway(z_root() . '/admin/dbsync');
}
if (argc() > 2 && intval(argv(2))) {
@ -93,7 +84,7 @@ class Dbsync
}
}
if (count($failed)) {
$o = replace_macros(Theme::get_template('failed_updates.tpl'), array(
$o = replace_macros(Theme::get_template('failed_updates.tpl'), [
'$base' => z_root(),
'$banner' => t('Failed Updates'),
'$desc' => '',
@ -101,7 +92,7 @@ class Dbsync
'$verify' => t('Attempt to verify this update if a verification procedure exists'),
'$apply' => t('Attempt to execute this update step automatically'),
'$failed' => $failed
));
]);
} else {
return '<div class="generic-content-wrapper-styled"><h3>' . t('No failed updates.') . '</h3></div>';
}

View file

@ -41,13 +41,13 @@ class Logs
public function get()
{
$log_choices = array(
$log_choices = [
LOGGER_NORMAL => 'Normal',
LOGGER_TRACE => 'Trace',
LOGGER_DEBUG => 'Debug',
LOGGER_DATA => 'Data',
LOGGER_ALL => 'All'
);
];
$t = Theme::get_template('admin_logs.tpl');
@ -81,7 +81,7 @@ class Logs
}
}
return replace_macros($t, array(
return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Logs'),
'$submit' => t('Submit'),
@ -91,11 +91,11 @@ class Logs
'$logname' => get_config('system', 'logfile'),
// name, label, value, help string, extra data...
'$debugging' => array('debugging', t("Debugging"), get_config('system', 'debugging'), ""),
'$logfile' => array('logfile', t("Log file"), get_config('system', 'logfile'), t("Must be writable by web server. Relative to your top-level webserver directory.")),
'$loglevel' => array('loglevel', t("Log level"), get_config('system', 'loglevel'), "", $log_choices),
'$debugging' => ['debugging', t('Debugging'), get_config('system', 'debugging'), ""],
'$logfile' => ['logfile', t('Log file'), get_config('system', 'logfile'), t("Must be writable by web server. Relative to your top-level webserver directory.")],
'$loglevel' => ['loglevel', t('Log level'), get_config('system', 'loglevel'), "", $log_choices],
'$form_security_token' => get_form_security_token('admin_logs'),
));
]);
}
}

View file

@ -422,7 +422,7 @@ function xml2array($contents, $namespaces = true, $get_attributes = 1, $priority
}
libxml_clear_errors();
return;
return [];
}
//Initializations
@ -1236,8 +1236,7 @@ function deliverable_singleton($channel_id, $xchan)
function get_repository_version($branch = 'release')
{
$path = "https://raw.codeberg.page/streams/" . PLATFORM_NAME . "/@$branch/version.php";
$path = 'https://raw.codeberg.page/streams/' . PLATFORM_NAME . "/@$branch/version.php";
$x = Url::get($path);
if ($x['success']) {