protected function addToolbar() { require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'phocaguestbooks.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 = PhocaGuestbooksHelper::getActions($this->state->get('filter.item_id'), $this->item->id); //$paramsC = JComponentHelper::getParams('com_phocaguestbook'); $text = $isNew ? JText::_('COM_PHOCAGUESTBOOK_NEW') : JText::_('COM_PHOCAGUESTBOOK_EDIT'); JToolBarHelper::title(JText::_('COM_PHOCAGUESTBOOK_ITEM') . ': <small><small>[ ' . $text . ' ]</small></small>', 'guestbook.png'); // If not checked out, can save the item. if (!$checkedOut && $canDo->get('core.edit')) { JToolBarHelper::apply('phocaguestbook.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('phocaguestbook.save', 'JTOOLBAR_SAVE'); JToolBarHelper::addNew('phocaguestbook.save2new', 'JTOOLBAR_SAVE_AND_NEW'); } if (empty($this->item->id)) { JToolBarHelper::cancel('phocaguestbook.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('phocaguestbook.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::divider(); JToolBarHelper::help('screen.phocaguestbook', true); }
function addToolbar() { require_once JPATH_COMPONENT . '/helpers/phocaguestbooks.php'; $state = $this->get('State'); $canDo = PhocaGuestbooksHelper::getActions($state->get('filter.item_id')); JToolBarHelper::title(JText::_('COM_PHOCAGUESTBOOK_ITEMS'), 'item.png'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('phocaguestbook.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('phocaguestbook.edit', 'JTOOLBAR_EDIT'); } if ($canDo->get('core.edit.state')) { JToolBarHelper::divider(); JToolBarHelper::custom('phocaguestbooks.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('phocaguestbooks.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList('COM_PHOCAGUESTBOOK_WARNING_DELETE_ITEMS', 'phocaguestbooks.delete', 'COM_PHOCAGUESTBOOK_DELETE'); } JToolBarHelper::divider(); JToolBarHelper::help('screen.phocaguestbook', true); }