/** * Returns an instance of the ContestMenu class. * * @return ContestMenu */ public static function getInstance() { if (self::$instance == null) { self::$instance = new self(); } return self::$instance; }
/** * @see Form::show() */ public function show() { // set active header menu item PageMenu::setActiveMenuItem('wcf.header.menu.user.contest'); // set active menu item ContestMenu::getInstance()->setContest($this->entry); ContestMenu::getInstance()->setActiveMenuItem('wcf.contest.menu.link.overview'); // check permission WCF::getUser()->checkPermission('user.contest.canViewContest'); if (!MODULE_CONTEST) { throw new IllegalLinkException(); } parent::show(); }
/** * @see Page::show() */ public function show() { // set active header menu item PageMenu::setActiveMenuItem('wcf.header.menu.user.contest'); // set active menu item ContestMenu::getInstance()->setContest($this->contest); ContestMenu::getInstance()->setActiveMenuItem('wcf.contest.menu.link.solution'); // check permission WCF::getUser()->checkPermission('user.contest.canViewContest'); if (!MODULE_CONTEST) { throw new IllegalLinkException(); } // check upload permission if (MODULE_ATTACHMENT != 1 || !WCF::getUser()->getPermission('user.contest.canUploadAttachment')) { $this->showAttachments = false; } // get attachments editor if ($this->attachmentListEditor === null) { require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentListEditor.class.php'; $this->attachmentListEditor = new MessageAttachmentListEditor(array(), 'contestSolutionEntry', WCF::getPackageID('de.easy-coding.wcf.contest'), WCF::getUser()->getPermission('user.contest.maxAttachmentSize'), WCF::getUser()->getPermission('user.contest.allowedAttachmentExtensions'), WCF::getUser()->getPermission('user.contest.maxAttachmentCount')); } parent::show(); }