Source for file admin.php
Documentation is available at admin.php
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* Base class for a Joomla Administrator Controller
* Controller (controllers are where you put all the actual code) Provides basic
* functionality, such as rendering views (aka displaying templates).
* The URL option for the component.
* The prefix to use with controller messages.
* The URL view list variable.
* @param array $config An optional associative array of configuration settings.
// Define standard task mappings.
// Guess the option as com_NameOfController.
// Guess the JText message prefix. Defaults to the option.
// Guess the list view as the suffix, eg: OptionControllerSuffix.
throw
new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500);
// Check for request forgeries
// Get items to remove from the request.
// Make sure the item ids are integers
jimport('joomla.utilities.arrayhelper');
if ($model->delete($cid))
// Invoke the postDelete method to allow for the child class to access the model.
* Function that allows child controller access to model data
* after the item has been deleted.
* @param JModelLegacy $model The data model object.
* @param integer $id The validated data.
* Display is not supported by this controller.
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
* @return JControllerLegacy A JControllerLegacy object to support chaining.
public function display($cachable =
false, $urlparams =
array())
* Method to publish a list of items
// Check for request forgeries
// Get items to publish from the request.
$data =
array('publish' =>
1, 'unpublish' =>
0, 'archive' =>
2, 'trash' => -
2, 'report' => -
3);
// Make sure the item ids are integers
$model->publish($cid, $value);
$this->setMessage(JText::_('JLIB_DATABASE_ERROR_ANCESTOR_NODES_LOWER_STATE'), 'error');
$extension =
$this->input->get('extension');
$extensionURL =
($extension) ?
'&extension=' .
$extension :
'';
* Changes the order of one or more records.
* @return boolean True on success
// Check for request forgeries.
$inc =
($this->getTask() ==
'orderup') ? -
1 :
1;
$return =
$model->reorder($ids, $inc);
$message =
JText::sprintf('JLIB_APPLICATION_ERROR_REORDER_FAILED', $model->getError());
$message =
JText::_('JLIB_APPLICATION_SUCCESS_ITEM_REORDERED');
* Method to save the submitted ordering values for records.
* @return boolean True on success
// Check for request forgeries.
$pks =
$this->input->post->get('cid', array(), 'array');
$order =
$this->input->post->get('order', array(), 'array');
$return =
$model->saveorder($pks, $order);
$message =
JText::sprintf('JLIB_APPLICATION_ERROR_REORDER_FAILED', $model->getError());
* Check in of one or more records.
* @return boolean True on success
// Check for request forgeries.
$return =
$model->checkin($ids);
$message =
JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError());
* Method to save the submitted ordering values for records via AJAX.
$pks =
$this->input->post->get('cid', array(), 'array');
$order =
$this->input->post->get('order', array(), 'array');
$return =
$model->saveorder($pks, $order);
Documentation generated on Tue, 19 Nov 2013 14:53:27 +0100 by phpDocumentor 1.4.3