Move admin/themes to src/Module

- Add Module\Admin\Themes\Index class
- Add route for admin/themes
- Add themes admin aside menu entry
- Add admin/addons/index.tpl template
- Remove theme list from mod/admin
This commit is contained in:
Hypolite Petovan 2019-04-15 01:11:46 -04:00
parent 9227aab837
commit a13bc14933
5 changed files with 136 additions and 38 deletions

View file

@ -2017,44 +2017,6 @@ function admin_page_themes(App $a)
'$form_security_token' => BaseModule::getFormSecurityToken("admin_themes"),
]);
}
// reload active themes
if (!empty($_GET['a']) && $_GET['a'] == "r") {
BaseModule::checkFormSecurityTokenRedirectOnError(System::baseUrl() . '/admin/themes', 'admin_themes', 't');
foreach ($themes as $th) {
if ($th['allowed']) {
Theme::uninstall($th['name']);
Theme::install($th['name']);
}
}
info("Themes reloaded");
$a->internalRedirect('admin/themes');
}
/*
* List themes
*/
$addons = [];
foreach ($themes as $th) {
$addons[] = [$th['name'], (($th['allowed']) ? "on" : "off"), Theme::getInfo($th['name'])];
}
$t = Renderer::getMarkupTemplate('admin/addons.tpl');
return Renderer::replaceMacros($t, [
'$title' => L10n::t('Administration'),
'$page' => L10n::t('Themes'),
'$submit' => L10n::t('Save Settings'),
'$reload' => L10n::t('Reload active themes'),
'$baseurl' => System::baseUrl(true),
'$function' => 'themes',
'$addons' => $addons,
'$pcount' => count($themes),
'$noplugshint' => L10n::t('No themes found on the system. They should be placed in %1$s', '<code>/view/themes</code>'),
'$experimental' => L10n::t('[Experimental]'),
'$unsupported' => L10n::t('[Unsupported]'),
'$form_security_token' => BaseModule::getFormSecurityToken("admin_themes"),
]);
}
/**