| [ Index ] |
PHP Cross Reference of Joomla 1.5.26 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @version $Id: view.php 19343 2010-11-03 18:12:02Z ian $ 4 * @package Joomla 5 * @subpackage Menus 6 * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. 7 * @license GNU/GPL, see LICENSE.php 8 * Joomla! is free software. This version may have been modified pursuant 9 * to the GNU General Public License, and as distributed it includes or 10 * is derivative of works licensed under the GNU General Public License or 11 * other free or open source software licenses. 12 * See COPYRIGHT.php for copyright notices and details. 13 */ 14 15 // no direct access 16 defined( '_JEXEC' ) or die( 'Restricted access' ); 17 18 jimport('joomla.application.component.view'); 19 20 /** 21 * @package Joomla 22 * @subpackage Menus 23 * @since 1.5 24 */ 25 class MenusViewList extends JView 26 { 27 var $_name = 'list'; 28 29 function display($tpl=null) 30 { 31 global $mainframe; 32 33 $this->_layout = 'default'; 34 35 /* 36 * Set toolbar items for the page 37 */ 38 $menutype = $mainframe->getUserStateFromRequest('com_menus.menutype', 'menutype', 'mainmenu', 'menutype'); 39 40 JToolBarHelper::title( JText::_( 'MENU ITEM MANAGER' ) .': <small><small>['.$menutype.']</small></small>', 'menu.png' ); 41 42 $bar =& JToolBar::getInstance('toolbar'); 43 $bar->appendButton( 'Link', 'menus', 'Menus', "index.php?option=com_menus" ); 44 45 JToolBarHelper::makeDefault( 'setdefault' ); 46 JToolBarHelper::publishList(); 47 JToolBarHelper::unpublishList(); 48 JToolBarHelper::customX( 'move', 'move.png', 'move_f2.png', 'Move', true ); 49 JToolBarHelper::customX( 'copy', 'copy.png', 'copy_f2.png', 'Copy', true ); 50 JToolBarHelper::trash(); 51 JToolBarHelper::editListX(); 52 JToolBarHelper::addNewX('newItem'); 53 JToolBarHelper::help( 'screen.menus' ); 54 55 $document = & JFactory::getDocument(); 56 $document->setTitle(JText::_('View Menu Items')); 57 58 $limitstart = JRequest::getVar('limitstart', '0', '', 'int'); 59 $items = &$this->get('Items'); 60 $pagination = &$this->get('Pagination'); 61 $lists = &$this->_getViewLists(); 62 $user = &JFactory::getUser(); 63 64 // Ensure ampersands and double quotes are encoded in item titles 65 foreach ($items as $i => $item) { 66 $treename = $item->treename; 67 $treename = JFilterOutput::ampReplace($treename); 68 $treename = str_replace('"', '"', $treename); 69 $items[$i]->treename = $treename; 70 } 71 72 //Ordering allowed ? 73 $ordering = ($lists['order'] == 'm.ordering'); 74 75 JHTML::_('behavior.tooltip'); 76 77 $this->assignRef('items', $items); 78 $this->assignRef('pagination', $pagination); 79 $this->assignRef('lists', $lists); 80 $this->assignRef('user', $user); 81 $this->assignRef('menutype', $menutype); 82 $this->assignRef('ordering', $ordering); 83 $this->assignRef('limitstart', $limitstart); 84 85 parent::display($tpl); 86 } 87 88 function copyForm($tpl=null) 89 { 90 global $mainframe; 91 92 $this->_layout = 'copy'; 93 94 /* 95 * Set toolbar items for the page 96 */ 97 JToolBarHelper::title( JText::_( 'Menu Items' ) . ': <small><small>[ '. JText::_( 'Copy' ) .' ]</small></small>' ); 98 JToolBarHelper::custom( 'doCopy', 'copy.png', 'copy_f2.png', 'Copy', false ); 99 JToolBarHelper::cancel('cancelItem'); 100 JToolBarHelper::help( 'screen.menus' ); 101 102 $document = & JFactory::getDocument(); 103 $document->setTitle(JText::_('Copy Menu Items')); 104 105 $menutype = $mainframe->getUserStateFromRequest('com_menus.menutype', 'menutype', 'mainmenu', 'menutype'); 106 107 // Build the menutypes select list 108 $menuTypes = MenusHelper::getMenuTypes(); 109 foreach ( $menuTypes as $menuType ) { 110 $menu[] = JHTML::_('select.option', $menuType, $menuType ); 111 } 112 $MenuList = JHTML::_('select.genericlist', $menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null ); 113 114 $items = &$this->get('ItemsFromRequest'); 115 116 $this->assignRef('menutype', $menutype); 117 $this->assignRef('items', $items); 118 $this->assignRef('menutypes', $menuTypes); 119 $this->assignRef('MenuList', $MenuList); 120 121 parent::display($tpl); 122 } 123 124 function moveForm($tpl=null) 125 { 126 global $mainframe; 127 128 $this->_layout = 'move'; 129 130 /* 131 * Set toolbar items for the page 132 */ 133 JToolBarHelper::title( JText::_( 'Menu Items' ) . ': <small><small>[ '. JText::_( 'Move' ) .' ]</small></small>' ); 134 JToolBarHelper::custom( 'doMove', 'move.png', 'move_f2.png', 'Move', false ); 135 JToolBarHelper::cancel('cancelItem'); 136 JToolBarHelper::help( 'screen.menus' ); 137 138 $document = & JFactory::getDocument(); 139 $document->setTitle(JText::_('Move Menu Items')); 140 141 $menutype = $mainframe->getUserStateFromRequest('com_menus.menutype', 'menutype', 'mainmenu', 'menutype'); 142 143 // Build the menutypes select list 144 $menuTypes = MenusHelper::getMenuTypes(); 145 foreach ( $menuTypes as $menuType ) { 146 $menu[] = JHTML::_('select.option', $menuType, $menuType ); 147 } 148 $MenuList = JHTML::_('select.genericlist', $menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null ); 149 150 $items = &$this->get('ItemsFromRequest'); 151 152 $this->assignRef('menutype', $menutype); 153 $this->assignRef('items', $items); 154 $this->assignRef('menutypes', $menuTypes); 155 $this->assignRef('MenuList', $MenuList); 156 157 parent::display($tpl); 158 } 159 160 function &_getViewLists() 161 { 162 global $mainframe; 163 $db =& JFactory::getDBO(); 164 165 $menutype = $mainframe->getUserStateFromRequest( 'com_menus.menutype', 'menutype', 'mainmenu', 'menutype' ); 166 $filter_order = $mainframe->getUserStateFromRequest( "com_menus.$menutype.filter_order", 'filter_order', 'm.ordering', 'cmd' ); 167 $filter_order_Dir = $mainframe->getUserStateFromRequest( "com_menus.$menutype.filter_order_Dir", 'filter_order_Dir', 'ASC', 'word' ); 168 $filter_state = $mainframe->getUserStateFromRequest( "com_menus.$menutype.filter_state", 'filter_state', '', 'word' ); 169 $levellimit = $mainframe->getUserStateFromRequest( "com_menus.$menutype.levellimit", 'levellimit', 10, 'int' ); 170 $search = $mainframe->getUserStateFromRequest( "com_menus.$menutype.search", 'search', '', 'string' ); 171 if (strpos($search, '"') !== false) { 172 $search = str_replace(array('=', '<'), '', $search); 173 } 174 $search = JString::strtolower($search); 175 176 // ensure $filter_order has a good value 177 if (!in_array($filter_order, array('m.name', 'm.published', 'm.ordering', 'groupname', 'm.type', 'm.id'))) { 178 $filter_order = 'm.ordering'; 179 } 180 181 if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC', ''))) { 182 $filter_order_Dir = 'ASC'; 183 } 184 185 // level limit filter 186 $lists['levellist'] = JHTML::_('select.integerlist', 1, 20, 1, 'levellimit', 'size="1" onchange="document.adminForm.submit();"', $levellimit ); 187 188 // state filter 189 $lists['state'] = JHTML::_('grid.state', $filter_state ); 190 191 // table ordering 192 $lists['order_Dir'] = $filter_order_Dir; 193 $lists['order'] = $filter_order; 194 195 // search filter 196 $lists['search']= $search; 197 198 return $lists; 199 } 200 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Mar 28 15:54:07 2012 | Cross-referenced by PHPXref 0.7.1 |