コード例 #1
0
 /**
  * Assigns variables to the template engine.
  */
 public function assignVariables()
 {
     // call assignVariables event
     EventHandler::fireAction($this, 'assignVariables');
     // assign variables
     WCF::getTPL()->assign(array('isRegistered' => WCF::getUser()->userID > 0, 'canAddContest' => WCF::getUser()->getPermission('user.contest.canAddContest'), 'availableClasses' => $this->classList ? $this->classList->getObjects() : array(), 'availableJurys' => $this->juryList ? $this->juryList->getObjects() : array(), 'availableParticipants' => $this->participantList ? $this->participantList->getObjects() : array(), 'availableSponsors' => $this->sponsorList ? $this->sponsorList->getObjects() : array(), 'availablePrices' => $this->priceList ? $this->priceList->getObjects() : array(), 'availableTags' => MODULE_TAGGING ? $this->tagList->getObjects() : array(), 'latestEntries' => $this->latestEntryList ? $this->latestEntryList->getObjects() : array(), 'latestSolutions' => $this->latestSolutionList ? $this->latestSolutionList->getObjects() : array(), 'advertiseParticipant' => $this->advertiseParticipant, 'advertiseSponsor' => $this->advertiseSponsor, 'advertiseJury' => $this->advertiseJury));
 }
コード例 #2
0
 /**
  * @see Form::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     // save invitations
     if ($this->entry->isOwner()) {
         require_once WCF_DIR . 'lib/form/ContestJuryInviteForm.class.php';
         new ContestJuryInviteForm($this->entry);
     }
     // init form
     if ($this->action == 'edit') {
         require_once WCF_DIR . 'lib/form/ContestJuryEditForm.class.php';
         new ContestJuryEditForm($this->entry);
     } else {
         if ($this->entry->isJuryable()) {
             require_once WCF_DIR . 'lib/form/ContestJuryAddForm.class.php';
             new ContestJuryAddForm($this->entry);
         }
     }
     if ($this->entry->state != 'closed') {
         WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.jury.closed.info') . '</p>');
         // init todo list
         require_once WCF_DIR . 'lib/data/contest/jury/todo/ContestJuryTodoList.class.php';
         $this->todoList = new ContestJuryTodoList();
         $this->todoList->sqlConditions .= 'contest_jury.contestID = ' . $this->contestID;
         $this->todoList->readObjects();
     }
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entry' => $this->entry, 'isJury' => $this->isJury, 'contestID' => $this->contestID, 'userID' => $this->entry->userID, 'jurys' => $this->juryList->getObjects(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'contestmenu' => ContestMenu::getInstance()));
 }