pages/index/IndexHandler.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 
00018 import('handler.Handler');
00019 
00020 class IndexHandler extends Handler {
00024    function IndexHandler() {
00025       parent::Handler();
00026    }
00027 
00033    function index($args) {
00034       $this->validate();
00035       $this->setupTemplate();
00036       
00037       $conference =& Request::getConference();
00038       $schedConf =& Request::getSchedConf();
00039 
00040       if ($schedConf && $conference) {
00041 
00042          // A scheduled conference was specified; display it.
00043          import('pages.schedConf.SchedConfHandler');
00044          SchedConfHandler::index($args);
00045 
00046       } elseif ($conference) {
00047          $redirect = $conference->getSetting('schedConfRedirect');
00048          if (!empty($redirect)) {
00049             $schedConfDao =& DAORegistry::getDAO('SchedConfDAO');
00050             $redirectSchedConf =& $schedConfDao->getSchedConf($redirect, $conference->getId());
00051             if ($redirectSchedConf) Request::redirect($conference->getPath(), $redirectSchedConf->getPath());
00052          }
00053 
00054          // A scheduled conference was specified; display it.
00055          import('pages.conference.ConferenceHandler');
00056          ConferenceHandler::index($args);
00057 
00058       } else {
00059 
00060          // Otherwise, display a list of conferences to choose from.
00061          $templateMgr =& TemplateManager::getManager();
00062 
00063          $conferenceDao =& DAORegistry::getDAO('ConferenceDAO');
00064          $templateMgr->assign('helpTopicId', 'user.home');
00065 
00066          // If the site specifies that we should redirect to a specific conference
00067          // by default, do it.
00068 
00069          $site =& Request::getSite();
00070          $conference = $conferenceDao->getConference($site->getRedirect());
00071 
00072          if ($site->getRedirect() && $conference) {
00073             Request::redirect($conference->getPath());
00074          }
00075 
00076          // Otherwise, show a list of hosted conferences.
00077 
00078          $templateMgr->assign('intro', $site->getLocalizedIntro());
00079          $conferences =& $conferenceDao->getEnabledConferences();
00080          $templateMgr->assign_by_ref('conferences', $conferences);
00081          $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
00082          $templateMgr->display('index/site.tpl');
00083       }
00084    }
00085 }
00086 
00087 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7