[geeklog-hg] geeklog: If config option template_comments is changed then the ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue Jun 18 12:56:59 EDT 2013


changeset 9100:18d7f63f3eb8
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/18d7f63f3eb8
user: Tom <websitemaster at cogeco.net>
date: Tue Jun 18 12:56:31 2013 -0400
description:
If config option template_comments is changed then the template clear cache function is run

diffstat:

 system/lib-plugins.php  |   7 +++++--
 system/lib-template.php |  16 ++++++++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r cf13a9d52ba1 -r 18d7f63f3eb8 system/lib-plugins.php
--- a/system/lib-plugins.php	Tue Jun 18 12:45:26 2013 -0400
+++ b/system/lib-plugins.php	Tue Jun 18 12:56:31 2013 -0400
@@ -2806,9 +2806,12 @@
     global $_PLUGINS;
 
     // Treat articles like a plugin (since belong to core group)
+    $plugintypes[] = 'article';
     require_once $_CONF['path_system'] . 'lib-story.php';
-    
-    $plugintypes[] = 'article';
+    // Treat template system like a plugin (since belong to core group)
+    $plugintypes[] = 'template';
+    require_once $_CONF['path_system'] . 'lib-template.php';
+
     $plugintypes = array_merge($plugintypes, $_PLUGINS);
 
     foreach ($plugintypes as $pi_name) {    
diff -r cf13a9d52ba1 -r 18d7f63f3eb8 system/lib-template.php
--- a/system/lib-template.php	Tue Jun 18 12:45:26 2013 -0400
+++ b/system/lib-template.php	Tue Jun 18 12:56:31 2013 -0400
@@ -110,4 +110,20 @@
 
 }
 
+/**
+* Config Option has changed. (use plugin api)
+*
+* @return   nothing
+*
+*/
+function plugin_configchange_template($group, $changes)
+{
+    global $_TABLES, $_CONF;
+echo "ha";
+    // If template comments disabled or enabled clear all cached templates
+    if ($group == 'Core' AND in_array('template_comments', $changes)) {
+        CTL_clearCache();
+    }
+}
+
 ?>



More information about the geeklog-cvs mailing list