From: <var...@us...> - 2010-05-18 14:48:05
|
Revision: 7404 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7404&view=rev Author: vargenau Date: 2010-05-18 14:47:58 +0000 (Tue, 18 May 2010) Log Message: ----------- Lets's use the single global isActionPage() function Modified Paths: -------------- trunk/lib/CachedMarkup.php trunk/lib/main.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/UserPreferences.php trunk/lib/upgrade.php trunk/themes/MonoBook/templates/actionbar.tmpl trunk/themes/MonoBook/templates/info.tmpl trunk/themes/Sidebar/templates/actionbar.tmpl trunk/themes/default/templates/info.tmpl trunk/themes/default/templates/userprefs.tmpl trunk/themes/gforge/templates/actionbar.tmpl Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2010-05-18 14:33:53 UTC (rev 7403) +++ trunk/lib/CachedMarkup.php 2010-05-18 14:47:58 UTC (rev 7404) @@ -751,7 +751,6 @@ /** * 1.3.13: Previously stored was only _pi. * A fresh generated cache has now ->name and ->args also. - * main::isActionPage only checks the raw content. */ class Cached_PluginInvocation extends Cached_DynamicContent { Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2010-05-18 14:33:53 UTC (rev 7403) +++ trunk/lib/main.php 2010-05-18 14:47:58 UTC (rev 7404) @@ -916,7 +916,7 @@ return $action; // Allow for, e.g. action=LikePages - if ($this->isActionPage($action)) + if (isActionPage($action)) return $action; // Handle untranslated actionpages in non-english @@ -925,7 +925,7 @@ require_once("lib/plugin/_WikiTranslation.php"); $trans = new WikiPlugin__WikiTranslation(); $en_action = $trans->translate($action,'en',$GLOBALS['LANG']); - if ($this->isActionPage($en_action)) + if (isActionPage($en_action)) return $en_action; } @@ -985,13 +985,6 @@ return false; } - function _isActionPage ($pagename, $verbose = true) { - - global $AllActionPages; - - return (in_array($pagename, $AllActionPages)); - } - function findActionPage ($action) { static $cache; if (!$action) return false; @@ -1004,7 +997,7 @@ return $cache[$translation]; // check for cached translated version - if ($translation and $this->_isActionPage($translation, false)) + if ($translation and isActionPage($translation)) return $cache[$action] = $translation; // Allow for, e.g. action=LikePages @@ -1019,7 +1012,7 @@ $trans = new WikiPlugin__WikiTranslation(); $trans->lang = $LANG; $default = $trans->translate_to_en($action, $LANG); - if ($default and $this->_isActionPage($default, false)) + if ($default and isActionPage($default)) return $cache[$action] = $default; } else { $default = $translation; @@ -1027,7 +1020,7 @@ // check for english version if ($action != $translation and $action != $default) { - if ($this->_isActionPage($action)) + if (isActionPage($action)) return $cache[$action] = $action; } @@ -1035,10 +1028,6 @@ return $cache[$action] = false; } - function isActionPage ($pagename) { - return $this->findActionPage($pagename); - } - function action_browse () { $this->buffer_output(); include_once("lib/display.php"); Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2010-05-18 14:33:53 UTC (rev 7403) +++ trunk/lib/plugin/RecentChanges.php 2010-05-18 14:47:58 UTC (rev 7404) @@ -1213,7 +1213,7 @@ $args = WikiPlugin::getArgs($argstr, $request, $defaults); $action = $request->getArg('action'); - if ($action != 'browse' && ! $request->isActionPage($action)) + if ($action != 'browse' && !isActionPage($action)) $args['format'] = false; // default -> HTML if ($args['format'] == 'rss' && empty($args['limit'])) Modified: trunk/lib/plugin/UserPreferences.php =================================================================== --- trunk/lib/plugin/UserPreferences.php 2010-05-18 14:33:53 UTC (rev 7403) +++ trunk/lib/plugin/UserPreferences.php 2010-05-18 14:47:58 UTC (rev 7404) @@ -78,7 +78,7 @@ _("Error: You are not logged in, cannot display UserPreferences.")); } } - if ((!$request->isActionPage($request->getArg('pagename')) + if ((!isActionPage($request->getArg('pagename')) and (!isset($user->_prefs->_method) or !in_array($user->_prefs->_method, array('ADODB','SQL','PDO')))) or (in_array($request->getArg('action'), array('zip','ziphtml','dumphtml'))) Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2010-05-18 14:33:53 UTC (rev 7403) +++ trunk/lib/upgrade.php 2010-05-18 14:47:58 UTC (rev 7404) @@ -114,17 +114,6 @@ } } - /** - * If a matching pgsrc => pluginname exists - * Need the English filename (required precondition: urlencode == urldecode). - */ - function isActionPage($filename) { - - global $AllActionPages; - - return (in_array($filename, $AllActionPages)); - } - function CheckActionPageUpdate() { echo "<h3>",sprintf(_("check for necessary %s updates"), _("ActionPage")),"</h3>\n"; @@ -143,7 +132,7 @@ if (substr($filename,-1,1) == '~') continue; if (substr($filename,-5,5) == '.orig') continue; $pagename = urldecode($filename); - if ($this->isActionPage($filename)) { + if (isActionPage($filename)) { $translation = gettext($pagename); if ($translation == $pagename) $this->doPgsrcUpdate($pagename, $path, $filename); @@ -169,7 +158,7 @@ if (substr($filename,-1,1) == '~') continue; if (substr($filename,-5,5) == '.orig') continue; $pagename = urldecode($filename); - if (!$this->isActionPage($filename)) { + if (!isActionPage($filename)) { // There're a lot of now unneeded pages around. // At first rename the BlaPlugin pages to Help/<pagename> and then to the update. if ($this->db_version < 1030.12200612) { Modified: trunk/themes/MonoBook/templates/actionbar.tmpl =================================================================== --- trunk/themes/MonoBook/templates/actionbar.tmpl 2010-05-18 14:33:53 UTC (rev 7403) +++ trunk/themes/MonoBook/templates/actionbar.tmpl 2010-05-18 14:47:58 UTC (rev 7404) @@ -6,7 +6,7 @@ $dbh = $request->getDbh(); $isAdmin = $user->isAdmin(); $pagename = $page->getName(); - $isActionPage = $request->_isActionPage($pagename, false); + $isActionPage = isActionPage($pagename); $isBrowse = $request->getArg('action') == 'browse'; ?> <div class="portlet" id="p-cactions"> Modified: trunk/themes/MonoBook/templates/info.tmpl =================================================================== --- trunk/themes/MonoBook/templates/info.tmpl 2010-05-18 14:33:53 UTC (rev 7403) +++ trunk/themes/MonoBook/templates/info.tmpl 2010-05-18 14:47:58 UTC (rev 7404) @@ -159,7 +159,7 @@ if (0 && $page->isUserPage($include_empty=true)) { $pagetype []= _("User page"); } -if (@$request->isActionPage($page->getName())) { +if (isActionPage($page->getName())) { $pagetype []= _("Action page"); } if ($page->get('pagetype') == 'wikiblog') { Modified: trunk/themes/Sidebar/templates/actionbar.tmpl =================================================================== --- trunk/themes/Sidebar/templates/actionbar.tmpl 2010-05-18 14:33:53 UTC (rev 7403) +++ trunk/themes/Sidebar/templates/actionbar.tmpl 2010-05-18 14:47:58 UTC (rev 7404) @@ -3,7 +3,7 @@ $dbh = $request->getDbh(); $isAdmin = $user->isAdmin(); $pagename = $page->getName(); - $isActionPage = $request->_isActionPage($pagename, false); + $isActionPage = isActionPage($pagename); $isBrowse = $request->getArg('action') == 'browse'; $mayEdit = mayAccessPage('edit', $pagename); $mayChange = mayAccessPage('change', $pagename); @@ -66,4 +66,4 @@ </ul> </div> </div> -<?php } //isSignedIn ?> \ No newline at end of file +<?php } //isSignedIn ?> Modified: trunk/themes/default/templates/info.tmpl =================================================================== --- trunk/themes/default/templates/info.tmpl 2010-05-18 14:33:53 UTC (rev 7403) +++ trunk/themes/default/templates/info.tmpl 2010-05-18 14:47:58 UTC (rev 7404) @@ -151,7 +151,7 @@ if ($page->isUserPage($include_empty=true)) { $pagetype []= _("User page"); } -if (@$request->isActionPage($page->getName())) { +if (isActionPage($page->getName())) { $pagetype []= _("Action page"); } if ($page->get('pagetype') == 'wikiblog') { Modified: trunk/themes/default/templates/userprefs.tmpl =================================================================== --- trunk/themes/default/templates/userprefs.tmpl 2010-05-18 14:33:53 UTC (rev 7403) +++ trunk/themes/default/templates/userprefs.tmpl 2010-05-18 14:47:58 UTC (rev 7404) @@ -9,7 +9,7 @@ } $plugin = $request->getArg('pagename'); -if ($request->isActionPage($request->getArg('pagename')) +if (isActionPage($request->getArg('pagename')) and $isForm and $plugin == _("PreferencesInfo")) { $isForm = false; } Modified: trunk/themes/gforge/templates/actionbar.tmpl =================================================================== --- trunk/themes/gforge/templates/actionbar.tmpl 2010-05-18 14:33:53 UTC (rev 7403) +++ trunk/themes/gforge/templates/actionbar.tmpl 2010-05-18 14:47:58 UTC (rev 7404) @@ -7,7 +7,7 @@ $dbh = $request->getDbh(); $isAdmin = $user->isAdmin(); $pagename = $page->getName(); -$isActionPage = $request->_isActionPage($pagename, false); +$isActionPage = isActionPage($pagename); $isBrowse = $request->getArg('action') == 'browse'; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |