Пример #1
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $canDo = RedirectHelper::getActions();
     JToolBarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINK'), 'redirect');
     // If not checked out, can save the item.
     if ($canDo->get('core.edit')) {
         JToolBarHelper::apply('link.apply');
         JToolBarHelper::save('link.save');
     }
     // This component does not support Save as Copy due to uniqueness checks.
     // While it can be done, it causes too much confusion if the user does
     // not change the Old URL.
     if ($canDo->get('core.edit') && $canDo->get('core.create')) {
         JToolBarHelper::save2new('link.save2new');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('link.cancel');
     } else {
         JToolBarHelper::cancel('link.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER_EDIT');
 }
Пример #2
0
 /**
  * Setup the Toolbar
  */
 protected function _setToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $canDo = RedirectHelper::getActions();
     JToolBarHelper::title(JText::_('Redir_Manager_Link'));
     // If not checked out, can save the item.
     if ($canDo->get('core.edit')) {
         JToolBarHelper::apply('link.apply', 'JToolbar_Apply');
         JToolBarHelper::save('link.save', 'JToolbar_Save');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::custom('link.save2copy§', 'copy.png', 'copy_f2.png', 'JToolbar_Save_as_Copy', false);
     }
     if ($canDo->get('core.edit') && $canDo->get('core.create')) {
         JToolBarHelper::addNew('link.save2new', 'JToolbar_Save_and_new');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('link.cancel', 'JToolbar_Cancel');
     } else {
         JToolBarHelper::cancel('link.cancel', 'JToolbar_Close');
     }
     JToolBarHelper::help('screen.redirect.link');
 }
Пример #3
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     $state = $this->get('State');
     $canDo = RedirectHelper::getActions();
     JToolBarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINKS'), 'redirect');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('link.add');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('link.edit');
     }
     if ($canDo->get('core.edit.state')) {
         if ($state->get('filter.state') != 2) {
             JToolBarHelper::divider();
             JToolBarHelper::publish('links.publish', 'JTOOLBAR_ENABLE', true);
             JToolBarHelper::unpublish('links.unpublish', 'JTOOLBAR_DISABLE', true);
         }
         if ($state->get('filter.state') != -1) {
             JToolBarHelper::divider();
             if ($state->get('filter.state') != 2) {
                 JToolBarHelper::archiveList('links.archive');
             } else {
                 if ($state->get('filter.state') == 2) {
                     JToolBarHelper::unarchiveList('links.publish', 'JTOOLBAR_UNARCHIVE');
                 }
             }
         }
     }
     if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'links.delete', 'JTOOLBAR_EMPTY_TRASH');
     } else {
         if ($canDo->get('core.edit.state')) {
             JToolBarHelper::trash('links.trash');
             JToolBarHelper::divider();
         }
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_redirect');
         JToolBarHelper::divider();
     }
     JToolBarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER');
 }
Пример #4
0
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $state = $this->get('State');
     $canDo = RedirectHelper::getActions();
     JToolbarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINKS'), 'redirect');
     if ($canDo->get('core.create')) {
         JToolbarHelper::addNew('link.add');
     }
     if ($canDo->get('core.edit')) {
         JToolbarHelper::editList('link.edit');
     }
     if ($canDo->get('core.edit.state')) {
         if ($state->get('filter.state') != 2) {
             JToolbarHelper::divider();
             JToolbarHelper::publish('links.publish', 'JTOOLBAR_ENABLE', true);
             JToolbarHelper::unpublish('links.unpublish', 'JTOOLBAR_DISABLE', true);
         }
         if ($state->get('filter.state') != -1) {
             JToolbarHelper::divider();
             if ($state->get('filter.state') != 2) {
                 JToolbarHelper::archiveList('links.archive');
             } elseif ($state->get('filter.state') == 2) {
                 JToolbarHelper::unarchiveList('links.publish', 'JTOOLBAR_UNARCHIVE');
             }
         }
     }
     if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
         JToolbarHelper::deleteList('', 'links.delete', 'JTOOLBAR_EMPTY_TRASH');
         JToolbarHelper::divider();
     } elseif ($canDo->get('core.edit.state')) {
         JToolbarHelper::trash('links.trash');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_redirect');
         JToolbarHelper::divider();
     }
     JToolbarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER');
     JHtmlSidebar::setAction('index.php?option=com_redirect&view=links');
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', RedirectHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.state'), true));
 }