Source for file article.php
Documentation is available at article.php
* @package Joomla.Administrator
* @subpackage com_content
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @package Joomla.Administrator
* @subpackage com_content
* @param array $config A named array of configuration variables.
// An article edit form can come from the articles or featured view.
// Adjust the redirect view on the value of 'return' in the request.
if ($this->input->get('return') ==
'featured')
$this->view_item =
'article&return=featured';
* Method override to check if you can add a new record.
* @param array $data An array of input data.
protected function allowAdd($data =
array())
// If the category has been passed in the data or URL check it.
$allow =
$user->authorise('core.create', 'com_content.category.' .
$categoryId);
// In the absense of better information, revert to the component permissions.
* Method override to check if you can edit an existing record.
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
protected function allowEdit($data =
array(), $key =
'id')
$recordId = (int) isset
($data[$key]) ?
$data[$key] :
0;
$userId =
$user->get('id');
// Check general edit permission first.
if ($user->authorise('core.edit', 'com_content.article.' .
$recordId))
// First test if the permission is available.
if ($user->authorise('core.edit.own', 'com_content.article.' .
$recordId))
// Now test the owner is the user.
$ownerId = (int) isset
($data['created_by']) ?
$data['created_by'] :
0;
if (empty($ownerId) &&
$recordId)
// Need to do a lookup from the model.
$record =
$this->getModel()->getItem($recordId);
$ownerId =
$record->created_by;
// If the owner matches 'me' then do the test.
// Since there is no asset tracking, revert to the component permissions.
* Method to run batch operations.
* @param object $model The model.
* @return boolean True if successful, false otherwise and internal error is set.
public function batch($model =
null)
$model =
$this->getModel('Article', '', array());
return parent::batch($model);
* Function that allows child controller access to model data after the data has been saved.
* @param JModelLegacy $model The data model object.
* @param array $validData The validated data.
protected function postSaveHook(JModelLegacy $model, $validData =
array())
Documentation generated on Tue, 19 Nov 2013 14:53:55 +0100 by phpDocumentor 1.4.3