Ejemplo n.º 1
0
 function addToolbar()
 {
     require_once JPATH_COMPONENT . '/helpers/phocagallerycoimgs.php';
     $state = $this->get('State');
     $canDo = PhocaGalleryCoImgsHelper::getActions($state->get('filter.category_id'));
     JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_IMAGE_COMMENTS'), 'comment');
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('phocagallerycoimg.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::divider();
         JToolBarHelper::custom('phocagallerycoimgs.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
         JToolBarHelper::custom('phocagallerycoimgs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList(JText::_('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS'), 'phocagallerycoimgs.delete', 'COM_PHOCAGALLERY_DELETE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.phocagallery', true);
 }
Ejemplo n.º 2
0
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'phocagallerycoimgs.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 = PhocaGalleryCoImgsHelper::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_IMAGE_COMMENT') . ': <small><small>[ ' . $text . ' ]</small></small>', 'comment');
     // If not checked out, can save the item.
     if (!$checkedOut && $canDo->get('core.edit')) {
         JToolBarHelper::apply('phocagallerycoimg.apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('phocagallerycoimg.save', 'JTOOLBAR_SAVE');
     }
     JToolBarHelper::cancel('phocagallerycoimg.cancel', 'JTOOLBAR_CLOSE');
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.phocagallery', true);
 }