Source for file view.html.php
Documentation is available at view.html.php
* @package Joomla.Administrator
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* The HTML Menus Menu Items View.
* @package Joomla.Administrator
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
public function display($tpl =
null)
$this->filterForm =
$this->get('FilterForm');
$this->activeFilters =
$this->get('ActiveFilters');
if (count($errors =
$this->get('Errors')))
$this->ordering =
array();
// Preprocess the list of items to find ordering divisions.
foreach ($this->items as $item)
$this->ordering[$item->parent_id][] =
$item->id;
$value =
JText::_('COM_MENUS_TYPE_EXTERNAL_URL');
$value =
JText::_('COM_MENUS_TYPE_ALIAS');
$value =
JText::_('COM_MENUS_TYPE_SEPARATOR');
$value =
JText::_('COM_MENUS_TYPE_HEADING');
||
$lang->load($item->componentname .
'.sys', JPATH_ADMINISTRATOR .
'/components/' .
$item->componentname, null, false, true);
if (!empty($item->componentname))
$value =
JText::_($item->componentname);
if (isset
($vars['view']))
// Attempt to load the view xml file.
$file =
JPATH_SITE .
'/components/' .
$item->componentname .
'/views/' .
$vars['view'] .
'/metadata.xml';
$file =
JPATH_SITE .
'/components/' .
$item->componentname .
'/view/' .
$vars['view'] .
'/metadata.xml';
// Look for the first view node off of the root node.
if ($view =
$xml->xpath('view[1]'))
if (!empty($view[0]['title']))
$vars['layout'] = isset
($vars['layout']) ?
$vars['layout'] :
'default';
// Attempt to load the layout xml file.
// If Alternative Menu Item, get template folder for layout file
if (strpos($vars['layout'], ':') >
0)
// Use template folder for layout file
$temp =
explode(':', $vars['layout']);
$file =
JPATH_SITE .
'/templates/' .
$temp[0] .
'/html/' .
$item->componentname .
'/' .
$vars['view'] .
'/' .
$temp[1] .
'.xml';
// Load template language file
$lang->load('tpl_' .
$temp[0] .
'.sys', JPATH_SITE, null, false, true)
||
$lang->load('tpl_' .
$temp[0] .
'.sys', JPATH_SITE .
'/templates/' .
$temp[0], null, false, true);
// Get XML file from component folder for standard layouts
$file =
JPATH_SITE .
'/components/' .
$item->componentname .
'/views/' .
$vars['view'] .
'/tmpl/' .
$vars['layout'] .
'.xml';
$file =
JPATH_SITE .
'/components/' .
$item->componentname .
'/view/' .
$vars['view'] .
'/tmpl/' .
$vars['layout'] .
'.xml';
// Look for the first view node off of the root node.
if ($layout =
$xml->xpath('layout[1]'))
if (!empty($layout[0]['title']))
$value .=
' » ' .
JText::_(trim((string)
$layout[0]['title']));
if (!empty($layout[0]->message[0]))
$item->item_type_desc =
JText::_(trim((string)
$layout[0]->message[0]));
// Special case for absent views
$value .=
' » ' .
$vars['view'];
if (preg_match("/^index.php\?option=([a-zA-Z\-0-9_]*)/", $item->link, $result))
$value =
JText::sprintf('COM_MENUS_TYPE_UNEXISTING', $result[1]);
$value =
JText::_('COM_MENUS_TYPE_UNKNOWN');
$item->item_type =
$value;
$options[] =
JHtml::_('select.option', '1', JText::_('J1'));
$options[] =
JHtml::_('select.option', '2', JText::_('J2'));
$options[] =
JHtml::_('select.option', '3', JText::_('J3'));
$options[] =
JHtml::_('select.option', '4', JText::_('J4'));
$options[] =
JHtml::_('select.option', '5', JText::_('J5'));
$options[] =
JHtml::_('select.option', '6', JText::_('J6'));
$options[] =
JHtml::_('select.option', '7', JText::_('J7'));
$options[] =
JHtml::_('select.option', '8', JText::_('J8'));
$options[] =
JHtml::_('select.option', '9', JText::_('J9'));
$options[] =
JHtml::_('select.option', '10', JText::_('J10'));
// Allow a system plugin to insert dynamic menu types to the list shown in menus:
* Add the page title and toolbar.
require_once JPATH_COMPONENT .
'/helpers/menus.php';
// Get the toolbar object instance
$bar =
JToolBar::getInstance('toolbar');
if ($canDo->get('core.create'))
if ($canDo->get('core.edit'))
if ($canDo->get('core.edit.state'))
if ($this->state->get('filter.published') == -
2 &&
$canDo->get('core.delete'))
elseif ($canDo->get('core.edit.state'))
if ($canDo->get('core.edit.state'))
JToolbarHelper::custom('items.rebuild', 'refresh.png', 'refresh_f2.png', 'JToolbar_Rebuild', false);
if ($user->authorise('core.create', 'com_menus') &&
$user->authorise('core.edit', 'com_menus') &&
$user->authorise('core.edit.state', 'com_menus'))
JHtml::_('bootstrap.modal', 'collapseModal');
$title =
JText::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$dhtml =
$layout->render(array('title' =>
$title));
$bar->appendButton('Custom', $dhtml, 'batch');
* Returns an array of fields the table can be sorted by
* @return array Array containing the field name to sort by as the key and display text as value
'a.lft' =>
JText::_('JGRID_HEADING_ORDERING'),
'a.published' =>
JText::_('JSTATUS'),
'a.title' =>
JText::_('JGLOBAL_TITLE'),
'a.home' =>
JText::_('COM_MENUS_HEADING_HOME'),
'a.access' =>
JText::_('JGRID_HEADING_ACCESS'),
'association' =>
JText::_('COM_MENUS_HEADING_ASSOCIATION'),
'language' =>
JText::_('JGRID_HEADING_LANGUAGE'),
'a.id' =>
JText::_('JGRID_HEADING_ID')
Documentation generated on Tue, 19 Nov 2013 15:17:38 +0100 by phpDocumentor 1.4.3