Source for file menu.php
Documentation is available at menu.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 Type Controller
* @package Joomla.Administrator
* Dummy method to redirect back to standard controller
* @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 save a menu item.
public function save($key =
null, $urlVar =
null)
// Check for request forgeries.
$data =
$this->input->post->get('jform', array(), 'array');
$context =
'com_menus.edit.menu';
$recordId =
$this->input->getInt('id');
// Make sure we are not trying to modify an administrator menu.
if (isset
($data['client_id']) &&
$data['client_id'] ==
1){
// Redirect back to the edit screen.
// Populate the row id from the session.
// Get the model and attempt to validate the posted data.
$form =
$model->getForm();
$data =
$model->validate($form, $data);
// Check for validation errors.
// Get the validation messages.
$errors =
$model->getErrors();
// Push up to three validation messages out to the user.
for ($i =
0, $n =
count($errors); $i <
$n &&
$i <
3; $i++
)
if ($errors[$i] instanceof
Exception)
$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
$app->enqueueMessage($errors[$i], 'warning');
// Save the data in the session.
$app->setUserState('com_menus.edit.menu.data', $data);
// Redirect back to the edit screen.
// Attempt to save the data.
if (!$model->save($data))
// Save the data in the session.
$app->setUserState('com_menus.edit.menu.data', $data);
// Redirect back to the edit screen.
// Redirect the user and adjust session state based on the chosen task.
// Set the record data in the session.
$recordId =
$model->getState($this->context.
'.id');
// Redirect back to the edit screen.
// Clear the record id and data from the session.
$app->setUserState($context.
'.data', null);
// Redirect back to the edit screen.
// Clear the record id and data from the session.
$app->setUserState($context.
'.data', null);
// Redirect to the list screen.
Documentation generated on Tue, 19 Nov 2013 15:07:49 +0100 by phpDocumentor 1.4.3