/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JRequest::setVar('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 = JE_ContentHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title($isNew ? JText::_('COM_JE_CONTENT_MANAGER_ARTICLE_NEW') : JText::_('COM_JE_CONTENT_MANAGER_ARTICLE_EDIT'), 'article.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_je_content', 'core.create')) > 0)) { JToolBarHelper::apply('article.apply'); JToolBarHelper::save('article.save'); if ($canDo->get('core.create')) { JToolBarHelper::save2new('article.save2new'); } } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolBarHelper::save2copy('article.save2copy'); } if (empty($this->item->id)) { JToolBarHelper::cancel('article.cancel'); } else { JToolBarHelper::cancel('article.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $canDo = JE_ContentHelper::getActions($this->state->get('filter.category_id')); $user = JFactory::getUser(); JToolBarHelper::title(JText::_('COM_JE_CONTENT_MANAGER_ARTICLES'), 'article.png'); if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_je_content', 'core.create')) > 0) { JToolBarHelper::addNew('article.add'); } if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolBarHelper::editList('article.edit'); } if ($canDo->get('core.edit.state')) { JToolBarHelper::divider(); JToolBarHelper::publish('articles.publish', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::unpublish('articles.unpublish', 'JTOOLBAR_UNPUBLISH', true); JToolBarHelper::custom('articles.featured', 'featured.png', 'featured_f2.png', 'JFEATURED', true); JToolBarHelper::divider(); JToolBarHelper::archiveList('articles.archive'); JToolBarHelper::checkin('articles.checkin'); } if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'articles.delete', 'JTOOLBAR_EMPTY_TRASH'); } else { if ($canDo->get('core.edit.state')) { JToolBarHelper::trash('articles.trash'); } } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_je_content'); } }