mirror of
https://github.com/brmlab/brmsklad.git
synced 2025-08-03 14:43:49 +02:00
Upgrade CakePHP from 2.2.5 to 2.9.5
This commit is contained in:
parent
5a580df460
commit
235a541597
793 changed files with 60746 additions and 23753 deletions
|
@ -4,20 +4,21 @@
|
|||
*
|
||||
* Enables objects to easily tie into an ACL system
|
||||
*
|
||||
* PHP 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2012, Cake Software Foundation, Inc.
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP Project
|
||||
* @package Cake.Model.Behavior
|
||||
* @since CakePHP v 1.2.0.4487
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('ModelBehavior', 'Model');
|
||||
App::uses('AclNode', 'Model');
|
||||
App::uses('Hash', 'Utility');
|
||||
|
||||
|
@ -41,8 +42,8 @@ class AclBehavior extends ModelBehavior {
|
|||
/**
|
||||
* Sets up the configuration for the model, and loads ACL models if they haven't been already
|
||||
*
|
||||
* @param Model $model
|
||||
* @param array $config
|
||||
* @param Model $model Model using this behavior.
|
||||
* @param array $config Configuration options.
|
||||
* @return void
|
||||
*/
|
||||
public function setup(Model $model, $config = array()) {
|
||||
|
@ -62,14 +63,14 @@ class AclBehavior extends ModelBehavior {
|
|||
$model->{$type} = ClassRegistry::init($type);
|
||||
}
|
||||
if (!method_exists($model, 'parentNode')) {
|
||||
trigger_error(__d('cake_dev', 'Callback parentNode() not defined in %s', $model->alias), E_USER_WARNING);
|
||||
trigger_error(__d('cake_dev', 'Callback %s not defined in %s', 'parentNode()', $model->alias), E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the Aro/Aco node for this model
|
||||
*
|
||||
* @param Model $model
|
||||
* @param Model $model Model using this behavior.
|
||||
* @param string|array|Model $ref Array with 'model' and 'foreign_key', model object, or string value
|
||||
* @param string $type Only needed when Acl is set up as 'both', specify 'Aro' or 'Aco' to get the correct node
|
||||
* @return array
|
||||
|
@ -80,7 +81,7 @@ class AclBehavior extends ModelBehavior {
|
|||
$type = $this->_typeMaps[$this->settings[$model->name]['type']];
|
||||
if (is_array($type)) {
|
||||
trigger_error(__d('cake_dev', 'AclBehavior is setup with more then one type, please specify type parameter for node()'), E_USER_WARNING);
|
||||
return null;
|
||||
return array();
|
||||
}
|
||||
}
|
||||
if (empty($ref)) {
|
||||
|
@ -92,17 +93,18 @@ class AclBehavior extends ModelBehavior {
|
|||
/**
|
||||
* Creates a new ARO/ACO node bound to this record
|
||||
*
|
||||
* @param Model $model
|
||||
* @param boolean $created True if this is a new record
|
||||
* @param Model $model Model using this behavior.
|
||||
* @param bool $created True if this is a new record
|
||||
* @param array $options Options passed from Model::save().
|
||||
* @return void
|
||||
*/
|
||||
public function afterSave(Model $model, $created) {
|
||||
public function afterSave(Model $model, $created, $options = array()) {
|
||||
$types = $this->_typeMaps[$this->settings[$model->name]['type']];
|
||||
if (!is_array($types)) {
|
||||
$types = array($types);
|
||||
}
|
||||
foreach ($types as $type) {
|
||||
$parent = $model->parentNode();
|
||||
$parent = $model->parentNode($type);
|
||||
if (!empty($parent)) {
|
||||
$parent = $this->node($model, $parent, $type);
|
||||
}
|
||||
|
@ -123,7 +125,7 @@ class AclBehavior extends ModelBehavior {
|
|||
/**
|
||||
* Destroys the ARO/ACO node bound to the deleted record
|
||||
*
|
||||
* @param Model $model
|
||||
* @param Model $model Model using this behavior.
|
||||
* @return void
|
||||
*/
|
||||
public function afterDelete(Model $model) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue