Example #1
0
 /**
  * Setting the toolbar
  */
 public function addToolBar()
 {
     $user = JFactory::getUser();
     JToolbarHelper::title(JText::_('COM_ALFCONTACT_MANAGER_ALFCONTACTS'), 'alfcontact');
     if ($user->authorise('core.create')) {
         JToolbarHelper::addNew('alfcontact.add');
     }
     if ($user->authorise('core.edit') || $user->authorise('core.edit.own')) {
         JToolbarHelper::editList('alfcontact.edit');
     }
     if ($user->authorise('core.edit.state')) {
         JToolbarHelper::publish('alfcontacts.publish', 'JTOOLBAR_PUBLISH', true);
         JToolbarHelper::unpublish('alfcontacts.unpublish', 'JTOOLBAR_UNPUBLISH', true);
     }
     if ($this->state->get('filter.published') == -2 && $user->authorise('core.delete')) {
         JToolbarHelper::deleteList('', 'alfcontacts.delete', 'JTOOLBAR_EMPTY_TRASH');
     } elseif ($user->authorise('core.edit.state')) {
         JToolbarHelper::trash('alfcontacts.trash');
     }
     // Options button.
     if ($user->authorise('core.admin')) {
         JToolBarHelper::preferences('com_alfcontact');
     }
     JToolbarHelper::help('JHELP_COMPONENTS_ALFCONTACT_CONTACTS');
     JHtmlSidebar::setAction('index.php?option=com_alfcontact&view=alfcontacts');
     JHtmlSideBar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true));
     JHtmlSideBar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')));
 }