Exemplo n.º 1
0
 /**
  * Cargos view display method
  * @return void
  */
 function display($tpl = null)
 {
     $this->canDo = JHelperContent::getActions('com_agendadirigentes');
     if (!$this->canDo->get('cargos.list')) {
         return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
     }
     // Get data from the model
     $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');
     AgendaDirigentesHelper::addSubmenu('cargos');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // Assign data to the view
     $this->user = JFactory::getUser();
     $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
     $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
     // Set the toolbar
     $this->addToolBar($this->pagination->total);
     //set sidebar menu
     $this->sidebar = JHtmlSidebar::render();
     // Display the template
     parent::display($tpl);
     // Set the document
     $this->setDocument();
 }