function addToolbar() { require_once JPATH_COMPONENT . '/helpers/phocagallerycos.php'; $state = $this->get('State'); $canDo = PhocaGalleryCosHelper::getActions($state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_CATEGORY_COMMENTS'), 'comment'); if ($canDo->get('core.edit')) { JToolBarHelper::editList('phocagalleryco.edit', 'JTOOLBAR_EDIT'); } if ($canDo->get('core.edit.state')) { JToolBarHelper::divider(); JToolBarHelper::custom('phocagallerycos.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('phocagallerycos.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList(JText::_('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS'), 'phocagallerycos.delete', 'COM_PHOCAGALLERY_DELETE'); } JToolBarHelper::divider(); JToolBarHelper::help('screen.phocagallery', true); }
protected function addToolbar() { require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'phocagallerycos.php'; JRequest::setVar('hidemainmenu', true); $bar = JToolBar::getInstance('toolbar'); $user = JFactory::getUser(); $isNew = $this->item->id == 0; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); $canDo = PhocaGalleryCosHelper::getActions($this->state->get('filter.category_id'), $this->item->id); $paramsC = JComponentHelper::getParams('com_phocagallery'); $text = $isNew ? JText::_('COM_PHOCAGALLERY_NEW') : JText::_('COM_PHOCAGALLERY_EDIT'); JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_CAT_COMMENT') . ': <small><small>[ ' . $text . ' ]</small></small>', 'comment'); // If not checked out, can save the item. if (!$checkedOut && $canDo->get('core.edit')) { JToolBarHelper::apply('phocagalleryco.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('phocagalleryco.save', 'JTOOLBAR_SAVE'); } JToolBarHelper::cancel('phocagalleryco.cancel', 'JTOOLBAR_CLOSE'); JToolBarHelper::divider(); JToolBarHelper::help('screen.phocagallery', true); }