public static function renderSidebar() { // Collect display data $data = new stdClass(); $data->list = JHtmlSidebar::getEntries(); $data->filters = JHtmlSidebar::getFilters(); $data->action = JHtmlSidebar::getAction(); $data->displayMenu = count($data->list); $data->displayFilters = count($data->filters); $data->hide = JFactory::getApplication()->input->getBool('hidemainmenu'); // Create a layout object and ask it to render the sidebar $layout = new JLayoutFile('sidebars.submenu'); $sidebarHtml = $layout->render($data); return $sidebarHtml; }
public function display($tpl = null) { if (version_compare(JVERSION, '3.0', 'ge')) { $hide = JFactory::getApplication()->input->getBool('hidemainmenu', false); $sidebar = count(JHtmlSidebar::getEntries()) + count(JHtmlSidebar::getFilters()); if (!$hide && $sidebar > 0) { $start = array('<div id="j-sidebar-container" class="span2">', JHtmlSidebar::render(), '</div>', '<div id="j-main-container" class="span10">'); } else { $start = array('<div id="j-main-container">'); } echo join("\n", $start) . "\n"; parent::display($tpl); echo "\n</div>"; } else { parent::display($tpl); } $this->displayFooter(); }