Example #1
0
 protected function addToolBar()
 {
     $state = $this->get('State');
     $canDo = EasyquickiconsHelper::getActions();
     $layout = JRequest::getCmd('layout', 'default');
     if ($layout != 'welcome') {
         JToolBarHelper::title(JText::_('COM_EASYQUICKICONS_TOOLBAR'), 'easyquickicons');
         if ($canDo->get('core.create')) {
             JToolBarHelper::addNew('easyquickicon.add');
         }
         if ($canDo->get('core.edit')) {
             JToolBarHelper::editList('easyquickicon.edit');
         }
         if ($canDo->get('core.edit.state')) {
             if ($state->get('filter.state') != 2) {
                 JToolBarHelper::divider();
                 JToolBarHelper::publish('easyquickicons.publish', 'JTOOLBAR_ENABLE', true);
                 JToolBarHelper::unpublish('easyquickicons.unpublish', 'JTOOLBAR_DISABLE', true);
             }
             if ($state->get('filter.state') != -1) {
                 JToolBarHelper::divider();
                 if ($state->get('filter.state') != 2) {
                     JToolBarHelper::archiveList('easyquickicons.archive');
                 } elseif ($state->get('filter.state') == 2) {
                     JToolBarHelper::unarchiveList('easyquickicons.publish', 'JTOOLBAR_UNARCHIVE');
                 }
             }
         }
         if ($canDo->get('core.admin')) {
             JToolbarHelper::checkin('easyquickicons.checkin');
         }
         if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
             JToolBarHelper::deleteList('', 'easyquickicons.delete', 'JTOOLBAR_EMPTY_TRASH');
             JToolBarHelper::divider();
         } elseif ($canDo->get('core.edit.state')) {
             JToolBarHelper::trash('easyquickicons.trash');
             JToolBarHelper::divider();
         }
         if ($canDo->get('core.admin')) {
             JToolBarHelper::preferences('com_easyquickicons');
             JToolBarHelper::divider();
         }
         $bar = JToolBar::getInstance('toolbar');
         $bar->appendButton('Help', 'help', 'JTOOLBAR_HELP', 'http://awynesoft.com/documentation.html', 640, 480);
         JHtmlSidebar::setAction('index.php?option=com_easyquickicons&view=easyquickicons');
         JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', EasyquickiconsHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.state'), true));
         JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_easyquickicons'), 'value', 'text', $this->state->get('filter.category_id')));
     } else {
         JToolBarHelper::back('COM_EASYQUICKICONS', 'index.php?option=' . JRequest::getCmd('option'));
     }
 }