Source for file cms.php
Documentation is available at cms.php
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* The URL option for the component.
* The prefix to use with controller messages.
* Indicates if the internal state has been set
* @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request).
// Guess the option from the class name (Option)Model(View).
throw
new Exception(JText::_('JLIB_APPLICATION_ERROR_MODEL_GET_NAME'), 500);
$this->name =
$config['name'];
$this->state =
$config['state'];
$this->db =
$config['dbo'];
// Register the paths for the form
// Set the internal state marker - used to ignore setting state from the request
if (!empty($config['ignore_request']))
// Set the clean cache event
if (isset
($config['event_clean_cache']))
$this->event_clean_cache =
$config['event_clean_cache'];
elseif (empty($this->event_clean_cache))
$this->event_clean_cache =
'onContentCleanCache';
* Method to get the model name
* The model name. By default parsed using the classname or it can be set
* by passing a $config['name'] in the class constructor
* @return string The name of the model
throw
new Exception(JText::_('JLIB_APPLICATION_ERROR_MODEL_GET_NAME'), 500);
* Method to get model state variables
* @return object The property where specified, the state object where omitted
// Protected method to auto-populate the model state.
// Set the model state set flag to true.
* Method to register paths for tables
* @param array $config Configuration array
* @return object The property where specified, the state object where omitted
// Set the default view search path
$this->addTablePath($config['table_path']);
elseif (defined('JPATH_COMPONENT_ADMINISTRATOR'))
// Register the paths for the form
$paths =
new SplPriorityQueue;
$paths->insert(JPATH_COMPONENT_ADMINISTRATOR .
'/table', 'normal');
// For legacy purposes. Remove for 4.0
$paths->insert(JPATH_COMPONENT_ADMINISTRATOR .
'/tables', 'normal');
* @param string $group The cache group
* @param integer $client_id The ID of the client
protected function cleanCache($group =
null, $client_id =
0)
// Trigger the onContentCleanCache event.
$dispatcher->trigger($this->event_clean_cache, $options);
* Method to auto-populate the model state.
* This method should only be called once per instantiation and is designed
* to be called on the first call to the getState() method unless the model
* configuration flag to ignore the request is set.
* @note Calling getState in this method will result in recursion.
* Method to test whether a record can be deleted.
* @param object $record A record object.
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
if ($record->published != -
2)
return $user->authorise('core.delete', $this->option);
* Method to test whether a record can have its state changed.
* @param object $record A record object.
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
return $user->authorise('core.edit.state', $this->option);
Documentation generated on Tue, 19 Nov 2013 14:56:00 +0100 by phpDocumentor 1.4.3