Beispiel #1
0
 /**
  * Add the page title and toolbar
  *
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     $canDo = TagMetaHelper::getActions();
     JToolBarHelper::title($isNew ? JText::_('COM_TAGMETA_RULE_NEW') : JText::_('COM_TAGMETA_RULE_EDIT'), 'tagmeta.png');
     // If not checked out, can save the item
     if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_tagmeta', 'core.create')) > 0)) {
         JToolBarHelper::apply('rule.apply');
         JToolBarHelper::save('rule.save');
         if ($canDo->get('core.create')) {
             //JToolBarHelper::save2new('rule.save2new');
             JToolBarHelper::custom('rule.save2new', 'save-new', '', 'JTOOLBAR_SAVE_AND_NEW', false);
         }
     }
     // If an existing item, can save to a copy
     if (!$isNew && $canDo->get('core.create')) {
         //JToolBarHelper::save2copy('rule.save2copy');
         JToolBarHelper::custom('rule.save2copy', 'save-copy', '', 'JTOOLBAR_SAVE_AS_COPY', false);
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('rule.cancel');
     } else {
         JToolBarHelper::cancel('rule.cancel', 'JTOOLBAR_CLOSE');
     }
 }
Beispiel #2
0
 /**
  * Add the page title and toolbar
  *
  */
 protected function addToolbar()
 {
     JToolBarHelper::title(JText::_('COM_TAGMETA_MANAGER'), 'tagmeta.png');
     require_once JPATH_COMPONENT . '/helpers/tagmeta.php';
     $canDo = TagMetaHelper::getActions();
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_tagmeta');
     }
     JHtmlSidebar::setAction('index.php?option=com_tagmeta&view=about');
 }
Beispiel #3
0
 /**
  * Add the page title and toolbar
  *
  */
 protected function addToolbar()
 {
     JToolBarHelper::title(JText::_('COM_TAGMETA_MANAGER'), 'tagmeta.png');
     $canDo = TagMetaHelper::getActions();
     if ($canDo->get('core.create')) {
         JToolBarHelper::custom('rules.copy', 'copy.png', 'copy_f2.png', JText::_('COM_TAGMETA_TOOLBAR_COPY'));
         JToolBarHelper::addNew('rule.add');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('rule.edit');
     }
     JToolBarHelper::divider();
     if ($canDo->get('core.edit.state')) {
         if ($this->state->get('filter.state') != 2) {
             JToolBarHelper::publish('rules.publish', 'JTOOLBAR_PUBLISH', true);
             JToolBarHelper::unpublish('rules.unpublish', 'JTOOLBAR_UNPUBLISH', true);
         }
         JToolBarHelper::divider();
         if ($this->state->get('filter.state') != -1) {
             if ($this->state->get('filter.state') != 2) {
                 JToolBarHelper::archiveList('rules.archive');
             } else {
                 if ($this->state->get('filter.state') == 2) {
                     JToolBarHelper::unarchiveList('rules.publish');
                 }
             }
         }
         //JToolBarHelper::checkin('rules.checkin');
         JToolBarHelper::custom('rules.checkin', 'checkin', '', 'JTOOLBAR_CHECKIN', true);
         JToolBarHelper::trash('rules.trash');
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'rules.delete', 'JTOOLBAR_EMPTY_TRASH');
     }
     JToolBarHelper::divider();
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_tagmeta');
     }
     JHtmlSidebar::setAction('index.php?option=com_tagmeta&view=rules');
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true));
 }