From: <var...@us...> - 2022-03-24 13:28:36
|
Revision: 11008 http://sourceforge.net/p/phpwiki/code/11008 Author: vargenau Date: 2022-03-24 13:28:33 +0000 (Thu, 24 Mar 2022) Log Message: ----------- run php-cs-fixer Modified Paths: -------------- trunk/lib/plugin/AddComment.php trunk/lib/plugin/AllPages.php trunk/lib/plugin/AllUsers.php trunk/lib/plugin/AnalyseAccessLogSql.php trunk/lib/plugin/AppendText.php trunk/lib/plugin/AsciiMath.php trunk/lib/plugin/AsciiSVG.php trunk/lib/plugin/AtomFeed.php trunk/lib/plugin/AuthorHistory.php trunk/lib/plugin/BackLinks.php trunk/lib/plugin/BlogArchives.php trunk/lib/plugin/BlogJournal.php trunk/lib/plugin/BoxRight.php trunk/lib/plugin/CacheTest.php trunk/lib/plugin/Calendar.php trunk/lib/plugin/CalendarList.php trunk/lib/plugin/Chart.php trunk/lib/plugin/Comment.php trunk/lib/plugin/CreateBib.php trunk/lib/plugin/CreatePage.php trunk/lib/plugin/CreateToc.php trunk/lib/plugin/CurrentTime.php trunk/lib/plugin/DeadEndPages.php trunk/lib/plugin/DebugAuthInfo.php trunk/lib/plugin/DebugBackendInfo.php trunk/lib/plugin/DebugGroupInfo.php trunk/lib/plugin/DebugRetransform.php trunk/lib/plugin/Diff.php trunk/lib/plugin/DynamicIncludePage.php trunk/lib/plugin/EditMetaData.php trunk/lib/plugin/ExternalSearch.php trunk/lib/plugin/FacebookLike.php trunk/lib/plugin/FileInfo.php trunk/lib/plugin/FoafViewer.php trunk/lib/plugin/FullTextSearch.php trunk/lib/plugin/FuzzyPages.php trunk/lib/plugin/GoTo.php trunk/lib/plugin/GoogleMaps.php trunk/lib/plugin/GooglePlugin.php trunk/lib/plugin/GraphViz.php trunk/lib/plugin/HelloWorld.php trunk/lib/plugin/HtmlConverter.php trunk/lib/plugin/IncludePage.php trunk/lib/plugin/IncludePages.php trunk/lib/plugin/IncludeSiteMap.php trunk/lib/plugin/IncludeTree.php trunk/lib/plugin/InterWikiSearch.php trunk/lib/plugin/JabberPresence.php trunk/lib/plugin/LdapSearch.php trunk/lib/plugin/LikePages.php trunk/lib/plugin/LinkDatabase.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/ListPages.php trunk/lib/plugin/ListRelations.php trunk/lib/plugin/ListSubpages.php trunk/lib/plugin/MediawikiTable.php trunk/lib/plugin/ModeratedPage.php trunk/lib/plugin/MostPopular.php trunk/lib/plugin/NewPagesPerUser.php trunk/lib/plugin/NoCache.php trunk/lib/plugin/OldStyleTable.php trunk/lib/plugin/OrphanedPages.php trunk/lib/plugin/PageDump.php trunk/lib/plugin/PageGroup.php trunk/lib/plugin/PageHistory.php trunk/lib/plugin/PageInfo.php trunk/lib/plugin/PageTrail.php trunk/lib/plugin/PasswordReset.php trunk/lib/plugin/PhotoAlbum.php trunk/lib/plugin/PhpHighlight.php trunk/lib/plugin/Ploticus.php trunk/lib/plugin/PluginManager.php trunk/lib/plugin/PopUp.php trunk/lib/plugin/PopularNearby.php trunk/lib/plugin/PopularTags.php trunk/lib/plugin/PreferenceApp.php trunk/lib/plugin/PrevNext.php trunk/lib/plugin/Processing.php trunk/lib/plugin/RandomPage.php trunk/lib/plugin/RateIt.php trunk/lib/plugin/RawHtml.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/RecentComments.php trunk/lib/plugin/RecentEdits.php trunk/lib/plugin/RecentReferrers.php trunk/lib/plugin/RedirectTo.php trunk/lib/plugin/RelatedChanges.php trunk/lib/plugin/RichTable.php trunk/lib/plugin/RssFeed.php trunk/lib/plugin/SearchHighlight.php trunk/lib/plugin/SemanticRelations.php trunk/lib/plugin/SemanticSearch.php trunk/lib/plugin/SemanticSearchAdvanced.php trunk/lib/plugin/SiteMap.php trunk/lib/plugin/SpellCheck.php trunk/lib/plugin/SqlResult.php trunk/lib/plugin/SyncWiki.php trunk/lib/plugin/SyntaxHighlighter.php trunk/lib/plugin/SystemInfo.php trunk/lib/plugin/TeX2png.php trunk/lib/plugin/Template.php trunk/lib/plugin/TexToPng.php trunk/lib/plugin/TitleSearch.php trunk/lib/plugin/Transclude.php trunk/lib/plugin/TranslateText.php trunk/lib/plugin/UnfoldSubpages.php trunk/lib/plugin/UpLoad.php trunk/lib/plugin/UriResolver.php trunk/lib/plugin/UserPreferences.php trunk/lib/plugin/UserRatings.php trunk/lib/plugin/Video.php trunk/lib/plugin/VisualWiki.php trunk/lib/plugin/WantedPages.php trunk/lib/plugin/WatchPage.php trunk/lib/plugin/WhoIsOnline.php trunk/lib/plugin/WikiAdminChown.php trunk/lib/plugin/WikiAdminDeleteAcl.php trunk/lib/plugin/WikiAdminPurge.php trunk/lib/plugin/WikiAdminRemove.php trunk/lib/plugin/WikiAdminRename.php trunk/lib/plugin/WikiAdminSearchReplace.php trunk/lib/plugin/WikiAdminSelect.php trunk/lib/plugin/WikiAdminSetAcl.php trunk/lib/plugin/WikiAdminSetAclSimple.php trunk/lib/plugin/WikiAdminSetExternal.php trunk/lib/plugin/WikiAdminUtils.php trunk/lib/plugin/WikiBlog.php trunk/lib/plugin/WikiForm.php trunk/lib/plugin/WikiFormRich.php trunk/lib/plugin/WikiForum.php trunk/lib/plugin/WikiPoll.php trunk/lib/plugin/WikiTranslation.php trunk/lib/plugin/WikicreoleTable.php trunk/lib/plugin/YouTube.php trunk/lib/plugin/text2png.php Modified: trunk/lib/plugin/AddComment.php =================================================================== --- trunk/lib/plugin/AddComment.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AddComment.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -34,10 +34,9 @@ include_once 'lib/plugin/WikiBlog.php'; -class WikiPlugin_AddComment - extends WikiPlugin_WikiBlog +class WikiPlugin_AddComment extends WikiPlugin_WikiBlog { - function getDescription() + public function getDescription() { return sprintf(_("Show and add comments for %s."), '[pagename]'); } @@ -56,7 +55,7 @@ // jshide - boolean - quick javascript expansion of the comments // and addcomment box - function getDefaultArguments() + public function getDefaultArguments() { return array('pagename' => '[pagename]', 'order' => 'normal', @@ -74,7 +73,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); if (!$args['pagename']) { @@ -128,17 +127,20 @@ a.title='" . _("Click to display all comments") . "'; } }")); - $html->pushContent(HTML::h4(HTML::a(array('id' => 'comment-header', + $html->pushContent(HTML::h4(HTML::a( + array('id' => 'comment-header', 'class' => 'wikiaction', 'title' => _("Click to display"), 'onclick' => "togglecomments(this)"), - _("Comments")))); + _("Comments") + ))); } else { $div = HTML::div(array('id' => 'comments')); } foreach (explode(',', $args['mode']) as $show) { - if (!empty($seen[$show])) + if (!empty($seen[$show])) { continue; + } $seen[$show] = 1; switch ($show) { case 'show': @@ -161,5 +163,4 @@ $html->pushContent($div); return $html; } - } Modified: trunk/lib/plugin/AllPages.php =================================================================== --- trunk/lib/plugin/AllPages.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AllPages.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -30,18 +30,16 @@ * AllPagesCreatedByMe, AllPagesOwnedByMe, AllPagesLastAuthoredByMe */ -class WikiPlugin_AllPages - extends WikiPlugin +class WikiPlugin_AllPages extends WikiPlugin { - function getDescription() + public function getDescription() { return _("List all pages in this wiki."); } - function getDefaultArguments() + public function getDefaultArguments() { - return array_merge - ( + return array_merge( PageList::supportedArgs(), array( 'noheader' => false, @@ -48,7 +46,8 @@ 'include_empty' => false, 'info' => '', 'userpages' => false - )); + ) + ); } // info arg allows multiple columns @@ -63,7 +62,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); @@ -101,8 +100,10 @@ } if (isset($args['limit']) && !is_limit($args['limit'])) { - return HTML::p(array('class' => "error"), - _("Illegal “limit” argument: must be an integer or two integers separated by comma")); + return HTML::p( + array('class' => "error"), + _("Illegal “limit” argument: must be an integer or two integers separated by comma") + ); } if (empty($args['sortby'])) { @@ -120,27 +121,42 @@ } elseif (!empty($args['owner'])) { $pages = PageList::allPagesByOwner($args['owner'], $include_empty, $args['sortby']); $args['count'] = count($pages); - $caption = fmt("List of pages owned by %s (%d total):", - WikiLink($args['owner'] == '[]' + $caption = fmt( + "List of pages owned by %s (%d total):", + WikiLink( + $args['owner'] == '[]' ? $request->_user->getAuthenticatedId() : $args['owner'], - 'if_known'), $args['count']); + 'if_known' + ), + $args['count'] + ); } elseif (!empty($args['author'])) { $pages = PageList::allPagesByAuthor($args['author'], $include_empty, $args['sortby']); $args['count'] = count($pages); - $caption = fmt("List of pages last edited by %s (%d total):", - WikiLink($args['author'] == '[]' + $caption = fmt( + "List of pages last edited by %s (%d total):", + WikiLink( + $args['author'] == '[]' ? $request->_user->getAuthenticatedId() : $args['author'], - 'if_known'), $args['count']); + 'if_known' + ), + $args['count'] + ); } elseif (!empty($args['creator'])) { $pages = PageList::allPagesByCreator($args['creator'], $include_empty, $args['sortby']); $args['count'] = count($pages); - $caption = fmt("List of pages created by %s (%d total):", - WikiLink($args['creator'] == '[]' + $caption = fmt( + "List of pages created by %s (%d total):", + WikiLink( + $args['creator'] == '[]' ? $request->_user->getAuthenticatedId() : $args['creator'], - 'if_known'), $args['count']); + 'if_known' + ), + $args['count'] + ); } elseif ($pages) { $args['count'] = count($pages); } else { Modified: trunk/lib/plugin/AllUsers.php =================================================================== --- trunk/lib/plugin/AllUsers.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AllUsers.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -33,22 +33,21 @@ * externally authenticated users with a db users table, if auth_user_exists is defined. */ -class WikiPlugin_AllUsers - extends WikiPlugin +class WikiPlugin_AllUsers extends WikiPlugin { - function getDescription() + public function getDescription() { return _("List all once authenticated users."); } - function getDefaultArguments() + public function getDefaultArguments() { - return array_merge - ( + return array_merge( PageList::supportedArgs(), array('noheader' => false, 'include_empty' => true - )); + ) + ); } // info arg allows multiple columns @@ -67,13 +66,15 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); if (isset($args['limit']) && !is_limit($args['limit'])) { - return HTML::p(array('class' => "error"), - _("Illegal “limit” argument: must be an integer or two integers separated by comma")); + return HTML::p( + array('class' => "error"), + _("Illegal “limit” argument: must be an integer or two integers separated by comma") + ); } extract($args); @@ -97,16 +98,20 @@ $args['count'] = count($allusers); // deleted pages show up as version 0. $pagelist = new PageList($info, $exclude, $args); - if (!$noheader) + if (!$noheader) { $pagelist->setCaption(_("Authenticated users on this wiki (%d total):")); - if ($include_empty and empty($info)) + } + if ($include_empty and empty($info)) { $pagelist->_addColumn('version'); + } list($offset, $pagesize) = $pagelist->limit($args['limit']); if (!$pagesize) { $pagelist->addPageList($allusers); } else { for ($i = $offset; $i < $offset + $pagesize - 1; $i++) { - if ($i >= $args['count']) break; + if ($i >= $args['count']) { + break; + } $pagelist->addPage(trim($allusers[$i])); } } Modified: trunk/lib/plugin/AnalyseAccessLogSql.php =================================================================== --- trunk/lib/plugin/AnalyseAccessLogSql.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AnalyseAccessLogSql.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -30,8 +30,7 @@ * To add a new query, see getQueryString() */ -class WikiPlugin_AnalyseAccessLogSql - extends WikiPlugin +class WikiPlugin_AnalyseAccessLogSql extends WikiPlugin { public $_theadrow; public $_headerSet; @@ -88,8 +87,9 @@ } switch ($args['mode']) { case 'referring_urls': - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } $query = "SELECT " . "$Referring_URL AS Referring_URL, " . "count(*) AS Referral_Count " @@ -100,8 +100,9 @@ case 'external_referers': $args['local_referrers'] = 'false'; $where_conditions = $this->getWhereConditions($args); - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } $query = "SELECT " . "$Referring_URL AS Referring_URL, " . "count(*) AS Referral_Count " @@ -110,8 +111,9 @@ . "GROUP BY Referring_URL"; break; case 'referring_domains': - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } switch ($backend_type) { case 'mysql': $Referring_Domain = "left(referer, if(locate('/', referer, 8) > 0,locate('/', referer, 8) -1, length(referer)))"; @@ -132,8 +134,9 @@ . "GROUP BY Referring_Domain"; break; case 'remote_hosts': - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } $query = "SELECT " . "remote_host AS Remote_Host, " . "count(*) AS Access_Count " @@ -142,8 +145,9 @@ . "GROUP BY Remote_Host"; break; case 'users': - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } $query = "SELECT " . "remote_user AS User, " . "count(*) AS Access_Count " @@ -152,8 +156,9 @@ . "GROUP BY remote_user"; break; case 'host_users': - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = 'WHERE ' . $where_conditions . ' '; + } $query = "SELECT " . "remote_host AS Remote_Host, " . "remote_user AS User, " @@ -253,7 +258,7 @@ ); } - function getDefaultArguments() + public function getDefaultArguments() { return array( 'mode' => 'referring_domains', @@ -267,7 +272,7 @@ ); } - function getDescription() + public function getDescription() { return _("Show summary information from the access log table."); } @@ -279,19 +284,23 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { // flag that the output may not be cached - i.e. it is dynamic $request->setArg('nocache', 1); if (!$request->_user->isAdmin()) { - return HTML::p(array('class' => 'error'), - _("The requested information is available only to Administrators.")); + return HTML::p( + array('class' => 'error'), + _("The requested information is available only to Administrators.") + ); } if (!ACCESS_LOG_SQL) { // need read access - return HTML::p(array('class' => 'error'), - _("The ACCESS_LOG_SQL is not enabled.")); + return HTML::p( + array('class' => 'error'), + _("The ACCESS_LOG_SQL is not enabled.") + ); } // set aside a place for the table headers, see setHeaders() @@ -303,8 +312,10 @@ $query = $this->getQueryString($args); if ($query == '') { - return HTML::p(array('class' => 'error'), - sprintf(_("Unrecognised parameter 'mode=%s'"), $args['mode'])); + return HTML::p( + array('class' => 'error'), + sprintf(_("Unrecognised parameter 'mode=%s'"), $args['mode']) + ); } // get the data back. @@ -312,10 +323,12 @@ // otherwise the headers will not be ready $tbody = $this->getQueryResults($query, $dbi); - return HTML::table(array('class' => 'bordered'), + return HTML::table( + array('class' => 'bordered'), HTML::caption($this->getCaption($args)), HTML::thead($this->_theadrow), - $tbody); + $tbody + ); } private function getQueryResults($query, &$dbi) @@ -366,8 +379,9 @@ } $since = $since * $args['count']; if ($since > 0) { - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = $where_conditions . ' AND '; + } $since = time() - $since; $where_conditions = $where_conditions . "time_stamp > $since"; } @@ -375,8 +389,9 @@ if ($args['local_referrers'] <> 'true') { global $request; - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = $where_conditions . ' AND '; + } $localhost = SERVER_URL; $len = strlen($localhost); $backend_type = $request->_dbi->_backend->backendType(); @@ -397,8 +412,9 @@ // The assumed contract is that there is a space at the end of the // conditions string, so that following SQL clauses (such as GROUP BY) // will not cause a syntax error - if ($where_conditions <> '') + if ($where_conditions <> '') { $where_conditions = $where_conditions . ' '; + } return $where_conditions; } @@ -406,11 +422,12 @@ private function getCaption(&$args) { $caption = $args['caption']; - if ($caption == '') + if ($caption == '') { $caption = gettext($args['mode']); - if ($args['period'] <> '' && $args['count']) + } + if ($args['period'] <> '' && $args['count']) { $caption = $caption . " - " . $args['count'] . " " . gettext($args['period']); + } return $caption; } - } Modified: trunk/lib/plugin/AppendText.php =================================================================== --- trunk/lib/plugin/AppendText.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AppendText.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -33,15 +33,14 @@ * Todo: multiple pages. e.g. AppendText s=~[CategoryINtime~] page=<!plugin TitleSearch intime !> */ -class WikiPlugin_AppendText - extends WikiPlugin +class WikiPlugin_AppendText extends WikiPlugin { - function getDescription() + public function getDescription() { return _("Append text to any page in this wiki."); } - function getDefaultArguments() + public function getDefaultArguments() { return array('page' => '[pagename]', 'pages' => false, @@ -66,7 +65,7 @@ * @param string $basepage * @return HTML|XmlContent */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); @@ -85,8 +84,9 @@ return $this->work($args['page'], $args, $dbi, $request); } else { $html = HTML(); - if ($args['page'] != $basepage) + if ($args['page'] != $basepage) { $html->pushContent(_("pages argument overrides page argument. ignored."), HTML::br()); + } foreach ($args['pages'] as $pagename) { $html->pushContent($this->work($pagename, $args, $dbi, $request)); } @@ -98,9 +98,10 @@ { if (empty($args['s'])) { if ($request->isPost()) { - if ($pagename != _("AppendText")) + if ($pagename != _("AppendText")) { $request->redirect(WikiURL($pagename, array(), 'absurl'), false); - return HTML(); + } + return HTML(); } return HTML(); } @@ -109,8 +110,10 @@ $message = HTML(); if (!$page->exists()) { // We might want to create it? - $message->pushContent(sprintf(_("Page could not be updated. %s doesn't exist!"), - $pagename)); + $message->pushContent(sprintf( + _("Page could not be updated. %s doesn't exist!"), + $pagename + )); return $message; } @@ -123,17 +126,21 @@ $before = preg_quote($args['before'], "/"); // Insert before $newtext = preg_match("/\n${before}/", $oldtext) - ? preg_replace("/(\n${before})/", + ? preg_replace( + "/(\n${before})/", "\n" . preg_quote($text, "/") . "\\1", - $oldtext) + $oldtext + ) : $this->fallback($text, $oldtext, $args['before'], $message); } elseif (!empty($args['after'])) { // Insert after $after = preg_quote($args['after'], "/"); $newtext = preg_match("/\n${after}/", $oldtext) - ? preg_replace("/(\n${after})/", + ? preg_replace( + "/(\n${after})/", "\\1\n" . preg_quote($text, "/"), - $oldtext) + $oldtext + ) : $this->fallback($text, $oldtext, $args['after'], $message); } else { // Append at the end @@ -145,8 +152,10 @@ $meta = $current->_data; $meta['summary'] = sprintf(_("AppendText to %s"), $pagename); if ($page->save($newtext, $current->getVersion() + 1, $meta)) { - $message->pushContent(HTML::p(array('class' => 'feedback'), - _("Page successfully updated."))); + $message->pushContent(HTML::p( + array('class' => 'feedback'), + _("Page successfully updated.") + )); } // AppendText has been called from the same page that got modified @@ -158,7 +167,7 @@ // $request->redirect(WikiURL($pagename, array(), 'absurl'), false); return HTML(); - // The user asked to be redirected to the modified page + // The user asked to be redirected to the modified page } elseif ($redirect) { $request->redirect(WikiURL($pagename, array(), 'absurl'), false); return HTML(); Modified: trunk/lib/plugin/AsciiMath.php =================================================================== --- trunk/lib/plugin/AsciiMath.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AsciiMath.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -40,22 +40,21 @@ </math> */ -class WikiPlugin_AsciiMath - extends WikiPlugin +class WikiPlugin_AsciiMath extends WikiPlugin { public $source; - function getDescription() + public function getDescription() { return _("Render ASCII Math as MathML."); } - function getDefaultArguments() + public function getDefaultArguments() { return array(); } - function handle_plugin_args_cruft($argstr, $args) + public function handle_plugin_args_cruft($argstr, $args) { $this->source = $argstr; } @@ -67,7 +66,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); if (empty($this->source)) { Modified: trunk/lib/plugin/AsciiSVG.php =================================================================== --- trunk/lib/plugin/AsciiSVG.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AsciiSVG.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -27,17 +27,16 @@ * Syntax: http://www1.chapman.edu/~jipsen/svg/asciisvgcommands.html */ -class WikiPlugin_AsciiSVG - extends WikiPlugin +class WikiPlugin_AsciiSVG extends WikiPlugin { public $source; - function getDescription() + public function getDescription() { return _("Render inline ASCII SVG."); } - function getDefaultArguments() + public function getDefaultArguments() { return array('width' => 200, 'height' => 200, @@ -46,7 +45,7 @@ ); } - function handle_plugin_args_cruft($argstr, $args) + public function handle_plugin_args_cruft($argstr, $args) { $this->source = $argstr; } @@ -58,22 +57,24 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { global $WikiTheme; $args = $this->getArgs($argstr, $request); if (empty($this->source)) { - return HTML::p(array('class' => "error"), - _("Please provide SVG code to AsciiSVG plugin")); + return HTML::p( + array('class' => "error"), + _("Please provide SVG code to AsciiSVG plugin") + ); } $html = HTML(); if (empty($WikiTheme->_asciiSVG)) { - $js = JavaScript('', array - ('src' => $WikiTheme->_findData('ASCIIsvg.js'))); - if (empty($WikiTheme->_headers_printed)) + $js = JavaScript('', array('src' => $WikiTheme->_findData('ASCIIsvg.js'))); + if (empty($WikiTheme->_headers_printed)) { $WikiTheme->addMoreHeaders($js); - else + } else { $html->pushContent($js); + } $WikiTheme->_asciiSVG = 1; // prevent duplicates } // extract <script> @@ -86,11 +87,15 @@ //'src' => "d.svg", 'script' => $this->source); // additional onmousemove argument - if ($args['onmousemove']) $embedargs['onmousemove'] = $args['onmousemove']; + if ($args['onmousemove']) { + $embedargs['onmousemove'] = $args['onmousemove']; + } // we need script='data' and not script="data" $embed = new AsciiSVG_HTML("embed", $embedargs); $html->pushContent($embed); - if ($args['script']) $html->pushContent(JavaScript($args['script'])); + if ($args['script']) { + $html->pushContent(JavaScript($args['script'])); + } return $html; } } @@ -97,22 +102,24 @@ class AsciiSVG_HTML extends HtmlElement { - function startTag() + public function startTag() { $start = "<" . $this->_tag; $this->_setClasses(); foreach ($this->_attr as $attr => $val) { if (is_bool($val)) { - if (!$val) + if (!$val) { continue; + } $val = $attr; } $qval = str_replace("\"", '"', $this->_quote((string)$val)); - if ($attr == 'script') + if ($attr == 'script') { // note the ' not " $start .= " $attr='$qval'"; - else + } else { $start .= " $attr=\"$qval\""; + } } $start .= ">"; return $start; Modified: trunk/lib/plugin/AtomFeed.php =================================================================== --- trunk/lib/plugin/AtomFeed.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AtomFeed.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -29,15 +29,14 @@ require_once 'lib/WikiPlugin.php'; require_once 'lib/AtomParser.php'; -class WikiPlugin_AtomFeed - extends WikiPlugin +class WikiPlugin_AtomFeed extends WikiPlugin { - function getDescription() + public function getDescription() { return _('Atom Aggregator Plugin.'); } - function getDefaultArguments() + public function getDefaultArguments() { return array( 'feed' => "", @@ -55,7 +54,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { extract($this->getArgs($argstr, $request)); Modified: trunk/lib/plugin/AuthorHistory.php =================================================================== --- trunk/lib/plugin/AuthorHistory.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/AuthorHistory.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -51,17 +51,16 @@ require_once 'lib/PageList.php'; -class WikiPlugin_AuthorHistory - extends WikiPlugin +class WikiPlugin_AuthorHistory extends WikiPlugin { public $_args; - function getDescription() + public function getDescription() { return _("List all page revisions edited by one user with diff links, or show a PageHistory-like list of a single page for only one user."); } - function getDefaultArguments() + public function getDefaultArguments() { global $request; return array('exclude' => '', @@ -85,7 +84,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $this->_args = $this->getArgs($argstr, $request); extract($this->_args); @@ -123,8 +122,9 @@ if (!$author) { // user not signed in and no author specified return HTML::p(array('class' => 'error'), _("You are not signed in and no author is specified.")); } - if ($page && $page == 'username') //FIXME: use [username]!!!!! + if ($page && $page == 'username') { //FIXME: use [username]!!!!! $page = $author; + } $nbsp = HTML::raw(' '); @@ -137,8 +137,11 @@ if (!($page == 'all')) { $p = $dbi->getPage($page); - $thead->pushContent(HTML::tr(HTML::th(array('class' => 'align-right'), - _("Version")), + $thead->pushContent(HTML::tr( + HTML::th( + array('class' => 'align-right'), + _("Version") + ), $includeminor ? HTML::th(_("Minor")) : "", HTML::th(_("Author")), HTML::th(_("Summary")), @@ -147,22 +150,32 @@ $allrevisions_iter = $p->getAllRevisions(); while ($rev = $allrevisions_iter->next()) { - $isminor = $rev->get('is_minor_edit'); $authordoesmatch = $author == $rev->get('author'); if ($authordoesmatch && (!$isminor || ($includeminor && $isminor))) { - $difflink = Button(array('action' => 'diff', + $difflink = Button( + array('action' => 'diff', 'previous' => 'minor'), - $rev->getVersion(), $rev); - $tr = HTML::tr(HTML::td(array('class' => 'align-right'), - $difflink, $nbsp), + $rev->getVersion(), + $rev + ); + $tr = HTML::tr( + HTML::td( + array('class' => 'align-right'), + $difflink, + $nbsp + ), $includeminor ? (HTML::td($nbsp, ($isminor ? "minor" : "major"), $nbsp)) : "", - HTML::td($nbsp, WikiLink($rev->get('author'), - 'if_known'), $nbsp), + HTML::td($nbsp, WikiLink( + $rev->get('author'), + 'if_known' + ), $nbsp), HTML::td($nbsp, $rev->get('summary')), - HTML::td(array('class' => 'align-right'), - $WikiTheme->formatDateTime($rev->get('mtime'))) + HTML::td( + array('class' => 'align-right'), + $WikiTheme->formatDateTime($rev->get('mtime')) + ) ); $class = $isminor ? 'evenrow' : 'oddrow'; @@ -170,17 +183,22 @@ $tbody->pushContent($tr); } } - $captext = fmt($includeminor + $captext = fmt( + $includeminor ? "History of all major and minor edits by %s to page %s." : "History of all major edits by %s to page %s.", - WikiLink($author, 'auto'), - WikiLink($page, 'auto')); + WikiLink($author, 'auto'), + WikiLink($page, 'auto') + ); } else { //search all pages for all edits by this author - $thead->pushContent(HTML::tr(HTML::th(_("Page Name")), - HTML::th(array('class' => 'align-right'), - _("Version")), + $thead->pushContent(HTML::tr( + HTML::th(_("Page Name")), + HTML::th( + array('class' => 'align-right'), + _("Version") + ), $includeminor ? HTML::th(_("Minor")) : "", HTML::th(_("Summary")), HTML::th(_("Modified")) @@ -188,25 +206,34 @@ $allpages_iter = $dbi->getAllPages($includedeleted); while ($p = $allpages_iter->next()) { - $allrevisions_iter = $p->getAllRevisions(); while ($rev = $allrevisions_iter->next()) { $isminor = $rev->get('is_minor_edit'); $authordoesmatch = $author == $rev->get('author'); if ($authordoesmatch && (!$isminor || ($includeminor && $isminor))) { - $difflink = Button(array('action' => 'diff', + $difflink = Button( + array('action' => 'diff', 'previous' => 'minor'), - $rev->getVersion(), $rev); + $rev->getVersion(), + $rev + ); $tr = HTML::tr( - HTML::td($nbsp, + HTML::td( + $nbsp, ($isminor ? $rev->_pagename : WikiLink($rev->_pagename, 'auto')) ), - HTML::td(array('class' => 'align-right'), - $difflink, $nbsp), + HTML::td( + array('class' => 'align-right'), + $difflink, + $nbsp + ), $includeminor ? (HTML::td($nbsp, ($isminor ? "minor" : "major"), $nbsp)) : "", HTML::td($nbsp, $rev->get('summary')), - HTML::td(array('class' => 'align-right'), - $WikiTheme->formatDateTime($rev->get('mtime')), $nbsp) + HTML::td( + array('class' => 'align-right'), + $WikiTheme->formatDateTime($rev->get('mtime')), + $nbsp + ) ); $class = $isminor ? 'evenrow' : 'oddrow'; @@ -216,10 +243,12 @@ } } - $captext = fmt($includeminor + $captext = fmt( + $includeminor ? "History of all major and minor modifications for any page edited by %s." : "History of major modifications for any page edited by %s.", - WikiLink($author, 'auto')); + WikiLink($author, 'auto') + ); } $table->pushContent(HTML::caption($captext)); Modified: trunk/lib/plugin/BackLinks.php =================================================================== --- trunk/lib/plugin/BackLinks.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/BackLinks.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -24,18 +24,16 @@ require_once 'lib/PageList.php'; -class WikiPlugin_BackLinks - extends WikiPlugin +class WikiPlugin_BackLinks extends WikiPlugin { - function getDescription() + public function getDescription() { return sprintf(_("List all pages which link to %s."), '[pagename]'); } - function getDefaultArguments() + public function getDefaultArguments() { - return array_merge - ( + return array_merge( PageList::supportedArgs(), array('include_self' => false, 'noheader' => false, @@ -42,7 +40,8 @@ 'page' => '[pagename]', 'linkmore' => '', // If count>0 and limit>0 display a link with // the number of all results, linked to the given pagename. - )); + ) + ); } // info arg allows multiple columns @@ -57,13 +56,15 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); if (isset($args['limit']) && !is_limit($args['limit'])) { - return HTML::p(array('class' => "error"), - _("Illegal “limit” argument: must be an integer or two integers separated by comma")); + return HTML::p( + array('class' => "error"), + _("Illegal “limit” argument: must be an integer or two integers separated by comma") + ); } extract($args); @@ -122,15 +123,18 @@ $bi = $dp->getBackLinks(false, $sortby, 0, $exclude); while ($b = $bi->next()) { $name = $b->getName(); - if (isset($bl[$name])) + if (isset($bl[$name])) { $bl[$name]++; - else + } else { $bl[$name] = 1; + } } } - foreach ($bl as $b => $v) - if ($v == $count) + foreach ($bl as $b => $v) { + if ($v == $count) { $pagelist->addPage($b); + } + } } else { $p = $dbi->getPage($page); $pagelist->addPages($p->getBackLinks(false, $sortby, 0, $exclude)); @@ -156,12 +160,16 @@ // page currently being viewed. $pagelink = $page; - if ($pagelist->isEmpty()) + if ($pagelist->isEmpty()) { return HTML::p(fmt("No other page links to %s yet.", $pagelink)); + } - if ($total == 1) - $pagelist->setCaption(fmt("One page would link to %s:", - $pagelink)); + if ($total == 1) { + $pagelist->setCaption(fmt( + "One page would link to %s:", + $pagelink + )); + } // Some future localizations will actually require // this... (BelieveItOrNot, English-only-speakers!(:) // @@ -168,28 +176,38 @@ // else if ($pagelist->getTotal() == 2) // $pagelist->setCaption(fmt("Two pages would link to %s:", // $pagelink)); - else - $pagelist->setCaption(fmt("%s pages would link to %s:", - $total, $pagelink)); + else { + $pagelist->setCaption(fmt( + "%s pages would link to %s:", + $total, + $pagelink + )); + } } else { if ($count) { $tmp_pages = $pages; $p = array_shift($tmp_pages); $pagelink = HTML(WikiLink($p, 'auto')); - foreach ($tmp_pages as $p) + foreach ($tmp_pages as $p) { $pagelink->pushContent(" ", _("AND"), " ", WikiLink($p, 'auto')); - } else + } + } else { // BackLinks plugin is being displayed on a normal page. $pagelink = WikiLink($page, 'auto'); + } - if ($pagelist->isEmpty()) + if ($pagelist->isEmpty()) { return HTML::p(fmt("No page links to %s.", $pagelink)); + } //trigger_error("DEBUG: " . $pagelist->getTotal()); - if ($total == 1) - $pagelist->setCaption(fmt("One page links to %s:", - $pagelink)); + if ($total == 1) { + $pagelist->setCaption(fmt( + "One page links to %s:", + $pagelink + )); + } // Some future localizations will actually require // this... (BelieveItOrNot, English-only-speakers!(:) // @@ -196,26 +214,29 @@ // else if ($pagelist->getTotal() == 2) // $pagelist->setCaption(fmt("Two pages link to %s:", // $pagelink)); - else - $pagelist->setCaption(fmt("%s pages link to %s:", + else { + $pagelist->setCaption(fmt( + "%s pages link to %s:", $limit > 0 ? $total : _("Those"), - $pagelink)); + $pagelink + )); + } } } if (!empty($args['linkmore']) and $dbi->isWikiPage($args['linkmore']) and $limit > 0 and $total > $limit - ) + ) { $pagelist->addCaption(WikiLink($args['linkmore'], "auto", _("More..."))); + } return $pagelist; } - } // how many links from this backLink to other pages class _PageList_Column_BackLinks_count extends _PageList_Column { - function _getValue($page_handle, $revision_handle) + public function _getValue($page_handle, $revision_handle) { $iter = $page_handle->getPageLinks(); return $iter->count(); Modified: trunk/lib/plugin/BlogArchives.php =================================================================== --- trunk/lib/plugin/BlogArchives.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/BlogArchives.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -35,15 +35,14 @@ * @author: Reini Urban */ -class WikiPlugin_BlogArchives - extends WikiPlugin_WikiBlog +class WikiPlugin_BlogArchives extends WikiPlugin_WikiBlog { - function getDescription() + public function getDescription() { return _("List blog months links for the current or ADMIN user."); } - function getDefaultArguments() + public function getDefaultArguments() { return //array_merge //( @@ -63,11 +62,13 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { if (is_array($argstr)) { // can do with array also. $args =& $argstr; - if (!isset($args['order'])) $args['order'] = 'reverse'; + if (!isset($args['order'])) { + $args['order'] = 'reverse'; + } } else { $args = $this->getArgs($argstr, $request); } @@ -80,10 +81,12 @@ } } if (!$args['user'] or $args['user'] == ADMIN_USER) { - if (BLOG_DEFAULT_EMPTY_PREFIX) - $args['user'] = ''; // "Blogs/day" pages - else - $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages + if (BLOG_DEFAULT_EMPTY_PREFIX) { + $args['user'] = ''; + } // "Blogs/day" pages + else { + $args['user'] = ADMIN_USER; + } // "Admin/Blogs/day" pages } $parent = (empty($args['user']) ? '' : $args['user'] . '/'); @@ -98,50 +101,65 @@ $html = HTML::ul(); while ($page = $pages->next()) { $rev = $page->getCurrentRevision(false); - if ($rev->get('pagetype') != 'wikiblog') continue; + if ($rev->get('pagetype') != 'wikiblog') { + continue; + } $blog = $this->_blog($rev); $html->pushContent(HTML::li(WikiLink($page, 'known', $rev->get('summary')))); } - if (!$args['noheader']) - return HTML(HTML::h3(sprintf(_("Blog Entries for %s:"), $this->monthTitle($args['month']))), - $html); - else + if (!$args['noheader']) { + return HTML( + HTML::h3(sprintf(_("Blog Entries for %s:"), $this->monthTitle($args['month']))), + $html + ); + } else { return $html; + } } $blogs = $this->findBlogs($dbi, $args['user']); if ($blogs) { - if (!$basepage) $basepage = _("BlogArchives"); + if (!$basepage) { + $basepage = _("BlogArchives"); + } $html = HTML::ul(); usort($blogs, array("WikiPlugin_WikiBlog", "cmp")); - if ($args['order'] == 'reverse') + if ($args['order'] == 'reverse') { $blogs = array_reverse($blogs); + } // collapse pagenames by month $months = array(); foreach ($blogs as $rev) { $blog = $this->_blog($rev); $mon = $blog['month']; - if (empty($months[$mon])) + if (empty($months[$mon])) { $months[$mon] = array('title' => $this->monthTitle($mon), 'num' => 1, 'month' => $mon, - 'link' => WikiURL($basepage, - $this->nonDefaultArgs(array('month' => $mon)))); - else + 'link' => WikiURL( + $basepage, + $this->nonDefaultArgs(array('month' => $mon)) + )); + } else { $months[$mon]['num']++; + } } foreach ($months as $m) { - $html->pushContent(HTML::li(HTML::a(array('href' => $m['link'], + $html->pushContent(HTML::li(HTML::a( + array('href' => $m['link'], 'class' => 'named-wiki'), - $m['title'] . " (" . $m['num'] . ")"))); + $m['title'] . " (" . $m['num'] . ")" + ))); } - if (!$args['noheader']) + if (!$args['noheader']) { return HTML(HTML::h3(_("Blog Archives:")), $html); - else + } else { return $html; - } else + } + } else { return ''; + } } // box is used to display a fixed-width, narrow version with common header @@ -151,10 +169,14 @@ * @param string $basepage * @return $this|HtmlElement */ - function box($args = '', $request = null, $basepage = '') + public function box($args = '', $request = null, $basepage = '') { - if (!$request) $request =& $GLOBALS['request']; - if (!$args or empty($args['limit'])) $args['limit'] = 10; + if (!$request) { + $request =& $GLOBALS['request']; + } + if (!$args or empty($args['limit'])) { + $args['limit'] = 10; + } $args['noheader'] = 1; return $this->makeBox(_("Archives"), $this->run($request->_dbi, $args, $request, $basepage)); } Modified: trunk/lib/plugin/BlogJournal.php =================================================================== --- trunk/lib/plugin/BlogJournal.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/BlogJournal.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -34,15 +34,14 @@ * @author: Reini Urban */ -class WikiPlugin_BlogJournal - extends WikiPlugin_WikiBlog +class WikiPlugin_BlogJournal extends WikiPlugin_WikiBlog { - function getDescription() + public function getDescription() { return _("Include latest blog entries for the current or ADMIN user."); } - function getDefaultArguments() + public function getDefaultArguments() { return array('count' => 7, 'user' => '', @@ -59,11 +58,13 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { if (is_array($argstr)) { // can do with array also. $args =& $argstr; - if (!isset($args['order'])) $args['order'] = 'reverse'; + if (!isset($args['order'])) { + $args['order'] = 'reverse'; + } } else { $args = $this->getArgs($argstr, $request); } @@ -85,29 +86,40 @@ $parent = (empty($args['user']) ? '' : $args['user'] . '/'); $prefix = $base = $parent . $this->blogPrefix(); - if ($args['month']) + if ($args['month']) { $prefix .= ('/' . $args['month']); + } $pages = $dbi->titleSearch(new TextSearchQuery("^" . $prefix . '/', true, 'posix')); $html = HTML(); $i = 0; while (($page = $pages->next()) and $i < $args['count']) { $rev = $page->getCurrentRevision(false); - if ($rev->get('pagetype') != 'wikiblog') continue; + if ($rev->get('pagetype') != 'wikiblog') { + continue; + } $i++; $blog = $this->_blog($rev); //$html->pushContent(HTML::h3(WikiLink($page, 'known', $rev->get('summary')))); $html->pushContent($rev->getTransformedContent('wikiblog')); } - if ($args['user'] == $user->UserName() or $args['user'] == '') - $html->pushContent(Button(array('action' => 'WikiBlog', + if ($args['user'] == $user->UserName() or $args['user'] == '') { + $html->pushContent(Button( + array('action' => 'WikiBlog', 'mode' => 'add'), - _("New entry"), $base)); - if (!$i) + _("New entry"), + $base + )); + } + if (!$i) { return HTML(HTML::h3(_("No Blog Entries")), $html); - if (!$args['noheader']) - return HTML(HTML::h3(sprintf(_("Blog Entries for %s:"), $this->monthTitle($args['month']))), - $html); - else + } + if (!$args['noheader']) { + return HTML( + HTML::h3(sprintf(_("Blog Entries for %s:"), $this->monthTitle($args['month']))), + $html + ); + } else { return $html; + } } } Modified: trunk/lib/plugin/BoxRight.php =================================================================== --- trunk/lib/plugin/BoxRight.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/BoxRight.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -26,20 +26,19 @@ * A simple plugin for <div class="boxright"> with wikimarkup */ -class WikiPlugin_BoxRight - extends WikiPlugin +class WikiPlugin_BoxRight extends WikiPlugin { - function getDescription() + public function getDescription() { return _("A simple plugin for <div class=boxright> with wikimarkup."); } - function getDefaultArguments() + public function getDefaultArguments() { return array(); } - function managesValidators() + public function managesValidators() { // The plugin output will only change if the plugin // invocation (page text) changes --- so the necessary @@ -54,7 +53,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) + public function run($dbi, $argstr, &$request, $basepage) { if (!$basepage) { return $this->error("$basepage unset?"); @@ -63,5 +62,4 @@ $page = $request->getPage($basepage); return HTML::div(array('class' => 'boxright'), TransformText($argstr)); } - } Modified: trunk/lib/plugin/CacheTest.php =================================================================== --- trunk/lib/plugin/CacheTest.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/CacheTest.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -38,22 +38,21 @@ require_once 'lib/WikiPluginCached.php'; -class WikiPlugin_CacheTest - extends WikiPluginCached +class WikiPlugin_CacheTest extends WikiPluginCached { /* --------- overwrite abstract methods ---------------- */ - function getPluginType() + public function getPluginType() { return PLUGIN_CACHED_IMG_ONDEMAND; } - function getDescription() + public function getDescription() { return _('This is a simple example using WikiPluginCached.'); } - function getDefaultArguments() + public function getDefaultArguments() { return array('text' => $this->getDescription(), 'font' => '3', @@ -86,7 +85,7 @@ trigger_error('pure virtual', E_USER_ERROR); } - function getImageType($dbi, $argarray, $request) + public function getImageType($dbi, $argarray, $request) { extract($argarray); if (in_array($type, array('png', 'gif', 'jpg'))) { @@ -95,7 +94,7 @@ return 'png'; } - function getAlt($dbi, $argarray, $request) + public function getAlt($dbi, $argarray, $request) { // ALT-text for <img> tag extract($argarray); @@ -102,7 +101,7 @@ return $text; } - function getExpire($dbi, $argarray, $request) + public function getExpire($dbi, $argarray, $request) { return '+600'; // 600 seconds life time } @@ -109,7 +108,7 @@ /* -------------------- extremely simple converter -------------------- */ - function produceGraphics($text, $font) + public function produceGraphics($text, $font) { // The idea (and some code) is stolen from the text2png plugin // but I did not want to use TTF. Imagestring is quite ugly @@ -148,17 +147,19 @@ // we could have used the simple built-in text2img function // instead of writing our own: - function lazy_produceGraphics($text, $font) + public function lazy_produceGraphics($text, $font) { if ($font < 1 || $font > 5) { $text = "Fontnr. (font=\"$font\") should be in range 1-5"; $this->complain($text); $font = 3; - } - return $this->text2img($text, $font, array(0, 0, 0), - array(255, 255, 255)); + return $this->text2img( + $text, + $font, + array(0, 0, 0), + array(255, 255, 255) + ); } // lazy_produceGraphics - } Modified: trunk/lib/plugin/Calendar.php =================================================================== --- trunk/lib/plugin/Calendar.php 2022-03-15 14:23:50 UTC (rev 11007) +++ trunk/lib/plugin/Calendar.php 2022-03-24 13:28:33 UTC (rev 11008) @@ -22,8 +22,9 @@ * */ -if (!defined('SECONDS_PER_DAY')) +if (!defined('SECONDS_PER_DAY')) { define('SECONDS_PER_DAY', 24 * 3600); +} // FIXME: Still needs: // @@ -34,19 +35,18 @@ // pages back to the calendar page. (Subpage support might make this // easier.) -class WikiPlugin_Calendar - extends WikiPlugin +class WikiPlugin_Calendar ex... [truncated message content] |