/** * (non-PHPdoc) * @see FormlessAction::onView() */ public function onView() { $this->getOutput()->setPageTitle($this->getPageTitle()); $c = $this->getItemClass(); // Yeah, this is needed in PHP 5.3 >_> $object = $c::get($this->getTitle()->getText()); if ($object === false) { $this->getOutput()->addWikiMsg('ep-' . strtolower($this->getName()) . '-norevs'); $lastRev = EPRevision::selectRow(null, array('type' => EPPageObject::getTypeForNS($this->getTitle()->getNamespace()), 'object_identifier' => $this->getTitle()->getText(), 'deleted' => true), array('SORT BY' => EPRevision::getPrefixedField('time'), 'ORDER' => 'DESC')); if ($lastRev !== false) { // TODO: show available info about deletion $this->getOutput()->addWikiMsg('ep-' . strtolower($this->getName()) . '-deleted'); } } else { $this->displayRevisions($object); } return ''; }
/** * This function should be overridden to return the name of the index fi- * eld. If the pager supports multiple orders, it may return an array of * 'querykey' => 'indexfield' pairs, so that a request with &count=querykey * will use indexfield to sort. In this case, the first returned key is * the default. * * Needless to say, it's really not a good idea to use a non-unique index * for this! That won't page right. * * @return string|Array */ function getIndexField() { return EPRevision::getPrefixedField('id'); }