예제 #1
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->id;
     $isNew = $this->item->id == 0;
     $canDo = MailUPHelper::getActions($this->item->id);
     JToolBarHelper::title($isNew ? JText::_('COM_MAILUP_MANAGER_MAILUP_NEW') : JText::_('COM_MAILUP_MANAGER_MAILUP_EDIT'), 'group');
     // Built the actions for new and existing records.
     if ($isNew) {
         // For new records, check the create permission.
         if ($canDo->get('core.create')) {
             //JToolBarHelper::apply('group.save', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('group.applyGroup', 'JTOOLBAR_SAVE');
             //JToolBarHelper::custom('group.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
         }
         JToolBarHelper::cancel('group.cancel', 'JTOOLBAR_CANCEL');
     } else {
         if ($canDo->get('core.edit')) {
             // We can save the new record
             //JToolBarHelper::apply('group.save', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('group.updateGroup', '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('group.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
             }
         }
         if ($canDo->get('core.create')) {
             //JToolBarHelper::custom('group.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
         }
         JToolBarHelper::cancel('group.cancel', 'JTOOLBAR_CLOSE');
     }
 }
예제 #2
0
 /**
  * display task
  *
  * @return void
  */
 function display($cachable = false)
 {
     // set default view if not set
     JRequest::setVar('view', JRequest::getCmd('view', 'MailUPs'));
     // call parent behavior
     parent::display($cachable);
     // Set the submenu
     MailUPHelper::addSubmenu(JRequest::getVar('view'));
 }
예제 #3
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     $canDo = MailUPHelper::getActions();
     JToolBarHelper::title(JText::_('COM_MAILUP_MANAGER_MAILUPS'), 'list');
     if ($canDo->get('core.create')) {
         //JToolBarHelper::addNew( 'list.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('list.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.delete')) {
         //JToolBarHelper::deleteList('', 'lists.deleteList', 'JTOOLBAR_DELETE');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         JToolBarHelper::custom('lists.importLists', 'import', 'import', 'Import', false, false);
     }
 }
예제 #4
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     $canDo = MailUPHelper::getActions();
     JToolBarHelper::title(JText::_('COM_MAILUP_MANAGER_MAILUPS'), 'mailup');
     if ($canDo->get('core.create')) {
         //JToolBarHelper::addNew('mailup.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('mailup.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.delete')) {
         //JToolBarHelper::deleteList('', 'mailups.delete', 'JTOOLBAR_DELETE');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_mailup');
     }
 }