Source for file save.php
Documentation is available at save.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
* Save Controller for global configuration
* @package Joomla.Administrator
* Application object - Redeclared for proper typehinting
* Method to save global configuration.
* @return mixed Calls $app->redirect()
// Check for request forgeries.
$this->app->enqueueMessage(JText::_('JINVALID_TOKEN'));
$this->app->redirect('index.php');
// Set FTP credentials, if given.
$form =
$model->getForm();
$data =
$this->input->get('jform', array(), 'array');
$id =
$this->input->getInt('id');
$option =
$this->input->get('component');
// Check if the user is authorized to do this.
$this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'));
$this->app->redirect('index.php');
$returnUri =
$this->input->post->get('return', null, 'base64');
$redirect =
'&return=' .
urlencode($returnUri);
// Validate the posted data.
$return =
$model->validate($form, $data);
// Check for validation errors.
* The validate method enqueued all messages for us, so we just need to redirect back.
// Save the data in the session.
$this->app->setUserState('com_config.config.global.data', $data);
// Redirect back to the edit screen.
$this->app->redirect(JRoute::_('index.php?option=com_config&view=component&component=' .
$option .
$redirect, false));
// Attempt to save the configuration.
catch
(RuntimeException $e)
// Save the data in the session.
$this->app->setUserState('com_config.config.global.data', $data);
// Save failed, go back to the screen and display a notice.
$this->app->enqueueMessage(JText::sprintf('JERROR_SAVE_FAILED', $e->getMessage()), 'error');
$this->app->redirect(JRoute::_('index.php?option=com_config&view=component&component=' .
$option .
$redirect, false));
// Set the redirect based on the task.
switch ($this->options[3])
$this->app->enqueueMessage(JText::_('COM_CONFIG_SAVE_SUCCESS'));
$this->app->redirect(JRoute::_('index.php?option=com_config&view=component&component=' .
$option .
$redirect, false));
$redirect =
'index.php?option=' .
$option;
$this->app->redirect(JRoute::_($redirect, false));
Documentation generated on Tue, 19 Nov 2013 15:12:36 +0100 by phpDocumentor 1.4.3