コード例 #1
0
 /**
  * Redirect the user to the contest page and add the "new" argument to the URL
  * so they get a success message.
  *
  * @since 0.1
  *
  * @param Contest $contest
  */
 protected function onSuccess(Contest $contest)
 {
     $url = SpecialPage::getTitleFor('MyContests', $contest->getField('name'))->getLocalURL('new');
     $this->getOutput()->redirect($url);
 }
コード例 #2
0
 /**
  *
  *
  * @since 0.1
  *
  * @param Contest $contest
  */
 protected function showMailFunctionality(Contest $contest)
 {
     $out = $this->getOutput();
     $out->addHTML(Html::element('h3', array(), wfMsg('contest-contest-reminder-mail')));
     $out->addWikiMsg('contest-contest-reminder-page', $contest->getField('reminder_email'));
     $out->addHTML(Html::element('button', array('id' => 'send-reminder', 'data-token' => $this->getUser()->editToken(), 'data-contest-id' => $contest->getId(), 'data-reminder-subject' => wfMsgExt('contest-email-reminder-title', 'parsemag', $contest->getDaysLeft())), wfMsg('contest-contest-send-reminder')));
     $out->addHTML(Html::rawElement('div', array('id' => 'reminder-content', 'style' => 'display:none'), ContestUtils::getParsedArticleContent($contest->getField('reminder_email'))));
 }
コード例 #3
0
 /**
  * Handle page request when the contest is enabled.
  *
  * @since 0.1
  *
  * @param Contest $contest
  */
 protected function handleEnabledPage(Contest $contest)
 {
     // Check if the user is already a contestant in this contest.
     // If he is, redirect to submission page, else show signup form.
     $contestant = ContestContestant::s()->selectRow(null, array('contest_id' => $contest->getId(), 'user_id' => $this->getUser()->getId()));
     if ($contestant === false) {
         $this->getOutput()->redirect(SpecialPage::getTitleFor('ContestSignup', $contest->getField('name'))->getLocalURL());
     } else {
         $contestant->setContest($contest);
         $this->showSubmissionPage($contestant);
     }
 }
コード例 #4
0
 /**
  * Show the rules for this contest.
  *
  * @since 0.1
  *
  * @param Contest $contest
  */
 protected function showRules(Contest $contest)
 {
     // TODO: we might want to have a pop-up with the content here, instead of a link to the page.
     $this->getOutput()->addWikiMsgArray('contest-welcome-rules', $contest->getField('rules_page'));
 }