use wcf\data\trophy\category\TrophyCategory;
use wcf\data\trophy\category\TrophyCategoryCache;
use wcf\data\trophy\TrophyList;
-use wcf\system\exception\IllegalLinkException;
-use wcf\system\exception\PermissionDeniedException;
+ use wcf\system\request\LinkHandler;
use wcf\system\WCF;
/**
*/
public $category;
- if (isset($_REQUEST['id'])) $this->categoryID = intval($_REQUEST['id']);
-
- $this->category = TrophyCategoryCache::getInstance()->getCategoryByID($this->categoryID);
-
- if ($this->category === null) {
- throw new IllegalLinkException();
- }
-
- if (!$this->category->isAccessible()) {
- throw new PermissionDeniedException();
- }
-
- $this->canonicalURL = LinkHandler::getInstance()->getLink('TrophyList', [
- 'object' => $this->category
- ], ($this->pageNo > 1 ? 'pageNo=' . $this->pageNo : ''));
+ /**
+ * @inheritDoc
+ */
+ public function readParameters() {
+ parent::readParameters();
+
++ $this->canonicalURL = LinkHandler::getInstance()->getLink('TrophyList', [], ($this->pageNo > 1 ? 'pageNo=' . $this->pageNo : ''));
+ }
+
/**
* @inheritDoc
*/
throw new PermissionDeniedException();
}
+ $this->category = $this->trophy->getCategory();
++
+ $this->canonicalURL = LinkHandler::getInstance()->getLink('Trophy', [
+ 'object' => $this->trophy
+ ], ($this->pageNo > 1 ? 'pageNo=' . $this->pageNo : ''));
}
/**