'', 'include_self' => false, 'noheader' => false, 'page' => '[pagename]', 'info' => false ); } // info arg allows multiple columns // info=mtime,hits,summary,version,author,locked,minor // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges function run($dbi, $argstr, $request) { $this->_args = $this->getArgs($argstr, $request); extract($this->_args); if (!$page) return ''; $exclude = $exclude ? explode(",", $exclude) : array(); if (!$include_self) $exclude[] = $page; $pagelist = new PageList($info, $exclude); $p = $dbi->getPage($page); $pagelist->addPages($p->getLinks()); // Localization note: In English, the differences between the // various phrases spit out here may seem subtle or negligible // enough to tempt you to combine/normalize some of these // strings together, but the grammar employed most by other // languages does not always end up with so subtle a // distinction as it does with English in this case. :) if (!$noheader) { if ($page == $request->args['pagename'] && !$dbi->isWikiPage($page)) { // BackLinks plugin is more than likely being called // upon for an empty page on said page, while either // 'browse'ing, 'create'ing or 'edit'ing. // // Don't bother displaying a WikiLink 'unknown', just // the Un~WikiLink~ified (plain) name of the uncreated // page currently being viewed. $pagelink = $page; if ($pagelist->isEmpty()) return HTML::p(fmt("No other page links to %s yet.", $pagelink)); if ($pagelist->getTotal() == 1) $pagelist->setCaption(fmt("One page would link to %s:", $pagelink)); // Some future localizations will actually require // this... (BelieveItOrNot, English-only-speakers!(:) // // 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:", $pagelist->getTotal(), $pagelink)); } else { // BackLinks plugin is being displayed on a normal page. $pagelink = WikiLink($page, 'auto'); if ($pagelist->isEmpty()) return HTML::p(fmt("No page links to %s.", $pagelink)); trigger_error($pagelist->getTotal()); if ($pagelist->getTotal() == 1) $pagelist->setCaption(fmt("One page links to %s:", $pagelink)); // Some future localizations will actually require // this... (BelieveItOrNot, English-only-speakers!(:) // // else if ($pagelist->getTotal() == 2) // $pagelist->setCaption(fmt("Two pages link to %s:", // $pagelink)); else $pagelist->setCaption(fmt("%s pages link to %s:", $pagelist->getTotal(), $pagelink)); } } return $pagelist; } }; // $Log: not supported by cvs2svn $ // Revision 1.19 2003/01/18 21:19:25 carstenklapp // Code cleanup: // Reformatting; added copyleft, getVersion, getDescription // // For emacs users // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>