/** * Process the incoming request for the summary * view of published programs in the series. * * @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(); // check for a sort preference if (isset($_REQUEST['sort'])) { $_SESSION['summary_sort'] = $_REQUEST['sort']; } // filter by series $model->setSeries(""); $series_id = $_REQUEST['oid']; $logger->debug("Found a series filter with id: " . $series_id); $list = $evs->getEventsByPubState('Program', array('Published'), $series_id); // 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; } } // set the series name for the page title $cat = $evs->getCategoryById('Series', $series_id); $model->setSeries($cat); // announcement $model->setAnnouncement($this->getPublishedAnnouncement('Program', true)); $model->setList($current); return $model; }
public static function getInstance() { if (is_null(self::$_instance)) { self::$_instance = new MasterPage(); } $_title = ''; $_currentPage = ''; $_head = ''; $_content = array(); return self::$_instance; }
/** * 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; }
{ if ($params['tag'] == 1) { redirect("Department.php"); } else { if ($params['tag'] == 2) { setcookie('loginid', null); redirect('Login.php'); } } } function MasterPageCreate($sender, $params) { global $LoginControl; $currentFile = $_SERVER['SCRIPT_NAME']; $parts = Explode('/', $currentFile); $currentFile = $parts[count($parts) - 1]; if ($currentFile != 'Login.php') { if (!$LoginControl->isAuthenticated()) { redirect("Login.php"); } } } } global $application; global $MasterPage; //Creates the form $MasterPage = new MasterPage($application); //Read from resource file $MasterPage->loadResource(__FILE__); //Shows the form $MasterPage->show();
<?php require_once 'include/masterpage.php'; $master = MasterPage::getInstance(); $master->setTitle(''); $master->setCurrentPage('index'); $master->setContent("contenu1", '<div id="content"> <img height="54" src="images/arrow.png" alt="fleche" style="position: absolute; left: 28px; top: 73px;" width="64"> <div id="homeMainMessage" style="left: 116px; top: 25px">' . _("text") . '</div> <div style="position: absolute; width: 860px; height: 279px; top: 199px; left: 60px; background-image: url(\'images/black_50.png\'); font-family: Basic, sans-serif; font-size: 14px;"> <div style="width: 200px; height: 35px; background-color: #000000; font-size: 18px; color: #FF00FF; text-align: center; vertical-align: middle; line-height: 100%; display: table-cell;">' . _("category1") . '</div> <div style="width: 620px; height: 170px; position: relative; top: 20px; left: 40px"> BLA BLA BLA<br/><br/> BLA BLA </div> </div> </div>'); $master->setContent("contenu2", _("c1")); $master->display();