From: Reini U. <ru...@us...> - 2008-01-24 19:26:23
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32111/lib/plugin Modified Files: RecentChanges.php Log Message: remove unsed filter links from icons Index: RecentChanges.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/RecentChanges.php,v retrieving revision 1.121 retrieving revision 1.122 diff -u -2 -b -p -d -r1.121 -r1.122 --- RecentChanges.php 25 Aug 2007 18:54:41 -0000 1.121 +++ RecentChanges.php 24 Jan 2008 19:26:24 -0000 1.122 @@ -43,5 +43,8 @@ class _RecentChanges_Formatter function title () { + global $request; extract($this->_args); + if ($author == '[]') $author = $request->_user->getID(); + if ($owner == '[]') $owner = $request->_user->getID(); if ($author) $title = _("UserContribs").":$author"; elseif ($owner) $title = _("UserContribs").":$owner"; @@ -164,5 +167,6 @@ extends _RecentChanges_Formatter function pageLink ($rev, $link_text=false) { - return WikiLink($this->include_versions_in_URLs() ? $rev : $rev->getPage(),'auto',$link_text); + return WikiLink($this->include_versions_in_URLs() ? $rev : $rev->getPage(), + 'auto', $link_text); /* $page = $rev->getPage(); @@ -220,22 +224,32 @@ extends _RecentChanges_Formatter } - function format_icon ($format) { + function format_icon ($format, $filter = array()) { global $request, $WikiTheme; - $rss_url = $request->getURLtoSelf(array('action' => $this->action, 'format' => $format)); + $args = $this->_args; + // remove links not used for those formats + unset($args['daylist']); + unset($args['difflinks']); + unset($args['historylinks']); + $rss_url = $request->getURLtoSelf + (array_merge($args, + array('action' => $this->action, 'format' => $format), + $filter)); return $WikiTheme->makeButton($format, $rss_url, 'rssicon'); } - function rss_icon () { return $this->format_icon("rss"); } - function rss2_icon () { return $this->format_icon("rss2"); } - function atom_icon () { return $this->format_icon("atom"); } - function rdf_icon () { return DEBUG ? $this->format_icon("rdf") : ''; } - function rdfs_icon () { return DEBUG ? $this->format_icon("rdfs") : ''; } - function owl_icon () { return DEBUG ? $this->format_icon("owl") : ''; } + function rss_icon ($args=array()) { return $this->format_icon("rss", $args); } + function rss2_icon ($args=array()) { return $this->format_icon("rss2", $args); } + function atom_icon ($args=array()) { return $this->format_icon("atom", $args); } + function rdf_icon ($args=array()) { return DEBUG ? $this->format_icon("rdf", $args) : ''; } + function rdfs_icon ($args=array()) { return DEBUG ? $this->format_icon("rdfs", $args) : ''; } + function owl_icon ($args=array()) { return DEBUG ? $this->format_icon("owl", $args) : ''; } - function grazr_icon () { + function grazr_icon ($args = array()) { global $request, $WikiTheme; - if (!DEBUG) return ''; + if (is_localhost()) return ''; $rss_url = 'http://grazr.com/gzpanel.html?' . - WikiURL($request->getArg('pagename'),array('action' => $this->action, 'format' => 'rss2'),true); + WikiURL($request->getArg('pagename'), + array_merge(array('action' => $this->action, 'format' => 'rss2'), $args), + true); return $WikiTheme->makeButton("grazr", $rss_url, 'rssicon'); } @@ -472,12 +486,18 @@ extends _RecentChanges_HtmlFormatter { function headline () { + global $request; extract($this->_args); - return array(_("UserContribs"),":",$author ? $author : $owner, + if ($author == '[]') $author = $request->_user->getID(); + if ($owner == '[]') $owner = $request->_user->getID(); + $author_args = $owner + ? array('owner' => $owner) + : array('author' => $author); + return array(_("UserContribs"),":",$owner ? $owner : $author, ' ', - $this->rss_icon(), - $this->rss2_icon(), - $this->atom_icon(), - $this->rdf_icon(), - $this->grazr_icon()); + $this->rss_icon($author_args), + $this->rss2_icon($author_args), + $this->atom_icon($author_args), + $this->rdf_icon($author_args), + $this->grazr_icon($author_args)); } @@ -722,4 +742,5 @@ extends _RecentChanges_Formatter $request->discardOutput(); $rss->finish(); + //header("Content-Type: application/rss+xml; charset=" . $GLOBALS['charset']); printf("\n<!-- Generated by PhpWiki-%s:\n%s-->\n", PHPWIKI_VERSION, $GLOBALS['RCS_IDS']); @@ -826,13 +847,15 @@ extends _RecentChanges_RssFormatter { $rss->addItem($this->item_properties($rev), $this->pageURI($rev)); - if ($first) + if ($first) { $this->setValidators($rev); $first = false; } } + } global $request; $request->discardOutput(); $rss->finish(); + //header("Content-Type: application/rss+xml; charset=" . $GLOBALS['charset']); printf("\n<!-- Generated by PhpWiki-%s:\n%s-->\n", PHPWIKI_VERSION, $GLOBALS['RCS_IDS']); // Flush errors in comment, otherwise it's invalid XML. @@ -911,4 +934,5 @@ extends _RecentChanges_RssFormatter { $request->discardOutput(); $rss->finish(); + //header("Content-Type: application/atom; charset=" . $GLOBALS['charset']); printf("\n<!-- Generated by PhpWiki-%s:\n%s-->\n", PHPWIKI_VERSION, $GLOBALS['RCS_IDS']); // Flush errors in comment, otherwise it's invalid XML. @@ -1261,4 +1285,5 @@ extends WikiPlugin $args['days'] = min($args['days'], 365000); + // Within Categories just display Category Backlinks if (empty($args['category']) and empty($args['pagematch']) and preg_match("/^Category/", $request->getArg('pagename'))) @@ -1341,4 +1366,7 @@ class DayButtonBar extends HtmlElement { // $Log$ +// Revision 1.122 2008/01/24 19:26:24 rurban +// remove unsed filter links from icons +// // Revision 1.121 2007/08/25 18:54:41 rurban // split title into extra headline. simplify icons, add category, pagematch arguments |