Skip to content

Commit

Permalink
bayes 0.4.22: fix menu in 2.1-beta1 by using parseTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
onli committed Jul 27, 2016
1 parent d960114 commit f54b1d5
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 20 deletions.
4 changes: 4 additions & 0 deletions 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

Expand Down
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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']
));
Expand All @@ -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']
));
Expand Down

0 comments on commit f54b1d5

Please sign in to comment.