Ejemplo n.º 1
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     // Main menu inactive until apply or edit
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->id;
     $isNew = $this->item->id == 0;
     $canDo = JTrinityCoreHelper::getActions($this->item->id);
     JToolBarHelper::title($isNew ? JText::_('COM_JTRINITYCORE_MANAGER_GOLD_NEW') : JText::_('COM_JTRINITYCORE_MANAGER_GOLD_EDIT'), 'jtrinitycore');
     // Built the actions for new and existing records.
     if ($isNew) {
         // For new records, check the create permission.
         if ($canDo->get('core.create')) {
             JToolBarHelper::apply('gold.apply', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('gold.save', 'JTOOLBAR_SAVE');
             JToolBarHelper::custom('gold.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
         }
         JToolBarHelper::cancel('gold.cancel', 'JTOOLBAR_CANCEL');
     } else {
         if ($canDo->get('core.edit')) {
             // We can save the new record
             JToolBarHelper::apply('gold.apply', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('gold.save', 'JTOOLBAR_SAVE');
             // We can save this record, but check the create permission to see
             // if we can return to make a new one.
             if ($canDo->get('core.create')) {
                 JToolBarHelper::custom('gold.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
             }
         }
         if ($canDo->get('core.create')) {
             JToolBarHelper::custom('gold.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
         }
         JToolBarHelper::cancel('gold.cancel', 'JTOOLBAR_CLOSE');
     }
 }
Ejemplo n.º 2
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     $canDo = JTrinityCoreHelper::getActions();
     JToolBarHelper::title(JText::_('COM_JTRINITYCORE_CPANEL'), 'cpanel');
     //lBarHelper::deleteList('', 'items.delete', 'JTOOLBAR_DELETE');
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         // Global preferences of jtrinitycore component
         JToolBarHelper::preferences('com_jtrinitycore');
     }
 }
Ejemplo n.º 3
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     $canDo = JTrinityCoreHelper::getActions();
     JToolBarHelper::title(JText::_('COM_JTRINITYCORE_MANAGER_HELLOWORLDS'), 'jtrinitycore');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('jtrinitycore.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('jtrinitycore.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'jtrinitycores.delete', 'JTOOLBAR_DELETE');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_jtrinitycore');
     }
 }
Ejemplo n.º 4
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     $canDo = JTrinityCoreHelper::getActions();
     JToolBarHelper::title(JText::_('COM_JTRINITYCORE_REALMS'));
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('realm.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('realm.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'realms.delete', 'JTOOLBAR_DELETE');
     }
     /*if ($canDo->get('core.admin')) 
     		{
     			JToolBarHelper::divider();
     			JToolBarHelper::preferences('com_items');
     		}*/
     JToolBarHelper::custom('cpanel', 'back.png', 'back_f2.png', 'JTOOLBAR_CPANEL', false);
 }