Introduce recommended section in theme backend

Meant to highlight modern themes for guiding users not to pick the outdated xhtml themes still available via spartacus. See http://board.s9y.org/viewtopic.php?f=5&t=20713
This commit is contained in:
onli
2016-04-14 16:18:16 +02:00
parent 58df7bcea5
commit cc4e9f953e
5 changed files with 29 additions and 6 deletions
+9 -1
View File
@@ -175,13 +175,13 @@ $stack = array();
serendipity_plugin_api::hook_event('backend_templates_fetchlist', $stack);
$themes = serendipity_fetchTemplates();
$data['templates'] = array();
$data['recommended_templates'] = array();
foreach($themes AS $theme) {
$stack[$theme] = serendipity_fetchTemplateInfo($theme);
}
ksort($stack);
foreach ($stack as $theme => $info) {
/* Sorry, but we don't display engines */
if ( strtolower($info['engine']) == 'yes') {
@@ -222,12 +222,20 @@ foreach ($stack as $theme => $info) {
$unmetRequirements[] = 'Serendipity '. $info['require serendipity'];
$data['templates'][$theme]['unmetRequirements'] = sprintf(UNMET_REQUIREMENTS, implode(', ', $unmetRequirements));
}
if ($info['recommended']) {
$data['recommended_templates'][$theme] = $data['templates'][$theme];
if ($serendipity['template'] != $theme) {
unset($data['templates'][$theme]);
}
}
}
$data['cur_tpl'] = $data['templates'][$data['cur_template']];
$data['cur_tpl_backend'] = $data['templates'][$data['cur_template_backend']];
unset($data['templates'][$data['cur_template']]);
unset($data['recommended_templates'][$data['cur_template']]);
echo serendipity_smarty_show('admin/templates.inc.tpl', $data);