/**
  * @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()));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entries' => $this->entryList->getObjects(), 'description' => $this->description, 'classes' => $this->entryList->getClasses(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'tags' => $this->entryList->getTags(), 'availableTags' => $this->tags, 'tagID' => $this->tagID, 'juryID' => $this->juryID, 'participantID' => $this->participantID, 'classID' => $this->classID, 'tag' => $this->tag, 'taggableID' => $this->taggable !== null ? $this->taggable->getTaggableID() : 0, 'allowSpidersToIndexThisPage' => true));
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // display branding
     require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
     ContestUtil::assignVariablesBranding();
     // init form
     if ($this->action == 'edit') {
         require_once WCF_DIR . 'lib/form/ContestCommentEditForm.class.php';
         new ContestCommentEditForm($this->entry);
     } else {
         if ($this->entry->isCommentable()) {
             require_once WCF_DIR . 'lib/form/ContestCommentAddForm.class.php';
             new ContestCommentAddForm($this->entry);
         }
     }
     $this->sidebar->assignVariables();
     WCF::getTPL()->assign(array('entry' => $this->entry, 'contestID' => $this->contestID, 'tags' => MODULE_TAGGING ? $this->entry->getTags(WCF::getSession()->getVisibleLanguageIDArray()) : array(), 'events' => $this->eventmixList->getObjects(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'classes' => $this->entry->getClasses(), 'jurys' => $this->entry->getJurys(), 'participants' => $this->entry->getParticipants(), 'attachments' => $this->attachments, 'location' => $this->entry->location, 'action' => $this->action, 'commentID' => $this->commentID, 'previousEntry' => $this->previousEntry, 'nextEntry' => $this->nextEntry, 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'contestmenu' => ContestMenu::getInstance()));
 }
    /**
     * @see Form::assignVariables()
     */
    public function assignVariables()
    {
        parent::assignVariables();
        if ($this->success) {
            $l = 'wcf.contest.price.' . StringUtil::encodeHTML($this->success) . '.success';
            WCF::getTPL()->append('userMessages', '<p class="success">' . WCF::getLanguage()->get($l) . '</p>');
        }
        // display branding
        require_once WCF_DIR . 'lib/util/ContestUtil.class.php';
        ContestUtil::assignVariablesBranding();
        // save price position
        if ($this->entry->isOwner()) {
            require_once WCF_DIR . 'lib/form/ContestPricePositionForm.class.php';
            new ContestPricePositionForm($this->entry);
        }
        // init form
        if ($this->action == 'edit') {
            require_once WCF_DIR . 'lib/form/ContestPriceEditForm.class.php';
            new ContestPriceEditForm($this->entry);
        } else {
            if ($this->entry->isPriceable()) {
                require_once WCF_DIR . 'lib/form/ContestPriceAddForm.class.php';
                new ContestPriceAddForm($this->entry);
            }
        }
        // become sponsor
        if ($this->entry->enableSponsorCheck && !$this->entry->isSponsor() && $this->entry->isSponsorable(false)) {
            WCF::getTPL()->append('additionalContentBecomeSponsor', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.enableSponsorCheck.info') . '</p>');
        }
        // if contest is finished, show todo list
        // who is able to pick the prices
        $isWinner = false;
        if ($this->entry->state == 'closed') {
            // need winners
            require_once WCF_DIR . 'lib/data/contest/solution/ContestSolutionList.class.php';
            $solutionList = new ContestSolutionList();
            $solutionList->sqlConditions .= 'contest_solution.contestID = ' . intval($this->contestID);
            $solutionList->sqlLimit = $this->countItems();
            $solutionList->readObjects();
            $winners = array();
            foreach ($solutionList->getObjects() as $solution) {
                $winners[] = $solution->participantID;
                $isWinner = $isWinner || $solution->isOwner();
            }
            if (count($winners)) {
                // init todo list
                require_once WCF_DIR . 'lib/data/contest/price/todo/ContestPriceTodoList.class.php';
                $this->todoList = new ContestPriceTodoList();
                $this->todoList->sqlConditions .= '
					contest_solution.participantID IN (' . implode(',', $winners) . ')
					AND contest_solution.contestID = ' . intval($this->contestID);
                $this->todoList->sqlOrderBy = 'FIND_IN_SET(contest_solution.participantID, \'' . implode(',', $winners) . '\')';
                $this->todoList->sqlLimit = $this->countItems();
                $this->todoList->readObjects();
            }
        }
        // which price is pickable be the current user NOW?
        $solution = null;
        $didPick = false;
        if ($isWinner) {
            foreach ($this->priceList->getObjects() as $price) {
                if ($price->isPickable()) {
                    $solution = $price->pickableByWinner();
                    break;
                } else {
                    if ($price->isOwner()) {
                        $didPick = true;
                    }
                }
            }
        } else {
            if ($this->entry->state == 'scheduled' && $this->entry->untilTime > TIME_NOW) {
                WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.price.closed.info') . '</p>');
            } else {
                if ($this->entry->enablePricechoice) {
                    WCF::getTPL()->append('userMessages', '<p class="info">' . WCF::getLanguage()->get('wcf.contest.price.pick.info') . '</p>');
                }
            }
        }
        $this->sidebar->assignVariables();
        WCF::getTPL()->assign(array('entry' => $this->entry, 'isSponsor' => $this->isSponsor, 'contestID' => $this->contestID, 'userID' => $this->entry->userID, 'solution' => $solution, 'isWinner' => $isWinner, 'didPick' => $didPick, 'prices' => $this->priceList->getObjects(), 'todos' => $this->todoList ? $this->todoList->getObjects() : array(), 'templateName' => $this->templateName, 'allowSpidersToIndexThisPage' => true, 'contestmenu' => ContestMenu::getInstance()));
    }