Exemplo n.º 1
0
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->cid == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
     $canDo = UserNotifyHelper::getActions($this->state->get('filter.category_id'), $this->item->cid);
     JToolBarHelper::title(JText::_('COM_USERNOTIFY_EDIT_CATEGORY') . $this->catExt, 'notification usernotify');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_usernotify', 'core.create')))) {
         JToolBarHelper::apply('category.apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('category.save', 'JTOOLBAR_SAVE');
     }
     if (!$checkedOut && count($user->getAuthorisedCategories('com_usernotify', 'core.create'))) {
         JToolBarHelper::custom('category.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
     }
     // If an existing item, can save to a copy.
     if (!$isNew && count($user->getAuthorisedCategories('com_usernotify', 'core.create')) > 0) {
         JToolBarHelper::custom('category.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('category.cancel', 'JTOOLBAR_CANCEL');
     } else {
         JToolBarHelper::cancel('category.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('category', true);
 }
Exemplo n.º 2
0
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . '/helpers/usernotify.php';
     $state = $this->get('State');
     $canDo = UserNotifyHelper::getActions($state->get('filter.category_id'));
     $user = JFactory::getUser();
     JToolBarHelper::title(JText::_('COM_USERNOTIFY_MANAGER_CATEGORIES'), 'notification-2 usernotify');
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('category.config', 'JTOOLBAR_EDIT');
     }
     //		if ($canDo->get('core.edit.state')) {
     //			JToolBarHelper::divider();
     //			JToolBarHelper::custom('usernotify.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true);
     //		}
     JToolBarHelper::trash('category.trash', 'JTOOLBAR_REMOVE');
     JToolBarHelper::divider();
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_usernotify');
         JToolBarHelper::divider();
     }
     JToolBarHelper::help('usernotify', true);
 }