From b4f015e4c06fc61355f5b50bcb63860b8d6f4130 Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 20 May 2014 20:13:22 +0200 Subject: [PATCH] add custom config to info array - fixes #165 3a and half of 3b --- include/functions.inc.php | 4 ++++ templates/2k11/admin/templates.inc.tpl | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/functions.inc.php b/include/functions.inc.php index 97e9339e..322281a1 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -258,6 +258,10 @@ function serendipity_fetchTemplateInfo($theme, $abspath = null) { $data[$k] = implode("\n", $v); } + if (@is_file($serendipity['templatePath'] . $theme . '/config.inc.php')) { + $data['custom_config'] = YES; + } + if ( $theme != 'default' && $theme != 'default-rtl' && @is_dir($serendipity['templatePath'] . $theme . '/admin') && strtolower($data['backend']) == 'yes' ) { diff --git a/templates/2k11/admin/templates.inc.tpl b/templates/2k11/admin/templates.inc.tpl index 1eccabc2..7706ee3a 100644 --- a/templates/2k11/admin/templates.inc.tpl +++ b/templates/2k11/admin/templates.inc.tpl @@ -35,7 +35,7 @@ {if $cur_tpl.fullsize_preview || $cur_tpl.preview} {if $cur_tpl.fullsize_preview} - {$CONST.PREVIEW} + {$CONST.PREVIEW} {else} {$CONST.PREVIEW} @@ -47,6 +47,8 @@
{$cur_tpl.info.author}
{$CONST.LAST_UPDATED}:
{$cur_tpl.info.date}
+
{$CONST.CUSTOM_CONFIG}:
{* # i18n *} +
{$cur_tpl.info.custom_config|default:$CONST.NO}
{$CONST.CUSTOM_ADMIN_INTERFACE}:
{$cur_tpl.info.custom_admin_interface}
@@ -56,11 +58,11 @@ - {$CONST.CONFIGURATION} + {if $cur_tpl.info.custom_config}{$CONST.CONFIGURATION}{/if} {if $cur_template_backend} -
+

{$CONST.BACKEND}: {$cur_tpl_backend.info.name|truncate:30}

@@ -68,7 +70,7 @@ {if $cur_tpl_backend.fullsize_backend_preview || $cur_tpl_backend.preview_backend} {if $cur_tpl_backend.fullsize_backend_preview} - {$CONST.PREVIEW} + {$CONST.PREVIEW} {else} {$CONST.PREVIEW} @@ -100,7 +102,7 @@ {if $info.fullsize_preview || $info.preview} {if $info.fullsize_preview} - {$CONST.PREVIEW} + {$CONST.PREVIEW} {else} {$CONST.PREVIEW} @@ -112,6 +114,8 @@
{$info.info.author}
{$CONST.LAST_UPDATED}:
{$info.info.date}
+
{$CONST.CUSTOM_CONFIG}:
{* # i18n *} +
{$info.info.custom_config|default:$CONST.NO}
{$CONST.CUSTOM_ADMIN_INTERFACE}:
{if $info.info.custom_admin_interface} {$info.info.custom_admin_interface} {else} {$CONST.NO} {/if}