From 176bca44cc2850affa42e07dcbfdf51bd47f0ed0 Mon Sep 17 00:00:00 2001 From: rurban Date: Wed, 23 Jun 2010 13:12:23 +0000 Subject: [PATCH] add wikilens to theme search path, and not double git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@7555 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/plugin/RateIt.php | 3 +++ themes/Sidebar/templates/top.tmpl | 11 +++++++++-- themes/Sidebar/themeinfo.php | 5 ++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/plugin/RateIt.php b/lib/plugin/RateIt.php index 5d05bbfe7..368682f86 100644 --- a/lib/plugin/RateIt.php +++ b/lib/plugin/RateIt.php @@ -138,6 +138,9 @@ var rateit_action = '".urlencode("RateIt")."'; function head() { // early side-effects (before body) global $WikiTheme; + static $_already; + if (!empty($_already)) return; + $_already = 1; $WikiTheme->addMoreHeaders(JavaScript( "var prediction = new Array; var rating = new Array; var avg = new Array; var numusers = new Array; diff --git a/themes/Sidebar/templates/top.tmpl b/themes/Sidebar/templates/top.tmpl index c5357c7d0..7a6039955 100644 --- a/themes/Sidebar/templates/top.tmpl +++ b/themes/Sidebar/templates/top.tmpl @@ -1,6 +1,13 @@ isAuthenticated() && $page->exists()) +$pagename = $page->getName(); +$isActionPage = isActionPage($pagename); +if (ENABLE_PAGE_PUBLIC) + $public = $page->get('public'); +else + $public = false; +if (ENABLE_RATEIT && !empty($user) && $user->isAuthenticated() + && $page->exists() && !$isActionPage && !$WikiTheme->DUMP_MODE) $rating = 1; else $rating = 0; @@ -8,7 +15,7 @@ else _pagename != "HomePage") { ?> -

+

getArg('action') == 'browse') { ?> diff --git a/themes/Sidebar/themeinfo.php b/themes/Sidebar/themeinfo.php index 7f45eb88f..dc73f015b 100644 --- a/themes/Sidebar/themeinfo.php +++ b/themes/Sidebar/themeinfo.php @@ -154,7 +154,7 @@ class WikiTheme_Sidebar extends WikiTheme_MonoBook { * WikiWords can automatically be split by inserting spaces between * the words. The default is to leave WordsSmashedTogetherLikeSo. */ - $this->setAutosplitWikiWords(true); + //$this->setAutosplitWikiWords(true); /** * If true (default) show create '?' buttons on not existing pages, even if the @@ -203,6 +203,9 @@ if (ENABLE_RATEIT) { require_once("lib/wikilens/PageListColumns.php"); //require_once("lib/plugin/RateIt.php"); $plugin = new WikiPlugin_RateIt; + // add parent to current theme to find the RateIt images + // $WikiTheme->addParent('wikilens', 'noinit'); + $WikiTheme->_parents[] = new WikiTheme('wikilens', 'noinit'); $plugin->head(); } -- 2.45.0