Пример #1
0
 public function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_GCALENDAR_MANAGER_GCALENDAR'), 'calendar');
     $canDo = GCalendarUtil::getActions();
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('gcalendar.add', 'JTOOLBAR_NEW');
         JToolBarHelper::custom('import', 'upload.png', 'upload.png', 'COM_GCALENDAR_VIEW_GCALENDARS_BUTTON_IMPORT', false);
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('gcalendar.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'gcalendars.delete', 'JTOOLBAR_DELETE');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_gcalendar', 550);
         JToolBarHelper::divider();
     }
     $items = $this->get('Items');
     $pagination = $this->get('Pagination');
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     $this->items = $items;
     $this->pagination = $pagination;
     parent::display($tpl);
 }
Пример #2
0
 public function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_GCALENDAR'), 'calendar');
     $canDo = GCalendarUtil::getActions();
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_gcalendar', 550);
         JToolBarHelper::divider();
     }
     parent::display($tpl);
 }
Пример #3
0
 public function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_GCALENDAR_MANAGER_GCALENDAR'), 'calendar');
     if (JRequest::getWord('layout') != 'login') {
         $canDo = GCalendarUtil::getActions();
         if ($canDo->get('core.create')) {
             JToolBarHelper::custom('import.save', 'new.png', 'new.png', 'COM_GCALENDAR_VIEW_IMPORT_BUTTON_ADD', false);
         }
         JToolBarHelper::cancel('gcalendar.cancel', 'JTOOLBAR_CANCEL');
         $this->onlineItems = $this->get('OnlineData');
         $this->dbItems = $this->get('DBData');
     }
     JRequest::setVar('hidemainmenu', 0);
     parent::display($tpl);
 }
Пример #4
0
 public function display($tpl = null)
 {
     $this->form = $this->get('Form');
     $this->gcalendar = $this->get('Item');
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     //get the calendar
     $isNew = $this->gcalendar->id < 1;
     JToolBarHelper::title(JText::_('COM_GCALENDAR_MANAGER_GCALENDAR'), 'calendar');
     JRequest::setVar('hidemainmenu', true);
     $canDo = GCalendarUtil::getActions($this->gcalendar->id);
     if ($isNew) {
         if ($canDo->get('core.create')) {
             JToolBarHelper::apply('gcalendar.apply', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('gcalendar.save', 'JTOOLBAR_SAVE');
             JToolBarHelper::custom('gcalendar.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
         }
         JToolBarHelper::cancel('gcalendar.cancel', 'JTOOLBAR_CANCEL');
     } else {
         if ($canDo->get('core.edit')) {
             // We can save the new record
             JToolBarHelper::apply('gcalendar.apply', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('gcalendar.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('gcalendar.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
             }
         }
         if ($canDo->get('core.create')) {
             JToolBarHelper::custom('gcalendar.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
         }
         JToolBarHelper::cancel('gcalendar.cancel', 'JTOOLBAR_CLOSE');
     }
     parent::display($tpl);
 }