/**
  * @see EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     if (self::$executed) {
         return;
     }
     self::$executed = true;
     $notifications = ContestPromotionUtil::getList();
     if (count($notifications)) {
         WCF::getTPL()->assign('contestPromotionNotifications', $notifications);
         WCF::getTPL()->append('userMessages', WCF::getTPL()->fetch('contestPromotionNotification'));
     }
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // remember
     ContestPromotionUtil::updateList($this->contestID);
     $this->executed();
     switch ($this->contestAction) {
         case 'participate':
             if (WCF::getUser()->userID == 0) {
                 // forward
                 HeaderUtil::redirect('index.php?page=Contest' . '&contestID=' . $this->contestID . SID_ARG_2ND_NOT_ENCODED);
             } else {
                 $state = $this->contest->enableParticipantCheck ? 'applied' : 'accepted';
                 // add participant
                 require_once WCF_DIR . 'lib/data/contest/participant/ContestParticipantEditor.class.php';
                 $participant = ContestParticipantEditor::create($this->contestID, WCF::getUser()->userID, 0, $state);
                 // forward
                 HeaderUtil::redirect('index.php?page=ContestParticipant' . '&contestID=' . $this->contestID . '&participantID=' . $participant->participantID . SID_ARG_2ND_NOT_ENCODED . '#participant' . $participant->participantID);
             }
             break;
     }
 }