/**
  * Display the signup form for this contest.
  *
  * @since 0.1
  *
  * @param Contest $contest
  * @param integer|false $challengeId
  */
 protected function showSignupForm(Contest $contest, $challengeId = false)
 {
     $form = new HTMLForm($this->getFormFields($contest, $challengeId), $this->getContext());
     $form->setSubmitCallback(array($this, 'handleSubmission'));
     $form->setSubmitText(wfMsg('contest-signup-submit'));
     if ($form->show()) {
         $this->onSuccess($contest);
     } else {
         $this->getOutput()->addModules('contest.special.signup');
     }
     $this->getOutput()->addScript(Skin::makeVariablesScript(array('ContestConfig' => array('rules_page' => ContestUtils::getParsedArticleContent($contest->getField('rules_page'))))));
 }
 /**
  * Send the signup email.
  *
  * @since 0.1
  *
  * @return Status
  */
 public function sendSignupEmail()
 {
     $title = wfMsg('contest-email-signup-title');
     $emailText = ContestUtils::getParsedArticleContent($this->getContest()->getField('signup_email'));
     $user = $this->getUser();
     $sender = ContestSettings::get('mailSender');
     $senderName = ContestSettings::get('mailSenderName');
     wfRunHooks('ContestBeforeSignupEmail', array(&$this, &$title, &$emailText, &$user, &$sender, &$senderName));
     return UserMailer::send(new MailAddress($user), new MailAddress($sender, $senderName), $title, $emailText, null, 'text/html; charset=ISO-8859-1');
 }
 /**
  * Constructor.
  *
  * @param Title $title
  * @param array $params
  * * contestants, array of ContestContestant, required
  * * contest, Contest, required
  */
 public function __construct(Title $title, array $params)
 {
     parent::__construct(__CLASS__, $title, $params);
     $this->params['emailText'] = ContestUtils::getParsedArticleContent($this->params['contest']->getField('reminder_email'));
     $this->params['daysLeft'] = $this->params['contest']->getDaysLeft();
 }
 /**
  *
  *
  * @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'))));
 }
 /**
  * Show the opportunities for this contest.
  *
  * @since 0.1
  *
  * @param Contest $contest
  */
 protected function showOpportunities(Contest $contest)
 {
     $this->getOutput()->addWikiText(ContestUtils::getArticleContent($contest->getField('opportunities')));
 }