コード例 #1
0
 /**
  * @param ScavengerHuntGame $game
  * @return bool
  */
 public function delete(ScavengerHuntGame $game)
 {
     if (!$game->getId()) {
         return false;
     }
     $db = $this->getDb(DB_MASTER);
     $db->delete(self::GAMES_TABLE_NAME, array('game_id' => $game->getId()), __METHOD__);
     $db->commit(__METHOD__);
     $game->setId(0);
     $this->clearCache($game, null);
     return true;
 }
コード例 #2
0
 public function getGoodbyeHtml(ScavengerHuntGame $game)
 {
     // build entry form html
     $template = WF::build('EasyTemplate', array(dirname(__FILE__) . '/templates/'));
     /* @var $template EasyTemplate */
     $template->set_vars(array('title' => $game->getGoodbyeTitle(), 'text' => $this->parseCached($game->getGoodbyeText()), 'shareUrl' => $game->getLandingTitle(), 'imageSrc' => $game->getSpriteImg(), 'imgSprite' => $game->getFinishPopupSprite()));
     return $template->render('modal-clue');
 }
コード例 #3
0
 protected function getTemplateVarsFromGame(ScavengerHuntGame $game)
 {
     wfProfileIn(__METHOD__);
     $vars = $game->getAll();
     $vars['gameId'] = $vars['id'];
     $vars['enabled'] = $vars['isEnabled'];
     foreach ($vars['articles'] as $k => $v) {
         $vars['articles'][$k] = $vars['articles'][$k]->getAll();
     }
     if (empty($vars['articles'])) {
         $vars['articles'][] = $game->newGameArticle()->getAll();
     }
     unset($vars['id']);
     unset($vars['isEnabled']);
     wfProfileOut(__METHOD__);
     return $vars;
 }