Esempio n. 1
0
 /**
  * get oage
  *
  * Reads the act and selects the right action
  *
  * @access   public
  * @return   string  parsed content
  */
 function getPage()
 {
     global $_CONFIG;
     \JS::activate('shadowbox');
     \JS::activate('jquery');
     if ($this->arrSettings['settingsAllowVotes']) {
         $objVoting = new MediaDirectoryVoting($this->moduleName);
         $this->setJavascript($objVoting->getVoteJavascript());
         if (isset($_GET['vote']) && intval($_GET['eid']) != 0) {
             $objVoting->saveVote(intval($_GET['eid']), intval($_GET['vote']));
         }
     }
     if ($this->arrSettings['settingsAllowComments'] == 1) {
         $objComment = new MediaDirectoryComment($this->moduleName);
         $this->setJavascript($objComment->getCommentJavascript());
         $comment = isset($_GET['comment']) ? $_GET['comment'] : '';
         if ($comment == 'add' && intval($_GET['eid']) != 0) {
             $objComment->saveComment(intval($_GET['eid']), $_POST);
         }
         if ($comment == 'refresh' && intval($_GET['eid']) != 0) {
             $objComment->refreshComments(intval($_GET['eid']), $_GET['pageSection'], $_GET['pageCmd']);
         }
     }
     switch ($_REQUEST['cmd']) {
         case 'delete':
             if (!empty($_REQUEST['eid']) || !empty($_REQUEST['entryId'])) {
                 parent::checkAccess('delete_entry');
                 $this->deleteEntry();
             } else {
                 header("Location: index.php?section=" . $this->moduleName);
                 exit;
             }
             break;
         case 'latest':
             $this->showLatest();
             break;
         case 'popular':
             $this->showPopular();
             break;
         case 'map':
             $this->showMap();
             break;
         case 'myentries':
             parent::checkAccess('my_entries');
             $this->showMyEntries();
             break;
         case 'detail':
             parent::checkAccess('show_entry');
             $this->showEntry();
             break;
         case 'adduser':
             $this->showAddUser();
             break;
         case 'confirm_in_progress':
             $this->_objTpl->setTemplate($this->pageContent);
             break;
         case 'alphabetical':
             $this->showAlphabetical();
             break;
         default:
             if (isset($_REQUEST['check'])) {
                 parent::checkDisplayduration();
             }
             if (substr($_REQUEST['cmd'], 0, 6) == 'detail') {
                 parent::checkAccess('show_entry');
                 $this->showEntry();
             } else {
                 if (substr($_REQUEST['cmd'], 0, 3) == 'add') {
                     parent::checkAccess('add_entry');
                     $this->modifyEntry();
                 } else {
                     if (substr($_REQUEST['cmd'], 0, 4) == 'edit') {
                         if (intval($_REQUEST['eid']) != 0 || intval($_REQUEST['entryId']) != 0) {
                             parent::checkAccess('edit_entry');
                             $this->modifyEntry();
                         } else {
                             header("Location: index.php?section=" . $this->moduleName);
                             exit;
                         }
                     } else {
                         if (isset($_REQUEST['search'])) {
                             $this->showSearch();
                         } else {
                             $this->showOverview();
                         }
                     }
                 }
             }
     }
     $this->_objTpl->setVariable(array($this->moduleLangVar . '_JAVASCRIPT' => $this->getJavascript()));
     return $this->_objTpl->get();
 }