mirror of
https://github.com/brmlab/brmsklad.git
synced 2025-08-07 00:23:56 +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
|
@ -1,16 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* 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(tm) Project
|
||||
* @package Cake.View.Helper
|
||||
* @since CakePHP(tm) v 1.3
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('JsBaseEngineHelper', 'View/Helper');
|
||||
|
@ -18,7 +19,7 @@ App::uses('JsBaseEngineHelper', 'View/Helper');
|
|||
/**
|
||||
* MooTools Engine Helper for JsHelper
|
||||
*
|
||||
* Provides MooTools specific Javascript for JsHelper.
|
||||
* Provides MooTools specific JavaScript for JsHelper.
|
||||
* Assumes that you have the following MooTools packages
|
||||
*
|
||||
* - Remote, Remote.HTML, Remote.JSON
|
||||
|
@ -117,11 +118,11 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* Create javascript selector for a CSS rule
|
||||
*
|
||||
* @param string $selector The selector that is targeted
|
||||
* @return MootoolsEngineHelper instance of $this. Allows chained methods.
|
||||
* @return self
|
||||
*/
|
||||
public function get($selector) {
|
||||
$this->_multipleSelection = false;
|
||||
if ($selector == 'window' || $selector == 'document') {
|
||||
if ($selector === 'window' || $selector === 'document') {
|
||||
$this->selection = "$(" . $selector . ")";
|
||||
return $this;
|
||||
}
|
||||
|
@ -143,13 +144,13 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* - 'stop' - Whether you want the event to stopped. (defaults true)
|
||||
*
|
||||
* @param string $type Type of event to bind to the current dom id
|
||||
* @param string $callback The Javascript function you wish to trigger or the function literal
|
||||
* @param string $callback The JavaScript function you wish to trigger or the function literal
|
||||
* @param array $options Options for the event.
|
||||
* @return string completed event handler
|
||||
*/
|
||||
public function event($type, $callback, $options = array()) {
|
||||
$defaults = array('wrap' => true, 'stop' => true);
|
||||
$options = array_merge($defaults, $options);
|
||||
$options += $defaults;
|
||||
|
||||
$function = 'function (event) {%s}';
|
||||
if ($options['wrap'] && $options['stop']) {
|
||||
|
@ -194,9 +195,9 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
public function effect($name, $options = array()) {
|
||||
$speed = null;
|
||||
if (isset($options['speed']) && in_array($options['speed'], array('fast', 'slow'))) {
|
||||
if ($options['speed'] == 'fast') {
|
||||
if ($options['speed'] === 'fast') {
|
||||
$speed = '"short"';
|
||||
} elseif ($options['speed'] == 'slow') {
|
||||
} elseif ($options['speed'] === 'slow') {
|
||||
$speed = '"long"';
|
||||
}
|
||||
}
|
||||
|
@ -204,10 +205,10 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
switch ($name) {
|
||||
case 'hide':
|
||||
$effect = 'setStyle("display", "none")';
|
||||
break;
|
||||
break;
|
||||
case 'show':
|
||||
$effect = 'setStyle("display", "")';
|
||||
break;
|
||||
break;
|
||||
case 'fadeIn':
|
||||
case 'fadeOut':
|
||||
case 'slideIn':
|
||||
|
@ -218,19 +219,19 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
$effect .= "set(\"$effectName\", {duration:$speed}).";
|
||||
}
|
||||
$effect .= "$effectName(\"$direction\")";
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return $this->selection . '.' . $effect . ';';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an new Request.
|
||||
* Create a new Request.
|
||||
*
|
||||
* Requires `Request`. If you wish to use 'update' key you must have ```Request.HTML```
|
||||
* Requires `Request`. If you wish to use 'update' key you must have ```Request.HTML```
|
||||
* if you wish to do Json requests you will need ```JSON``` and ```Request.JSON```.
|
||||
*
|
||||
* @param string|array $url
|
||||
* @param array $options
|
||||
* @param string|array $url URL
|
||||
* @param array $options Options list.
|
||||
* @return string The completed ajax call.
|
||||
*/
|
||||
public function request($url, $options = array()) {
|
||||
|
@ -238,7 +239,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
$options = $this->_mapOptions('request', $options);
|
||||
$type = $data = null;
|
||||
if (isset($options['type']) || isset($options['update'])) {
|
||||
if (isset($options['type']) && strtolower($options['type']) == 'json') {
|
||||
if (isset($options['type']) && strtolower($options['type']) === 'json') {
|
||||
$type = '.JSON';
|
||||
}
|
||||
if (isset($options['update'])) {
|
||||
|
@ -295,8 +296,8 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
*
|
||||
* Requires the `Drag` and `Drag.Move` plugins from MootoolsMore
|
||||
*
|
||||
* Droppables in Mootools function differently from other libraries. Droppables
|
||||
* are implemented as an extension of Drag. So in addition to making a get() selection for
|
||||
* Droppables in Mootools function differently from other libraries. Droppables
|
||||
* are implemented as an extension of Drag. So in addition to making a get() selection for
|
||||
* the droppable element. You must also provide a selector rule to the draggable element. Furthermore,
|
||||
* Mootools droppables inherit all options from Drag.
|
||||
*
|
||||
|
@ -307,7 +308,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
public function drop($options = array()) {
|
||||
if (empty($options['drag'])) {
|
||||
trigger_error(
|
||||
__d('cake_dev', 'MootoolsEngine::drop() requires a "drag" option to properly function'), E_USER_WARNING
|
||||
__d('cake_dev', '%s requires a "drag" option to properly function'), 'MootoolsEngine::drop()', E_USER_WARNING
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
@ -360,7 +361,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* @see JsBaseEngineHelper::serializeForm()
|
||||
*/
|
||||
public function serializeForm($options = array()) {
|
||||
$options = array_merge(array('isForm' => false, 'inline' => false), $options);
|
||||
$options += array('isForm' => false, 'inline' => false);
|
||||
$selection = $this->selection;
|
||||
if (!$options['isForm']) {
|
||||
$selection = '$(' . $this->selection . '.form)';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue