From: <var...@us...> - 2021-02-22 12:21:42
|
Revision: 10248 http://sourceforge.net/p/phpwiki/code/10248 Author: vargenau Date: 2021-02-22 12:21:40 +0000 (Mon, 22 Feb 2021) Log Message: ----------- plugin RandomPage: better test boolean arguments "redirect" and "hidename" Modified Paths: -------------- trunk/lib/plugin/RandomPage.php trunk/pgsrc/Help%2FRandomPagePlugin Modified: trunk/lib/plugin/RandomPage.php =================================================================== --- trunk/lib/plugin/RandomPage.php 2021-02-22 12:18:57 UTC (rev 10247) +++ trunk/lib/plugin/RandomPage.php 2021-02-22 12:21:40 UTC (rev 10248) @@ -63,6 +63,22 @@ $args = $this->getArgs($argstr, $request); extract($args); + if (($redirect == '0') || ($redirect == 'false')) { + $redirect = false; + } elseif (($redirect == '1') || ($redirect == 'true')) { + $redirect = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "redirect")); + } + + if (($hidename == '0') || ($hidename == 'false')) { + $hidename = false; + } elseif (($hidename == '1') || ($hidename == 'true')) { + $hidename = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "hidename")); + } + // Redirect would break HTML dump if ($request->getArg('action') != 'browse') { return $this->disabled(_("Plugin not run: not in browse mode")); Modified: trunk/pgsrc/Help%2FRandomPagePlugin =================================================================== --- trunk/pgsrc/Help%2FRandomPagePlugin 2021-02-22 12:18:57 UTC (rev 10247) +++ trunk/pgsrc/Help%2FRandomPagePlugin 2021-02-22 12:21:40 UTC (rev 10248) @@ -1,4 +1,4 @@ -Date: Tue, 9 Apr 2019 14:13:17 +0000 +Date: Mon, 22 Feb 2021 13:05:38 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.6.0) Content-Type: application/x-phpwiki; pagename=Help%2FRandomPagePlugin; @@ -28,9 +28,13 @@ | 20 |- | **redirect** -| Do not display random page link, redirect to random page. -| empty +| Boolean. If true, do not display random page link, redirect to random page. +| false |- +| **hidename** +| Boolean. If true, hide name (only for numpages=1) +| false +|- | **exclude** | Pages to exclude from random | RandomPage, HomePage, AllPages, RecentChanges, RecentEdits, FullRecentChanges This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |