/** * Displays a layout file * * @param unknown_type $tpl * @return unknown_type */ function display($tpl = null) { // display() will return null if 'doTask' is not set by the controller // This prevents unauthorized access by bypassing the controllers $task = $this->getTask(); if (empty($task)) { return null; } parent::display($tpl); }
/** * Displays the menu according to view. * * @return unknown_type */ public function display($layout = 'submenu', $hidemainmenu = '', $type = '') { $input = JFactory::getApplication()->input; jimport('joomla.application.component.view'); // TODO This should be passed as an argument $hide = $input->getInt('hidemainmenu'); if (version_compare(JVERSION, '1.6.0', 'ge')) { // Joomla! 1.6+ code here $items = $this->_menu->getItems(); $name = $this->_name; } else { // Joomla! 1.5 code here $items = $this->_menu->_bar; $name = $this->_name; } // Load the named template, if there are links to display. if (!empty($items)) { $base = JFactory::getApplication()->isAdmin() ? JPATH_ADMINISTRATOR : JPATH_SITE; $app = DSC::getApp(); $template = JFactory::getApplication()->getTemplate(); $lib_path = JPATH_SITE . '/libraries/dioscouri/component/view/dashboard'; $com_template_path = $base . '/components/com_' . $app->getName() . '/views/dashboard/tmpl'; $template_path = $base . '/templates/' . $template . '/html/com_' . $app->getName() . '/dashboard'; $view = new DSCViewBase(array('name' => 'dashboard', 'template_path' => $lib_path)); $view->set('items', $items); $view->set('name', $name); $view->set('layout', $layout); $view->set('hide', $hide); $view->setLayout($layout); $view->addTemplatePath($com_template_path); $view->addTemplatePath($template_path); $view->display(); } }