Source for file menus.php
Documentation is available at menus.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 Menu List Controller
* @package Joomla.Administrator
* @param boolean If true, the view output will be cached
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
* @return JController This object to support chaining.
public function display($cachable =
false, $urlparams =
false)
* Method to get a model object, loading it if required.
* @param string $name The model name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $config Configuration array for model. Optional.
* @return object The model.
public function getModel($name =
'Menu', $prefix =
'MenusModel', $config =
array('ignore_request' =>
true))
$model =
parent::getModel($name, $prefix, $config);
// Check for request forgeries
// Get items to remove from the request.
$cid =
$this->input->get('cid', array(), 'array');
// Make sure the item ids are integers
jimport('joomla.utilities.arrayhelper');
if (!$model->delete($cid))
$this->setRedirect('index.php?option=com_menus&view=menus');
* @return bool False on failure or error, true on success.
$this->setRedirect('index.php?option=com_menus&view=menus');
* Temporary method. This should go into the 1.5 to 1.6 upgrade routines.
$query =
$db->getQuery(true);
$query->select('element, extension_id')
->where('type = ' .
$db->quote('component'));
$components =
$db->loadAssocList('element', 'extension_id');
catch
(RuntimeException $e)
// Load all the component menu links
$query->select($db->quoteName('id'))
->select($db->quoteName('link'))
->select($db->quoteName('component_id'))
->where($db->quoteName('type') .
' = ' .
$db->quote('component.item'));
$items =
$db->loadObjectList();
catch
(RuntimeException $e)
foreach ($items as $item)
if (isset
($parts['option']))
$option =
$parts['option'];
// Lookup the component ID
if (isset
($components[$option]))
$componentId =
$components[$option];
// Mismatch. Needs human intervention.
// Check for mis-matched component id's in the menu link.
if ($item->component_id !=
$componentId)
// Update the menu table.
$log =
"Link $item->id refers to $item->component_id, converting to $componentId ($item->link)";
$query->update('#__menu')
->set('component_id = ' .
$componentId)
->where('id = ' .
$item->id);
$db->setQuery($query)->execute();
catch
(RuntimeException $e)
//echo "<br>".$db->getQuery();
Documentation generated on Tue, 19 Nov 2013 15:08:00 +0100 by phpDocumentor 1.4.3