Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_menus
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * The HTML Menus Menu Menus View.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_menus
  17.  * @since       1.6
  18.  */
  19. class MenusViewMenus extends JViewLegacy
  20. {
  21.     protected $items;
  22.  
  23.     protected $modules;
  24.  
  25.     protected $pagination;
  26.  
  27.     protected $state;
  28.  
  29.     /**
  30.      * Display the view
  31.      */
  32.     public function display($tpl null)
  33.     {
  34.         $this->items        = $this->get('Items');
  35.         $this->modules        = $this->get('Modules');
  36.         $this->pagination    = $this->get('Pagination');
  37.         $this->state        = $this->get('State');
  38.  
  39.         MenusHelper::addSubmenu('menus');
  40.  
  41.         // Check for errors.
  42.         if (count($errors $this->get('Errors')))
  43.         {
  44.             JError::raiseError(500implode("\n"$errors));
  45.             return false;
  46.         }
  47.  
  48.         $this->addToolbar();
  49.         $this->sidebar JHtmlSidebar::render();
  50.         parent::display($tpl);
  51.     }
  52.  
  53.     /**
  54.      * Add the page title and toolbar.
  55.      *
  56.      * @since   1.6
  57.      */
  58.     protected function addToolbar()
  59.     {
  60.         require_once JPATH_COMPONENT.'/helpers/menus.php';
  61.  
  62.         $canDo    MenusHelper::getActions($this->state->get('filter.parent_id'));
  63.  
  64.         JToolbarHelper::title(JText::_('COM_MENUS_VIEW_MENUS_TITLE')'list menumgr');
  65.  
  66.         if ($canDo->get('core.create'))
  67.         {
  68.             JToolbarHelper::addNew('menu.add');
  69.         }
  70.         if ($canDo->get('core.edit'))
  71.         {
  72.             JToolbarHelper::editList('menu.edit');
  73.         }
  74.         if ($canDo->get('core.delete'))
  75.         {
  76.             JToolbarHelper::divider();
  77.             JToolbarHelper::deleteList('''menus.delete');
  78.         }
  79.  
  80.         JToolbarHelper::custom('menus.rebuild''refresh.png''refresh_f2.png''JTOOLBAR_REBUILD'false);
  81.         if ($canDo->get('core.admin'))
  82.         {
  83.             JToolbarHelper::divider();
  84.             JToolbarHelper::preferences('com_menus');
  85.         }
  86.         JToolbarHelper::divider();
  87.         JToolbarHelper::help('JHELP_MENUS_MENU_MANAGER');
  88.     }
  89. }

Documentation generated on Tue, 19 Nov 2013 15:17:49 +0100 by phpDocumentor 1.4.3