mirror of
https://github.com/friendica/friendica
synced 2025-04-27 19:10:11 +00:00
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:
parent
9227aab837
commit
a13bc14933
5 changed files with 136 additions and 38 deletions
|
@ -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"),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue