Ejemplo n.º 1
0
 function playImpress()
 {
     $this->_template->disableHeader();
     $this->_template->disableFooter();
     $deckid = $_GET['deck'];
     $deck = new Deck();
     $deck->createFromID($deckid);
     //show error if deck does not exist
     if (!isset($deck->deck_id)) {
         header('Location: ' . BASE_PATH . 'error/404');
         die;
     }
     $user_id = $this->getCurrentUserID();
     if (!$user_id) {
         die('This feature is only available for specific users!<br>');
     }
     $slides = $deck->getSlidesLite(1);
     $deck->slides = $slides;
     $scaling = isset($_GET['scaling']) ? $_GET['scaling'] : 1;
     $style = isset($_GET['style']) ? $_GET['style'] : $deck->default_theme;
     $t = new ImpressTransition();
     $t->user_id = $user_id;
     if (isset($_GET['user'])) {
         $t->user_id = $_GET['user'];
     }
     $t->deck_id = $deckid;
     $transitions = $t->getStylesForUserDeck();
     $show_others_flag = 0;
     $others_transitions = array();
     if (!count($transitions)) {
         $others_transitions = $t->getAllStylesForDeck();
         if (!count($others_transitions)) {
             die('There is no impress transition available!<br>');
         } else {
             $show_others_flag = 1;
         }
     }
     $this->set('transitions', $transitions);
     $this->set('others_transitions', $others_transitions);
     $this->set('style', $style);
     $this->set('scaling', $scaling);
     $this->set('deckObject', $deck);
     $this->set('total', count($deck->slides));
     $this->set('show_others_flag', $show_others_flag);
 }