Example #1
0
 /**
  * Process the incoming request for the summary
  * view of published courses.  If a filter is
  * applied, the sub-set of published courses will
  * be displayed.
  *
  * @param object Joomla mainframe object
  * @return bean SummaryPageModel
  */
 public function summary($mainframe)
 {
     global $logger;
     $logger->debug(get_class($this) . '::summary()');
     $model = new SummaryPageModel();
     $evs = $this->getEventService();
     $ps = $this->getProductService();
     // check for a sort preference
     if (isset($_REQUEST['sort'])) {
         $_SESSION['summary_sort'] = $_REQUEST['sort'];
     }
     // check for a filter
     $model->setGenre("");
     if (isset($_REQUEST['filter']) && isset($_REQUEST['fid'])) {
         $logger->debug("Found a filter with id: " . $_REQUEST['fid']);
         $list = $evs->getEventsByPubState('Course', array('Published'), $_REQUEST['fid']);
         // set the genre for the page title
         if (count($list) > 0) {
             $model->setGenre($list[0]->getPrimaryGenre());
         }
     } else {
         $list = $evs->getEventsByPubState('Course', array('Published'));
     }
     $current = array();
     foreach ($list as $event) {
         // Gallery
         $event = $this->setGallery($event, true);
         // in the MasterAction class
         $current[] = $event;
     }
     $model->setList($current);
     return $model;
 }
Example #2
0
 /**
  * Process the incoming request for the summary
  * view of published programs.  If a filter is
  * applied, the sub-set of published programs will
  * be displayed.
  *
  * @param object Joomla mainframe object
  * @return bean SummaryPageModel
  */
 public function summary($mainframe = null)
 {
     global $logger;
     $logger->debug(get_class($this) . '::summary()');
     $model = new SummaryPageModel();
     $evs = $this->getEventService();
     $cs = $this->getCategoryService();
     // check for a sort preference
     if (isset($_REQUEST['sort'])) {
         $_SESSION['summary_sort'] = $_REQUEST['sort'];
     }
     // check for a filter
     $model->setGenre("");
     if (isset($_REQUEST['filter']) && isset($_REQUEST['fid'])) {
         $logger->debug("Found a filter with id: " . $_REQUEST['fid']);
         $list = $evs->getEventsByPubState('Program', array('Published'), $_REQUEST['fid']);
         // set the genre for the page title
         if (count($list) > 0) {
             $model->setGenre($cs->getCategoryById($_REQUEST['fid']));
         }
     } else {
         $list = $evs->getEventsByPubState('Program', array('Published'));
         // set the genre for the page title
         if (count($list) > 0) {
             $model->setGenre($list[0]->getPrimaryGenre());
         }
     }
     // clean the list
     $mp = new MasterPage();
     $current = array();
     foreach ($list as $event) {
         $last = $mp->getLastActivity($event->getChildren());
         if ($last == NULL || $mp->isCurrent($last)) {
             // Gallery
             $event = $this->setGallery($event, true);
             // in the MasterAction class
             $current[] = $event;
         }
     }
     $model->setList($current);
     return $model;
 }