コード例 #1
0
ファイル: view.html.php プロジェクト: 01J/skazkipronebo
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'phocagallerytags.php';
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
     $canDo = PhocaGalleryTagsHelper::getActions($this->state->get('filter.tag_id'), $this->item->id);
     //$paramsC 	= JComponentHelper::getParams('COM_PHOCADOWNLOAD');
     $text = $isNew ? JText::_('COM_PHOCAGALLERY_NEW') : JText::_('COM_PHOCAGALLERY_EDIT');
     JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_TAG') . ': <small><small>[ ' . $text . ' ]</small></small>', 'tags.png');
     // If not checked out, can save the item.
     if (!$checkedOut && $canDo->get('core.edit')) {
         JToolBarHelper::apply('phocagallerytag.apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('phocagallerytag.save', 'JTOOLBAR_SAVE');
         JToolBarHelper::addNew('phocagallerytag.save2new', 'JTOOLBAR_SAVE_AND_NEW');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('phocagallerytag.cancel', 'JTOOLBAR_CANCEL');
     } else {
         JToolBarHelper::cancel('phocagallerytag.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.phocagallery', true);
 }
コード例 #2
0
ファイル: view.html.php プロジェクト: optimosolution/marhk
 function addToolbar()
 {
     require_once JPATH_COMPONENT . '/helpers/phocagallerytags.php';
     $state = $this->get('State');
     $canDo = PhocaGalleryTagsHelper::getActions($state->get('filter.tag_id'));
     JToolBarHelper::title(JText::_('COM_PHOCAGALLERY_TAGS'), 'tags.png');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('phocagallerytag.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('phocagallerytag.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::divider();
         JToolBarHelper::custom('phocagallerytags.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
         JToolBarHelper::custom('phocagallerytags.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS', 'phocagallerytags.delete', 'COM_PHOCAGALLERY_DELETE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.phocagallery', true);
 }