getLayout() !== 'modal') { AbookHelper::addSubmenu('libraries'); } $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } if ($this->getLayout() !== 'modal') { $this->addToolbar(); //$this->sidebar = JHtmlSidebar::render(); } parent::display($tpl); } protected function addToolbar() { $canDo = JHelperContent::getActions('com_abook'); JToolBarHelper::title(JText::_( 'COM_ABOOK' ).': '.JText::_( 'COM_ABOOK_LIBRARY_MANAGER' ), 'home libraries' ); if ($canDo->get('core.create')) { JToolBarHelper::addNew('library.add','JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('library.edit','JTOOLBAR_EDIT'); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'libraries.delete','JTOOLBAR_DELETE'); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_abook'); } } protected function getSortFields() { return array( 'a.name' => JText::_('JGLOBAL_TITLE'), 'language' => JText::_('JGRID_HEADING_LANGUAGE'), 'a.id' => JText::_('JGRID_HEADING_ID'), ); } }