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:
parent
58df7bcea5
commit
cc4e9f953e
@ -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);
|
||||
|
||||
|
@ -91,10 +91,7 @@
|
||||
</article>
|
||||
{/if}
|
||||
|
||||
<h2>{$CONST.AVAILABLE_TEMPLATES}</h2>
|
||||
|
||||
<ul class="plainList clearfix">
|
||||
{foreach $templates as $template=>$info}
|
||||
{function name=templateBlock}
|
||||
<li><article class="clearfix">
|
||||
<h3 title="{$info.info.name}">{$info.info.name|truncate:25:"…"}</h3>
|
||||
<div class="clearfix equal_heights template_wrap">
|
||||
@ -140,6 +137,21 @@
|
||||
{/if}
|
||||
</article>
|
||||
</li>
|
||||
{/function}
|
||||
|
||||
<h2>{$CONST.RECOMMENDED}</h2>
|
||||
<ul class="plainList clearfix">
|
||||
{foreach $recommended_templates as $template=>$info}
|
||||
{templateBlock template=$template info=$info}
|
||||
{/foreach}
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>{$CONST.AVAILABLE_TEMPLATES}</h2>
|
||||
|
||||
<ul class="plainList clearfix">
|
||||
{foreach $templates as $template=>$info}
|
||||
{templateBlock template=$template info=$info}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</section>
|
||||
|
@ -3,3 +3,4 @@ Author: Matthias Mees, Veit Lehmann
|
||||
Date: 2015-05-19
|
||||
Require Serendipity: 2.0
|
||||
Backend: Yes
|
||||
Recommended: Yes
|
@ -2,4 +2,5 @@ Name: Clean Blog
|
||||
Author: s9y theme by Don Chambers. Original bootstrap theme by Iron Summit Media Strategies, LLC.
|
||||
Date: 2016-02-02
|
||||
Require Serendipity: 2.0
|
||||
Backend: No
|
||||
Backend: No
|
||||
Recommended: Yes
|
@ -2,3 +2,4 @@ Name: Next
|
||||
Author: Matthias Mees, mm@yellowled.de
|
||||
Date: 2015-05-07
|
||||
Require Serendipity: 2.0
|
||||
Recommended: Yes
|
Loading…
x
Reference in New Issue
Block a user