/** * Process the incoming request for the overview * view of published primary genres. * * @param object Joomla mainframe object * @return bean SummaryPageModel */ public function overview($mainframe) { global $logger; $logger->debug(get_class($this) . '::overview()'); $model = new SummaryPageModel(); $es = new EventService(); $courses = array(); $events = $es->getEventsByPubState('Course', array('Published')); foreach ($events as $crse) { $pg = $crse->getPrimaryGenre(); // Check to see if we are looking for school-related courses (not expected) $school = isset($_REQUEST['school']) ? $school : null; // add only the proper type (public or school) if ($pg->getSchool() == $school) { $courses[] = $crse; } } $model->setList($courses); // announcement $model->setAnnouncement($this->getPublishedAnnouncement('Course', false)); return $model; }
/** * Process the incoming request for the overview * view of published primary genres. * * @param object Joomla mainframe object * @return bean SummaryPageModel */ public function overview($mainframe = null) { global $logger; $logger->debug(get_class($this) . '::overview()'); $model = new SummaryPageModel(); $es = new EventService(); $genres = array(); $events = $es->getEventsByPubState('Program', array('Published')); foreach ($events as $prgm) { $pg = $prgm->getPrimaryGenre(); // Check to see if we are looking for school-related programs (not expected) $school = isset($_REQUEST['school']) ? $school : null; // add only the proper type (public or school) if ($pg && $pg->getSchool() == $school) { // only add it to the list once if (isset($genres[$pg->getOid()])) { continue; } else { $genres[$pg->getOid()] = $pg; } } } $model->setList($genres); // announcement $model->setAnnouncement($this->getPublishedAnnouncement('Program')); return $model; }