From f54b1d5376439db1d2dd5962dacf1a9cd6e6bbf4 Mon Sep 17 00:00:00 2001 From: onli Date: Wed, 27 Jul 2016 10:31:11 +0200 Subject: [PATCH] bayes 0.4.22: fix menu in 2.1-beta1 by using parseTemplate --- serendipity_event_spamblock_bayes/ChangeLog | 4 +++ .../{admin => }/bayesAnalysis.tpl | 0 .../{admin => }/bayesAnalysismenu.tpl | 0 .../{admin => }/bayesDBmenu.tpl | 0 .../{admin => }/bayesImportmenu.tpl | 0 .../{admin => }/bayesLearnmenu.tpl | 0 .../{admin => }/bayesNavigation.tpl | 0 .../{admin => }/bayesRecyclermenu.tpl | 0 .../serendipity_event_spamblock_bayes.php | 29 ++++++------------- 9 files changed, 13 insertions(+), 20 deletions(-) rename serendipity_event_spamblock_bayes/{admin => }/bayesAnalysis.tpl (100%) rename serendipity_event_spamblock_bayes/{admin => }/bayesAnalysismenu.tpl (100%) rename serendipity_event_spamblock_bayes/{admin => }/bayesDBmenu.tpl (100%) rename serendipity_event_spamblock_bayes/{admin => }/bayesImportmenu.tpl (100%) rename serendipity_event_spamblock_bayes/{admin => }/bayesLearnmenu.tpl (100%) rename serendipity_event_spamblock_bayes/{admin => }/bayesNavigation.tpl (100%) rename serendipity_event_spamblock_bayes/{admin => }/bayesRecyclermenu.tpl (100%) diff --git a/serendipity_event_spamblock_bayes/ChangeLog b/serendipity_event_spamblock_bayes/ChangeLog index e2a38f39c..64cb97885 100644 --- a/serendipity_event_spamblock_bayes/ChangeLog +++ b/serendipity_event_spamblock_bayes/ChangeLog @@ -1,3 +1,7 @@ +0.4.22: + * Use parseTemplate method to be compatible with s9y 2.1-beta1, some + template files needed to be moved from admin/ to the root dir + 0.4.21: * Fix mal-written case-statemens in setupdb, blocking sqlite diff --git a/serendipity_event_spamblock_bayes/admin/bayesAnalysis.tpl b/serendipity_event_spamblock_bayes/bayesAnalysis.tpl similarity index 100% rename from serendipity_event_spamblock_bayes/admin/bayesAnalysis.tpl rename to serendipity_event_spamblock_bayes/bayesAnalysis.tpl diff --git a/serendipity_event_spamblock_bayes/admin/bayesAnalysismenu.tpl b/serendipity_event_spamblock_bayes/bayesAnalysismenu.tpl similarity index 100% rename from serendipity_event_spamblock_bayes/admin/bayesAnalysismenu.tpl rename to serendipity_event_spamblock_bayes/bayesAnalysismenu.tpl diff --git a/serendipity_event_spamblock_bayes/admin/bayesDBmenu.tpl b/serendipity_event_spamblock_bayes/bayesDBmenu.tpl similarity index 100% rename from serendipity_event_spamblock_bayes/admin/bayesDBmenu.tpl rename to serendipity_event_spamblock_bayes/bayesDBmenu.tpl diff --git a/serendipity_event_spamblock_bayes/admin/bayesImportmenu.tpl b/serendipity_event_spamblock_bayes/bayesImportmenu.tpl similarity index 100% rename from serendipity_event_spamblock_bayes/admin/bayesImportmenu.tpl rename to serendipity_event_spamblock_bayes/bayesImportmenu.tpl diff --git a/serendipity_event_spamblock_bayes/admin/bayesLearnmenu.tpl b/serendipity_event_spamblock_bayes/bayesLearnmenu.tpl similarity index 100% rename from serendipity_event_spamblock_bayes/admin/bayesLearnmenu.tpl rename to serendipity_event_spamblock_bayes/bayesLearnmenu.tpl diff --git a/serendipity_event_spamblock_bayes/admin/bayesNavigation.tpl b/serendipity_event_spamblock_bayes/bayesNavigation.tpl similarity index 100% rename from serendipity_event_spamblock_bayes/admin/bayesNavigation.tpl rename to serendipity_event_spamblock_bayes/bayesNavigation.tpl diff --git a/serendipity_event_spamblock_bayes/admin/bayesRecyclermenu.tpl b/serendipity_event_spamblock_bayes/bayesRecyclermenu.tpl similarity index 100% rename from serendipity_event_spamblock_bayes/admin/bayesRecyclermenu.tpl rename to serendipity_event_spamblock_bayes/bayesRecyclermenu.tpl diff --git a/serendipity_event_spamblock_bayes/serendipity_event_spamblock_bayes.php b/serendipity_event_spamblock_bayes/serendipity_event_spamblock_bayes.php index 34554d815..966824c63 100644 --- a/serendipity_event_spamblock_bayes/serendipity_event_spamblock_bayes.php +++ b/serendipity_event_spamblock_bayes/serendipity_event_spamblock_bayes.php @@ -42,7 +42,7 @@ function introspect(&$propbag) { $this->title = PLUGIN_EVENT_SPAMBLOCK_BAYES_NAME; $propbag->add ( 'description', PLUGIN_EVENT_SPAMBLOCK_BAYES_DESC); $propbag->add ( 'name', $this->title); - $propbag->add ( 'version', '0.4.21' ); + $propbag->add ( 'version', '0.4.22' ); $propbag->add ( 'event_hooks', array ('frontend_saveComment' => true, 'backend_spamblock_comments_shown' => true, 'external_plugin' => true, @@ -1413,7 +1413,7 @@ function displayMenu($subpage=0) { $jquery_needed = true; } - echo $this->smarty_show('admin/bayesNavigation.tpl', array('css' => $css, + echo $this->smarty_show('bayesNavigation.tpl', array('css' => $css, 'jquery_needed' => $jquery_needed, 'path' => $this->path, 'subpage' => $subpage, @@ -1453,22 +1453,11 @@ function smarty_show($template, $data = null) { } $serendipity['smarty']->assign($data); - - $tfile = serendipity_getTemplateFile($template, 'serendipityPath'); - - if ($tfile == $template) { - $tfile = dirname(__FILE__) . "/$template"; - } - $inclusion = $serendipity['smarty']->security_settings[INCLUDE_ANY]; - $serendipity['smarty']->security_settings[INCLUDE_ANY] = true; - $content = $serendipity['smarty']->fetch('file:'. $tfile); - $serendipity['smarty']->security_settings[INCLUDE_ANY] = $inclusion; - - echo $content; + echo $this->parseTemplate($template); } function showLearnMenu() { - echo $this->smarty_show('admin/bayesLearnmenu.tpl', array('s9ybackend' => $GLOBALS['s9ybackend'])); + echo $this->smarty_show('bayesLearnmenu.tpl', array('s9ybackend' => $GLOBALS['s9ybackend'])); } function showDBMenu($commentpage) { @@ -1507,7 +1496,7 @@ function showDBMenu($commentpage) { $data['path'] = $this->path; $data['s9ybackend'] = $GLOBALS['s9ybackend']; - echo $this->smarty_show('admin/bayesDBmenu.tpl', $data); + echo $this->smarty_show('bayesDBmenu.tpl', $data); } function showRecyclerMenu($commentpage) { @@ -1528,7 +1517,7 @@ function showRecyclerMenu($commentpage) { } else { $comments = array(); } - echo $this->smarty_show('admin/bayesRecyclermenu.tpl', array('comments' => $comments, + echo $this->smarty_show('bayesRecyclermenu.tpl', array('comments' => $comments, 'types' => array_values($this->type), 'commentpage' => $commentpage, 'path' => $this->path, @@ -1554,7 +1543,7 @@ function showAnalysisMenu($commentpage=0) { if (!is_array($comments[0])) { $comments = array(); } - echo $this->smarty_show('admin/bayesAnalysismenu.tpl', array( + echo $this->smarty_show('bayesAnalysismenu.tpl', array( 'comments' => $comments, 'commentpage' => $commentpage, 'path' => $this->path, @@ -1565,7 +1554,7 @@ function showAnalysisMenu($commentpage=0) { function showImportMenu() { global $serendipity; - echo $this->smarty_show('admin/bayesImportmenu.tpl', array( + echo $this->smarty_show('bayesImportmenu.tpl', array( 'trojaRegistered' => $this->get_config('troja_registered', false) == true, 's9ybackend' => $GLOBALS['s9ybackend'] )); @@ -1592,7 +1581,7 @@ function showAnalysis($comment_id) { $comment['ratings'] = $ratings; $comments[$i] = $comment; } - echo $this->smarty_show('admin/bayesAnalysis.tpl', array('comments' => $comments, + echo $this->smarty_show('bayesAnalysis.tpl', array('comments' => $comments, 'types' => array_values($this->type), 's9ybackend' => $GLOBALS['s9ybackend'] ));