From fb81d6a121b7c66c781138e0e84219c89ddc83b3 Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 20 Nov 2012 14:38:28 +0100 Subject: [PATCH] added temporary backend developer template dir switch - Please read: The smartified code as forked from master to 2.0 being outsourced, now is to find in /include/admin/tplold, which will still be used as the default backend template dir. To switch to the new version, please paste the dirs and files of s9y-admin-tpl as adviced in the readme and reload, but also add a ```php // End of Serendipity configuration file // You can place your own special variables after here: define('SWITCH_TEMPLATE_VERSION', 'true'); ``` to the end of your serendipity_config_local.inc.php. To switch back to the old smartified files, just set a // to the define(). --- include/admin/category.inc.php | 6 ++---- include/admin/comments.inc.php | 6 ++---- include/admin/configuration.inc.php | 3 ++- include/admin/entries.inc.php | 3 ++- include/admin/entries_overview.inc.php | 3 ++- include/admin/export.inc.php | 3 ++- include/admin/groups.inc.php | 3 ++- include/admin/images.inc.php | 6 ++---- include/admin/import.inc.php | 3 ++- include/admin/installer.inc.php | 3 ++- include/admin/overview.inc.php | 6 ++---- include/admin/personal.inc.php | 3 ++- include/admin/plugins.inc.php | 3 ++- include/admin/templates.inc.php | 6 ++---- include/admin/{tpl => tplold}/category.inc.tpl | 0 include/admin/{tpl => tplold}/comments.inc.tpl | 0 include/admin/{tpl => tplold}/configuration.inc.tpl | 0 include/admin/{tpl => tplold}/entries.inc.tpl | 0 include/admin/{tpl => tplold}/entries_overview.inc.tpl | 0 include/admin/{tpl => tplold}/export.inc.tpl | 0 include/admin/{tpl => tplold}/groups.inc.tpl | 0 include/admin/{tpl => tplold}/images.inc.tpl | 0 include/admin/{tpl => tplold}/import.inc.tpl | 0 include/admin/{tpl => tplold}/installer.inc.tpl | 0 include/admin/{tpl => tplold}/out_stack_loop.tpl | 0 include/admin/{tpl => tplold}/overview.inc.tpl | 0 include/admin/{tpl => tplold}/personal.inc.tpl | 0 include/admin/{tpl => tplold}/plugins.inc.tpl | 0 .../admin/{tpl => tplold}/serendipity_plugin_config.fnc.tpl | 0 include/admin/{tpl => tplold}/show_ownership.fnc.tpl | 0 include/admin/{tpl => tplold}/show_plugins.fnc.tpl | 0 include/admin/{tpl => tplold}/templates.inc.tpl | 0 include/admin/{tpl => tplold}/upgrader.inc.tpl | 0 include/admin/{tpl => tplold}/users.inc.tpl | 0 include/admin/upgrader.inc.php | 6 ++---- include/admin/users.inc.php | 6 ++---- 36 files changed, 32 insertions(+), 37 deletions(-) rename include/admin/{tpl => tplold}/category.inc.tpl (100%) rename include/admin/{tpl => tplold}/comments.inc.tpl (100%) rename include/admin/{tpl => tplold}/configuration.inc.tpl (100%) rename include/admin/{tpl => tplold}/entries.inc.tpl (100%) rename include/admin/{tpl => tplold}/entries_overview.inc.tpl (100%) rename include/admin/{tpl => tplold}/export.inc.tpl (100%) rename include/admin/{tpl => tplold}/groups.inc.tpl (100%) rename include/admin/{tpl => tplold}/images.inc.tpl (100%) rename include/admin/{tpl => tplold}/import.inc.tpl (100%) rename include/admin/{tpl => tplold}/installer.inc.tpl (100%) rename include/admin/{tpl => tplold}/out_stack_loop.tpl (100%) rename include/admin/{tpl => tplold}/overview.inc.tpl (100%) rename include/admin/{tpl => tplold}/personal.inc.tpl (100%) rename include/admin/{tpl => tplold}/plugins.inc.tpl (100%) rename include/admin/{tpl => tplold}/serendipity_plugin_config.fnc.tpl (100%) rename include/admin/{tpl => tplold}/show_ownership.fnc.tpl (100%) rename include/admin/{tpl => tplold}/show_plugins.fnc.tpl (100%) rename include/admin/{tpl => tplold}/templates.inc.tpl (100%) rename include/admin/{tpl => tplold}/upgrader.inc.tpl (100%) rename include/admin/{tpl => tplold}/users.inc.tpl (100%) diff --git a/include/admin/category.inc.php b/include/admin/category.inc.php index d9727ead..ccb208dc 100644 --- a/include/admin/category.inc.php +++ b/include/admin/category.inc.php @@ -200,11 +200,9 @@ if (!is_object($serendipity['smarty'])) { } $serendipity['smarty']->assign($data); - -$tfile = dirname(__FILE__) . "/tpl/category.inc.tpl"; - +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/category.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up - echo $content; /* vim: set sts=4 ts=4 expandtab : */ diff --git a/include/admin/comments.inc.php b/include/admin/comments.inc.php index 02664d1c..180047ea 100644 --- a/include/admin/comments.inc.php +++ b/include/admin/comments.inc.php @@ -415,11 +415,9 @@ if (!is_object($serendipity['smarty'])) { } $serendipity['smarty']->assign($data); - -$tfile = dirname(__FILE__) . "/tpl/comments.inc.tpl"; - +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/comments.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up - echo $content; /* vim: set sts=4 ts=4 expandtab : */ diff --git a/include/admin/configuration.inc.php b/include/admin/configuration.inc.php index a0aed98f..40461815 100644 --- a/include/admin/configuration.inc.php +++ b/include/admin/configuration.inc.php @@ -80,7 +80,8 @@ if (!is_object($serendipity['smarty'])) { } $serendipity['smarty']->assign($data); -$tfile = dirname(__FILE__) . "/tpl/configuration.inc.tpl"; +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/configuration.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); echo $content; diff --git a/include/admin/entries.inc.php b/include/admin/entries.inc.php index dfd3e716..aee9055e 100644 --- a/include/admin/entries.inc.php +++ b/include/admin/entries.inc.php @@ -418,7 +418,8 @@ if (!is_object($serendipity['smarty'])) { } $serendipity['smarty']->assign($data); -$tfile = dirname(__FILE__) . "/tpl/entries.inc.tpl"; +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/entries.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); echo $content; diff --git a/include/admin/entries_overview.inc.php b/include/admin/entries_overview.inc.php index 7c884c25..4fff2810 100644 --- a/include/admin/entries_overview.inc.php +++ b/include/admin/entries_overview.inc.php @@ -8,7 +8,8 @@ if (!is_object($serendipity['smarty'])) { serendipity_smarty_init(); } -$tfile = dirname(__FILE__) . "/tpl/entries_overview.inc.tpl"; +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/entries_overview.inc.tpl"; $serendipity['smarty']->display('file:'. $tfile); /* vim: set sts=4 ts=4 expandtab : */ diff --git a/include/admin/export.inc.php b/include/admin/export.inc.php index 3d9352f4..f726b5e9 100644 --- a/include/admin/export.inc.php +++ b/include/admin/export.inc.php @@ -8,7 +8,8 @@ if (!is_object($serendipity['smarty'])) { serendipity_smarty_init(); } -$tfile = dirname(__FILE__) . "/tpl/export.inc.tpl"; +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/export.inc.tpl"; $serendipity['smarty']->display('file:'. $tfile); /* vim: set sts=4 ts=4 expandtab : */ diff --git a/include/admin/groups.inc.php b/include/admin/groups.inc.php index d786101a..011a2198 100644 --- a/include/admin/groups.inc.php +++ b/include/admin/groups.inc.php @@ -126,7 +126,8 @@ if ($serendipity['GET']['adminAction'] == 'edit' || isset($_POST['NEW'])) { } $serendipity['smarty']->assign($data); -$tfile = dirname(__FILE__) . "/tpl/groups.inc.tpl"; +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/groups.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); echo $content; diff --git a/include/admin/images.inc.php b/include/admin/images.inc.php index bbdcaeb3..04921692 100644 --- a/include/admin/images.inc.php +++ b/include/admin/images.inc.php @@ -732,11 +732,9 @@ $data['get']['fid'] = $serendipity['GET']['fid']; // don't trust {$smarty.get.va $data['get']['only_path'] = $serendipity['GET']['only_path']; // we dont need other GET vars in images.inc.tpl $serendipity['smarty']->assign($data); - -$tfile = dirname(__FILE__) . "/tpl/images.inc.tpl"; - +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/images.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up - echo $content; /* vim: set sts=4 ts=4 expandtab : */ diff --git a/include/admin/import.inc.php b/include/admin/import.inc.php index 8267d554..8eacd469 100644 --- a/include/admin/import.inc.php +++ b/include/admin/import.inc.php @@ -259,7 +259,8 @@ if (!is_object($serendipity['smarty'])) { } $serendipity['smarty']->assign($data); -$tfile = dirname(__FILE__) . "/tpl/import.inc.tpl"; +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/import.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); echo $content; diff --git a/include/admin/installer.inc.php b/include/admin/installer.inc.php index f087f5ee..28d6c935 100644 --- a/include/admin/installer.inc.php +++ b/include/admin/installer.inc.php @@ -385,8 +385,9 @@ if (!is_object($serendipity['smarty'])) { } $serendipity['smarty']->assign($data); +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/installer.inc.tpl"; -$tfile = dirname(__FILE__) . "/tpl/installer.inc.tpl"; ob_start(); include $tfile; $content = ob_get_contents(); diff --git a/include/admin/overview.inc.php b/include/admin/overview.inc.php index d4627762..1454f0dd 100644 --- a/include/admin/overview.inc.php +++ b/include/admin/overview.inc.php @@ -41,11 +41,9 @@ if (!is_object($serendipity['smarty'])) { } $serendipity['smarty']->assign($data); - -$tfile = dirname(__FILE__) . "/tpl/overview.inc.tpl"; - +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/overview.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up - echo $content; /* vim: set sts=4 ts=4 expandtab : */ diff --git a/include/admin/personal.inc.php b/include/admin/personal.inc.php index f80a917a..242f6c0b 100644 --- a/include/admin/personal.inc.php +++ b/include/admin/personal.inc.php @@ -119,7 +119,8 @@ if (!is_object($serendipity['smarty'])) { } $serendipity['smarty']->assign($data); -$tfile = dirname(__FILE__) . "/tpl/personal.inc.tpl"; +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/personal.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); echo $content; diff --git a/include/admin/plugins.inc.php b/include/admin/plugins.inc.php index 40532eb7..a640ccc0 100644 --- a/include/admin/plugins.inc.php +++ b/include/admin/plugins.inc.php @@ -443,7 +443,8 @@ if (!is_object($serendipity['smarty'])) { } $serendipity['smarty']->assign($data); -$tfile = dirname(__FILE__) . "/tpl/plugins.inc.tpl"; +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/plugins.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); echo $content; diff --git a/include/admin/templates.inc.php b/include/admin/templates.inc.php index 527397d9..e72d27f9 100644 --- a/include/admin/templates.inc.php +++ b/include/admin/templates.inc.php @@ -173,11 +173,9 @@ if (!is_object($serendipity['smarty'])) { } $serendipity['smarty']->assign($data); - -$tfile = dirname(__FILE__) . "/tpl/templates.inc.tpl"; - +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/templates.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up - echo $content; /* vim: set sts=4 ts=4 expandtab : */ diff --git a/include/admin/tpl/category.inc.tpl b/include/admin/tplold/category.inc.tpl similarity index 100% rename from include/admin/tpl/category.inc.tpl rename to include/admin/tplold/category.inc.tpl diff --git a/include/admin/tpl/comments.inc.tpl b/include/admin/tplold/comments.inc.tpl similarity index 100% rename from include/admin/tpl/comments.inc.tpl rename to include/admin/tplold/comments.inc.tpl diff --git a/include/admin/tpl/configuration.inc.tpl b/include/admin/tplold/configuration.inc.tpl similarity index 100% rename from include/admin/tpl/configuration.inc.tpl rename to include/admin/tplold/configuration.inc.tpl diff --git a/include/admin/tpl/entries.inc.tpl b/include/admin/tplold/entries.inc.tpl similarity index 100% rename from include/admin/tpl/entries.inc.tpl rename to include/admin/tplold/entries.inc.tpl diff --git a/include/admin/tpl/entries_overview.inc.tpl b/include/admin/tplold/entries_overview.inc.tpl similarity index 100% rename from include/admin/tpl/entries_overview.inc.tpl rename to include/admin/tplold/entries_overview.inc.tpl diff --git a/include/admin/tpl/export.inc.tpl b/include/admin/tplold/export.inc.tpl similarity index 100% rename from include/admin/tpl/export.inc.tpl rename to include/admin/tplold/export.inc.tpl diff --git a/include/admin/tpl/groups.inc.tpl b/include/admin/tplold/groups.inc.tpl similarity index 100% rename from include/admin/tpl/groups.inc.tpl rename to include/admin/tplold/groups.inc.tpl diff --git a/include/admin/tpl/images.inc.tpl b/include/admin/tplold/images.inc.tpl similarity index 100% rename from include/admin/tpl/images.inc.tpl rename to include/admin/tplold/images.inc.tpl diff --git a/include/admin/tpl/import.inc.tpl b/include/admin/tplold/import.inc.tpl similarity index 100% rename from include/admin/tpl/import.inc.tpl rename to include/admin/tplold/import.inc.tpl diff --git a/include/admin/tpl/installer.inc.tpl b/include/admin/tplold/installer.inc.tpl similarity index 100% rename from include/admin/tpl/installer.inc.tpl rename to include/admin/tplold/installer.inc.tpl diff --git a/include/admin/tpl/out_stack_loop.tpl b/include/admin/tplold/out_stack_loop.tpl similarity index 100% rename from include/admin/tpl/out_stack_loop.tpl rename to include/admin/tplold/out_stack_loop.tpl diff --git a/include/admin/tpl/overview.inc.tpl b/include/admin/tplold/overview.inc.tpl similarity index 100% rename from include/admin/tpl/overview.inc.tpl rename to include/admin/tplold/overview.inc.tpl diff --git a/include/admin/tpl/personal.inc.tpl b/include/admin/tplold/personal.inc.tpl similarity index 100% rename from include/admin/tpl/personal.inc.tpl rename to include/admin/tplold/personal.inc.tpl diff --git a/include/admin/tpl/plugins.inc.tpl b/include/admin/tplold/plugins.inc.tpl similarity index 100% rename from include/admin/tpl/plugins.inc.tpl rename to include/admin/tplold/plugins.inc.tpl diff --git a/include/admin/tpl/serendipity_plugin_config.fnc.tpl b/include/admin/tplold/serendipity_plugin_config.fnc.tpl similarity index 100% rename from include/admin/tpl/serendipity_plugin_config.fnc.tpl rename to include/admin/tplold/serendipity_plugin_config.fnc.tpl diff --git a/include/admin/tpl/show_ownership.fnc.tpl b/include/admin/tplold/show_ownership.fnc.tpl similarity index 100% rename from include/admin/tpl/show_ownership.fnc.tpl rename to include/admin/tplold/show_ownership.fnc.tpl diff --git a/include/admin/tpl/show_plugins.fnc.tpl b/include/admin/tplold/show_plugins.fnc.tpl similarity index 100% rename from include/admin/tpl/show_plugins.fnc.tpl rename to include/admin/tplold/show_plugins.fnc.tpl diff --git a/include/admin/tpl/templates.inc.tpl b/include/admin/tplold/templates.inc.tpl similarity index 100% rename from include/admin/tpl/templates.inc.tpl rename to include/admin/tplold/templates.inc.tpl diff --git a/include/admin/tpl/upgrader.inc.tpl b/include/admin/tplold/upgrader.inc.tpl similarity index 100% rename from include/admin/tpl/upgrader.inc.tpl rename to include/admin/tplold/upgrader.inc.tpl diff --git a/include/admin/tpl/users.inc.tpl b/include/admin/tplold/users.inc.tpl similarity index 100% rename from include/admin/tpl/users.inc.tpl rename to include/admin/tplold/users.inc.tpl diff --git a/include/admin/upgrader.inc.php b/include/admin/upgrader.inc.php index df418e72..b96ccd8e 100644 --- a/include/admin/upgrader.inc.php +++ b/include/admin/upgrader.inc.php @@ -365,11 +365,9 @@ if (!is_object($serendipity['smarty'])) { #$serendipity['smarty']->registerPlugin('function', 'serendipity_upgraderResultDiagnose', 'serendipity_smarty_backend_upgraderResultDiagnose'); $serendipity['smarty']->assign($data); - -$tfile = dirname(__FILE__) . "/tpl/upgrader.inc.tpl"; - +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/upgrader.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up - echo $content; /* vim: set sts=4 ts=4 expandtab : */ diff --git a/include/admin/users.inc.php b/include/admin/users.inc.php index 2f66033a..48800668 100644 --- a/include/admin/users.inc.php +++ b/include/admin/users.inc.php @@ -253,11 +253,9 @@ if (!is_object($serendipity['smarty'])) { } $serendipity['smarty']->assign($data); - -$tfile = dirname(__FILE__) . "/tpl/users.inc.tpl"; - +$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl'; +$tfile = dirname(__FILE__) . "/$tpldir/users.inc.tpl"; $content = $serendipity['smarty']->fetch('file:'. $tfile); - echo $content; /* vim: set sts=4 ts=4 expandtab : */