Completed
Push — master ( 5df1fc...70601d )
by Jean-Christophe
03:41
created
Ajax/common/traits/JsUtilsActionsTrait.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	 * @return string
14 14
 	 */
15 15
 	public function addClass($element='this', $class='', $immediatly=false) {
16
-		return $this->js->_genericCallValue('addClass',$element, $class, $immediatly);
16
+		return $this->js->_genericCallValue('addClass', $element, $class, $immediatly);
17 17
 	}
18 18
 
19 19
 	/**
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 	 * @param boolean $immediatly defers the execution if set to false
24 24
 	 * @return string
25 25
 	 */
26
-	public function after($to, $element, $immediatly=false){
27
-		return $this->js->_genericCallElement('after',$to, $element, $immediatly);
26
+	public function after($to, $element, $immediatly=false) {
27
+		return $this->js->_genericCallElement('after', $to, $element, $immediatly);
28 28
 	}
29 29
 
30 30
 	/**
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 	 * @param boolean $immediatly defers the execution if set to false
35 35
 	 * @return string
36 36
 	 */
37
-	public function before($to, $element, $immediatly=false){
38
-		return $this->js->_genericCallElement('before',$to, $element, $immediatly);
37
+	public function before($to, $element, $immediatly=false) {
38
+		return $this->js->_genericCallElement('before', $to, $element, $immediatly);
39 39
 	}
40 40
 
41 41
 	/**
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 	 * @param string $value
56 56
 	 * @param boolean $immediatly defers the execution if set to false
57 57
 	 */
58
-	public function val($element='this',$value='',$immediatly=false){
59
-		return $this->js->_genericCallValue('val',$element,$value,$immediatly);
58
+	public function val($element='this', $value='', $immediatly=false) {
59
+		return $this->js->_genericCallValue('val', $element, $value, $immediatly);
60 60
 	}
61 61
 
62 62
 	/**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 * @param boolean $immediatly defers the execution if set to false
67 67
 	 */
68 68
 	public function html($element='this', $value='', $immediatly=false) {
69
-		return $this->js->_genericCallValue('html',$element, $value, $immediatly);
69
+		return $this->js->_genericCallValue('html', $element, $value, $immediatly);
70 70
 	}
71 71
 
72 72
 	/**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 * @return string
92 92
 	 */
93 93
 	public function append($to, $element, $immediatly=false) {
94
-		return $this->js->_genericCallElement('append',$to, $element, $immediatly);
94
+		return $this->js->_genericCallElement('append', $to, $element, $immediatly);
95 95
 	}
96 96
 
97 97
 	/**
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 * @return string
103 103
 	 */
104 104
 	public function prepend($to, $element, $immediatly=false) {
105
-		return $this->js->_genericCallElement('prepend',$to, $element, $immediatly);
105
+		return $this->js->_genericCallElement('prepend', $to, $element, $immediatly);
106 106
 	}
107 107
 
108 108
 	/**
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 * @return string
154 154
 	 */
155 155
 	public function removeClass($element='this', $class='', $immediatly=false) {
156
-		return $this->js->_genericCall('removeClass',$element, $class, $immediatly);
156
+		return $this->js->_genericCall('removeClass', $element, $class, $immediatly);
157 157
 	}
158 158
 
159 159
 	/**
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	 * @return string
215 215
 	 */
216 216
 	public function toggleClass($element='this', $class='', $immediatly=false) {
217
-		return $this->js->_genericCallValue('toggleClass',$element, $class, $immediatly);
217
+		return $this->js->_genericCallValue('toggleClass', $element, $class, $immediatly);
218 218
 	}
219 219
 
220 220
 	/**
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 		$preventDefault=false;
291 291
 		$immediatly=true;
292 292
 		extract($parameters);
293
-		return $this->js->_doJQueryOn($event, $element, $elementToModify, $jqueryCall, $param, $preventDefault, $stopPropagation, $jsCallback,$immediatly);
293
+		return $this->js->_doJQueryOn($event, $element, $elementToModify, $jqueryCall, $param, $preventDefault, $stopPropagation, $jsCallback, $immediatly);
294 294
 	}
295 295
 
296 296
 	/**
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 		$preventDefault=false;
318 318
 		$immediatly=true;
319 319
 		extract($parameters);
320
-		$script=$this->js->_execOn($element, $event, $js, $preventDefault, $stopPropagation,$immediatly);
320
+		$script=$this->js->_execOn($element, $event, $js, $preventDefault, $stopPropagation, $immediatly);
321 321
 		return $script;
322 322
 	}
323 323
 }
324 324
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormFields.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -15,26 +15,26 @@  discard block
 block discarded – undo
15 15
 	protected $_equalWidth;
16 16
 	protected $_name;
17 17
 
18
-	public function __construct($identifier, $fields=array(),$equalWidth=true) {
18
+	public function __construct($identifier, $fields=array(), $equalWidth=true) {
19 19
 		parent::__construct($identifier, "div");
20 20
 		$this->_equalWidth=$equalWidth;
21 21
 		$this->addItems($fields);
22 22
 	}
23 23
 
24
-	public function addFields($fields=NULL,$label=NULL){
25
-		if(!$fields instanceof HtmlFormFields){
26
-			if(\is_array($fields)===false){
27
-				$fields = \func_get_args();
24
+	public function addFields($fields=NULL, $label=NULL) {
25
+		if (!$fields instanceof HtmlFormFields) {
26
+			if (\is_array($fields)===false) {
27
+				$fields=\func_get_args();
28 28
 				$end=\end($fields);
29
-				if(\is_string($end)){
29
+				if (\is_string($end)) {
30 30
 					$label=$end;
31 31
 					\array_pop($fields);
32 32
 				}else $label=NULL;
33 33
 			}
34 34
 		}
35
-		if(isset($label))
35
+		if (isset($label))
36 36
 			$this->setLabel($label);
37
-		foreach ($fields as $field){
37
+		foreach ($fields as $field) {
38 38
 			$this->addItem($field);
39 39
 		}
40 40
 		return $this;
@@ -44,39 +44,39 @@  discard block
 block discarded – undo
44 44
 	 * @param string|HtmlSemDoubleElement $label
45 45
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
46 46
 	 */
47
-	public function setLabel($label){
47
+	public function setLabel($label) {
48 48
 		$labelO=$label;
49
-		if(\is_string($label)){
50
-			$labelO=new HtmlSemDoubleElement("","label","",$label);
49
+		if (\is_string($label)) {
50
+			$labelO=new HtmlSemDoubleElement("", "label", "", $label);
51 51
 		}
52
-		$this->insertItem($labelO,0);
52
+		$this->insertItem($labelO, 0);
53 53
 		return $labelO;
54 54
 	}
55
-	public function addItem($item){
55
+	public function addItem($item) {
56 56
 		$item=parent::addItem($item);
57 57
 		$item->setContainer($this);
58 58
 		return $item;
59 59
 	}
60
-	public function compile(JsUtils $js=NULL,View $view=NULL){
61
-		if($this->_equalWidth){
60
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
61
+		if ($this->_equalWidth) {
62 62
 			$count=$this->count();
63 63
 			$this->addToProperty("class", Wide::getConstants()["W".$count]." fields");
64 64
 		}else
65
-			$this->addToProperty("class","fields");
66
-		return parent::compile($js,$view);
65
+			$this->addToProperty("class", "fields");
66
+		return parent::compile($js, $view);
67 67
 	}
68 68
 
69
-	public function setWidth($index,$width){
69
+	public function setWidth($index, $width) {
70 70
 		$this->_equalWidth=false;
71 71
 		return $this->getItem($index)->setWidth($width);
72 72
 	}
73 73
 
74
-	public function setInline(){
74
+	public function setInline() {
75 75
 		$this->_equalWidth=false;
76 76
 		$this->addToProperty("class", "inline");
77 77
 	}
78 78
 
79
-	public function setGrouped(){
79
+	public function setGrouped() {
80 80
 		$this->_equalWidth=false;
81 81
 		$this->addToProperty("class", "grouped");
82 82
 	}
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
 		return $this;
91 91
 	}
92 92
 
93
-	public static function radios($name,$items=array(),$label=NULL){
93
+	public static function radios($name, $items=array(), $label=NULL) {
94 94
 		$fields=array();
95 95
 		$i=0;
96
-		foreach ($items as $item){
97
-			$fields[]=new HtmlFormRadio($name."-".$i++,$name,$item,$item);
96
+		foreach ($items as $item) {
97
+			$fields[]=new HtmlFormRadio($name."-".$i++, $name, $item, $item);
98 98
 		}
99
-		$radios=new HtmlFormFields("fields-".$name,$fields);
100
-		if(isset($label))
99
+		$radios=new HtmlFormFields("fields-".$name, $fields);
100
+		if (isset($label))
101 101
 			$radios->setLabel($label)->setProperty("for", $name);
102 102
 		return $radios;
103 103
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlForm.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -13,62 +13,62 @@  discard block
 block discarded – undo
13 13
  * @author jc
14 14
  * @version 1.001
15 15
  */
16
-class HtmlForm extends HtmlSemCollection{
16
+class HtmlForm extends HtmlSemCollection {
17 17
 
18 18
 	use FieldsTrait;
19 19
 
20 20
 	protected $_fields;
21 21
 
22
-	public function __construct( $identifier, $elements=array()){
23
-		parent::__construct( $identifier, "form", "ui form");
24
-		$this->_states=[State::ERROR,State::SUCCESS,State::WARNING,State::DISABLED];
22
+	public function __construct($identifier, $elements=array()) {
23
+		parent::__construct($identifier, "form", "ui form");
24
+		$this->_states=[State::ERROR, State::SUCCESS, State::WARNING, State::DISABLED];
25 25
 		$this->setProperty("name", $this->identifier);
26 26
 		$this->_fields=array();
27 27
 		$this->addItems($elements);
28 28
 	}
29 29
 
30
-	public function addHeader($title,$niveau=1,$dividing=true){
31
-		$header=new HtmlHeader("",$niveau,$title);
32
-		if($dividing)
30
+	public function addHeader($title, $niveau=1, $dividing=true) {
31
+		$header=new HtmlHeader("", $niveau, $title);
32
+		if ($dividing)
33 33
 			$header->setDividing();
34 34
 		return $this->addItem($header);
35 35
 	}
36 36
 
37
-	public function addFields($fields=NULL,$label=NULL){
38
-		if(isset($fields)){
39
-			if(!$fields instanceof HtmlFormFields){
40
-				if(\is_array($fields)===false){
41
-					$fields = \func_get_args();
37
+	public function addFields($fields=NULL, $label=NULL) {
38
+		if (isset($fields)) {
39
+			if (!$fields instanceof HtmlFormFields) {
40
+				if (\is_array($fields)===false) {
41
+					$fields=\func_get_args();
42 42
 					$end=\end($fields);
43
-					if(\is_string($end)){
43
+					if (\is_string($end)) {
44 44
 						$label=$end;
45 45
 						\array_pop($fields);
46 46
 					}else $label=NULL;
47 47
 				}
48
-				$this->_fields=\array_merge($this->_fields,$fields);
49
-				$fields=new HtmlFormFields("fields-".$this->identifier."-".$this->count(),$fields);
48
+				$this->_fields=\array_merge($this->_fields, $fields);
49
+				$fields=new HtmlFormFields("fields-".$this->identifier."-".$this->count(), $fields);
50 50
 			}
51
-			if(isset($label))
52
-			 $fields=new HtmlFormField("", $fields,$label);
53
-		}else{
51
+			if (isset($label))
52
+			 $fields=new HtmlFormField("", $fields, $label);
53
+		}else {
54 54
 			$fields=new HtmlFormFields("fields-".$this->identifier."-".$this->count());
55 55
 		}
56 56
 		$this->addItem($fields);
57 57
 		return $fields;
58 58
 	}
59 59
 
60
-	public function addItem($item){
60
+	public function addItem($item) {
61 61
 		$item=parent::addItem($item);
62
-		if(\is_subclass_of($item, HtmlFormField::class)===true){
62
+		if (\is_subclass_of($item, HtmlFormField::class)===true) {
63 63
 			$this->_fields[]=$item;
64 64
 		}
65 65
 		return $item;
66 66
 	}
67 67
 
68
-	public function getField($index){
69
-		if(\is_string($index)){
68
+	public function getField($index) {
69
+		if (\is_string($index)) {
70 70
 			$field=$this->getElementById($index, $this->_fields);
71
-		}else{
71
+		}else {
72 72
 			$field=$this->_fields[$index];
73 73
 		}
74 74
 		return $field;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * automatically divide fields to be equal width
79 79
 	 * @return \Ajax\semantic\html\collections\form\HtmlForm
80 80
 	 */
81
-	public function setEqualWidth(){
81
+	public function setEqualWidth() {
82 82
 		return $this->addToProperty("class", "equal width");
83 83
 	}
84 84
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 * @param HtmlFormField $field
88 88
 	 * @return \Ajax\common\html\HtmlDoubleElement
89 89
 	 */
90
-	public function addField($field){
90
+	public function addField($field) {
91 91
 		return $this->addItem($field);
92 92
 	}
93 93
 
@@ -99,22 +99,22 @@  discard block
 block discarded – undo
99 99
 	 * @param string $type
100 100
 	 * @return \Ajax\semantic\html\collections\HtmlMessage
101 101
 	 */
102
-	public function addMessage($identifier,$content,$header=NULL,$icon=NULL,$type=NULL){
103
-		$message=new HtmlMessage($identifier,$content);
104
-		if(isset($header))
102
+	public function addMessage($identifier, $content, $header=NULL, $icon=NULL, $type=NULL) {
103
+		$message=new HtmlMessage($identifier, $content);
104
+		if (isset($header))
105 105
 			$message->addHeader($header);
106
-		if(isset($icon))
106
+		if (isset($icon))
107 107
 			$message->setIcon($icon);
108
-		if(isset($type))
108
+		if (isset($type))
109 109
 			$message->setStyle($type);
110 110
 		return $this->addItem($message);
111 111
 	}
112 112
 
113
-	public function setLoading(){
113
+	public function setLoading() {
114 114
 		return $this->addToProperty("class", "loading");
115 115
 	}
116 116
 
117
-	public function jsState($state){
118
-		return $this->jsDoJquery("addClass",$state);
117
+	public function jsState($state) {
118
+		return $this->jsDoJquery("addClass", $state);
119 119
 	}
120 120
 }
121 121
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/TextFieldsTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@
 block discarded – undo
3 3
 namespace Ajax\semantic\html\collections\form;
4 4
 
5 5
 trait TextFieldsTrait {
6
-	public function setPlaceholder($value){
6
+	public function setPlaceholder($value) {
7 7
 		return $this->getField()->setPlaceholder($value);
8 8
 	}
9 9
 
10
-	public function setValue($value){
10
+	public function setValue($value) {
11 11
 		return $this->getField()->setValue($value);
12 12
 	}
13 13
 }
14 14
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/traits/SemanticHtmlElementsTrait.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 	 * @param boolean $asIcons
36 36
 	 * @return HtmlButtonGroups
37 37
 	 */
38
-	public function htmlButtonGroups($identifier,$elements=array(),$asIcons=false){
39
-		return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements,$asIcons));
38
+	public function htmlButtonGroups($identifier, $elements=array(), $asIcons=false) {
39
+		return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements, $asIcons));
40 40
 	}
41 41
 
42 42
 	/**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 * @param string $content
46 46
 	 * @return HtmlContainer
47 47
 	 */
48
-	public function htmlContainer($identifier,$content=""){
48
+	public function htmlContainer($identifier, $content="") {
49 49
 		return $this->addHtmlComponent(new HtmlContainer($identifier, $content));
50 50
 	}
51 51
 
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 	 * @param string $content
55 55
 	 * @return HtmlDivider
56 56
 	 */
57
-	public function htmlDivider($identifier,$content="",$tagName="div"){
58
-		return $this->addHtmlComponent(new HtmlDivider($identifier, $content,$tagName));
57
+	public function htmlDivider($identifier, $content="", $tagName="div") {
58
+		return $this->addHtmlComponent(new HtmlDivider($identifier, $content, $tagName));
59 59
 	}
60 60
 
61 61
 	/**
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 	 * @param string $type
66 66
 	 * @return HtmlHeader
67 67
 	 */
68
-	public function htmlHeader($identifier,$niveau=1,$content=NULL,$type="page"){
69
-		return $this->addHtmlComponent(new HtmlHeader($identifier,$niveau,$content,$type));
68
+	public function htmlHeader($identifier, $niveau=1, $content=NULL, $type="page") {
69
+		return $this->addHtmlComponent(new HtmlHeader($identifier, $niveau, $content, $type));
70 70
 	}
71 71
 
72 72
 	/**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 * @param string $icon
75 75
 	 * @return HtmlIcon
76 76
 	 */
77
-	public function htmlIcon($identifier,$icon){
77
+	public function htmlIcon($identifier, $icon) {
78 78
 		return $this->addHtmlComponent(new HtmlIcon($identifier, $icon));
79 79
 	}
80 80
 
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
 	 * @param array $icons
85 85
 	 * @return HtmlIconGroups
86 86
 	 */
87
-	public function htmlIconGroups($identifier,$size="",$icons=array()){
88
-		$group=new HtmlIconGroups($identifier,$size);
89
-		if(JArray::isAssociative($icons)){
90
-			foreach ($icons as $icon=>$size){
91
-				$group->add($icon,$size);
87
+	public function htmlIconGroups($identifier, $size="", $icons=array()) {
88
+		$group=new HtmlIconGroups($identifier, $size);
89
+		if (JArray::isAssociative($icons)) {
90
+			foreach ($icons as $icon=>$size) {
91
+				$group->add($icon, $size);
92 92
 			}
93
-		}else{
94
-			foreach ($icons as $icon){
93
+		}else {
94
+			foreach ($icons as $icon) {
95 95
 				$group->add($icon);
96 96
 			}
97 97
 		}
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
 	 * @param string $placeholder
107 107
 	 * @return HtmlInput
108 108
 	 */
109
-	public function htmlInput($identifier,$type="text",$value="",$placeholder=""){
110
-		return $this->addHtmlComponent(new HtmlInput($identifier,$type,$value,$placeholder));
109
+	public function htmlInput($identifier, $type="text", $value="", $placeholder="") {
110
+		return $this->addHtmlComponent(new HtmlInput($identifier, $type, $value, $placeholder));
111 111
 	}
112 112
 
113 113
 	/**
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
 	 * @param string $tagName
117 117
 	 * @return HtmlLabel
118 118
 	 */
119
-	public function htmlLabel($identifier,$content="",$tagName="div"){
120
-		return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$tagName));
119
+	public function htmlLabel($identifier, $content="", $tagName="div") {
120
+		return $this->addHtmlComponent(new HtmlLabel($identifier, $content, $tagName));
121 121
 	}
122 122
 
123 123
 	/**
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 	 * @param array $items
127 127
 	 * @return HtmlList
128 128
 	 */
129
-	public function htmlList($identifier,$items=array()){
130
-		return $this->addHtmlComponent(new HtmlList($identifier,$items));
129
+	public function htmlList($identifier, $items=array()) {
130
+		return $this->addHtmlComponent(new HtmlList($identifier, $items));
131 131
 	}
132 132
 
133 133
 	/**
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 	 * @param string $content
137 137
 	 * @return HtmlSegment
138 138
 	 */
139
-	public function htmlSegment($identifier, $content=""){
140
-		return $this->addHtmlComponent(new HtmlSegment($identifier,$content));
139
+	public function htmlSegment($identifier, $content="") {
140
+		return $this->addHtmlComponent(new HtmlSegment($identifier, $content));
141 141
 	}
142 142
 
143 143
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * @param array $items the segments
147 147
 	 * @return HtmlSegmentGroups
148 148
 	 */
149
-	public function htmlSegmentGroups($identifier, $items=array()){
150
-		return $this->addHtmlComponent(new HtmlSegmentGroups($identifier,$items));
149
+	public function htmlSegmentGroups($identifier, $items=array()) {
150
+		return $this->addHtmlComponent(new HtmlSegmentGroups($identifier, $items));
151 151
 	}
152 152
 }
153 153
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/JsUtils.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * JsUtils Class : Phalcon service to be injected
26 26
  */
27 27
 abstract class _JsUtils implements InjectionAwareInterface {
28
-	use JsUtilsEventsTrait,JsUtilsActionsTrait,JsUtilsAjaxTrait;
28
+	use JsUtilsEventsTrait, JsUtilsActionsTrait, JsUtilsAjaxTrait;
29 29
 
30 30
 	protected $_di;
31 31
 	protected $js;
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 	protected function _setDi($di) {
56 56
 		$this->_di=$di;
57
-		if ($this->js!=null&&$di!=null)
57
+		if ($this->js!=null && $di!=null)
58 58
 			$this->js->setDi($di);
59 59
 	}
60 60
 
@@ -147,18 +147,18 @@  discard block
 block discarded – undo
147 147
 
148 148
 
149 149
 	public function __construct($params=array()) {
150
-		$defaults=array (
150
+		$defaults=array(
151 151
 				'driver' => 'Jquery',
152 152
 				'debug' => true
153 153
 		);
154
-		foreach ( $defaults as $key => $val ) {
155
-			if (isset($params[$key])&&$params[$key]!=="") {
154
+		foreach ($defaults as $key => $val) {
155
+			if (isset($params[$key]) && $params[$key]!=="") {
156 156
 				$defaults[$key]=$params[$key];
157 157
 			}
158 158
 		}
159 159
 		extract($defaults);
160 160
 		$this->js=new Jquery($defaults);
161
-		$this->cdns=array ();
161
+		$this->cdns=array();
162 162
 	}
163 163
 
164 164
 	public function addToCompile($jsScript) {
@@ -196,11 +196,11 @@  discard block
 block discarded – undo
196 196
 	 */
197 197
 	public function compile($view=NULL, $view_var='script_foot', $script_tags=TRUE) {
198 198
 		$bs=$this->_bootstrap;
199
-		if (isset($bs)&&isset($view)) {
199
+		if (isset($bs) && isset($view)) {
200 200
 			$bs->compileHtml($this, $view);
201 201
 		}
202 202
 		$sem=$this->_semantic;
203
-		if (isset($sem)&&isset($view)) {
203
+		if (isset($sem) && isset($view)) {
204 204
 			$sem->compileHtml($this, $view);
205 205
 		}
206 206
 		return $this->js->_compile($view, $view_var, $script_tags);
@@ -280,27 +280,27 @@  discard block
 block discarded – undo
280 280
 				$json_result=$result->result_array();
281 281
 			} elseif (is_array($result)) {
282 282
 				$json_result=$result;
283
-			} else {
283
+			}else {
284 284
 				return $this->_prep_args($result);
285 285
 			}
286
-		} else {
286
+		}else {
287 287
 			return 'null';
288 288
 		}
289 289
 		return $this->_create_json($json_result, $match_array_type);
290 290
 	}
291 291
 
292 292
 	private function _create_json($json_result, $match_array_type) {
293
-		$json=array ();
293
+		$json=array();
294 294
 		$_is_assoc=TRUE;
295
-		if (!is_array($json_result)&&empty($json_result)) {
295
+		if (!is_array($json_result) && empty($json_result)) {
296 296
 			show_error("Generate JSON Failed - Illegal key, value pair.");
297 297
 		} elseif ($match_array_type) {
298 298
 			$_is_assoc=$this->_is_associative_array($json_result);
299 299
 		}
300
-		foreach ( $json_result as $k => $v ) {
300
+		foreach ($json_result as $k => $v) {
301 301
 			if ($_is_assoc) {
302 302
 				$json[]=$this->_prep_args($k, TRUE).':'.$this->generate_json($v, $match_array_type);
303
-			} else {
303
+			}else {
304 304
 				$json[]=$this->generate_json($v, $match_array_type);
305 305
 			}
306 306
 		}
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 * @return type
316 316
 	 */
317 317
 	public function _is_associative_array($arr) {
318
-		foreach ( array_keys($arr) as $key => $val ) {
318
+		foreach (array_keys($arr) as $key => $val) {
319 319
 			if ($key!==$val) {
320 320
 				return TRUE;
321 321
 			}
@@ -334,11 +334,11 @@  discard block
 block discarded – undo
334 334
 			return 'null';
335 335
 		} elseif (is_bool($result)) {
336 336
 			return ($result===TRUE) ? 'true' : 'false';
337
-		} elseif (is_string($result)||$is_key) {
338
-			return '"'.str_replace(array (
339
-					'\\',"\t","\n","\r",'"','/'
340
-			), array (
341
-					'\\\\','\\t','\\n',"\\r",'\"','\/'
337
+		} elseif (is_string($result) || $is_key) {
338
+			return '"'.str_replace(array(
339
+					'\\', "\t", "\n", "\r", '"', '/'
340
+			), array(
341
+					'\\\\', '\\t', '\\n', "\\r", '\"', '\/'
342 342
 			), $result).'"';
343 343
 		} elseif (is_scalar($result)) {
344 344
 			return $result;
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 
352 352
 	public function setCDNs($cdns) {
353 353
 		if (is_array($cdns)===false) {
354
-			$cdns=array (
354
+			$cdns=array(
355 355
 					$cdns
356 356
 			);
357 357
 		}
@@ -363,9 +363,9 @@  discard block
 block discarded – undo
363 363
 		$hasJQueryUI=false;
364 364
 		$hasBootstrap=false;
365 365
 		$hasSemantic=false;
366
-		$result=array ();
367
-		foreach ( $this->cdns as $cdn ) {
368
-			switch(get_class($cdn)) {
366
+		$result=array();
367
+		foreach ($this->cdns as $cdn) {
368
+			switch (get_class($cdn)) {
369 369
 				case "Ajax\lib\CDNJQuery":
370 370
 					$hasJQuery=true;
371 371
 					$result[0]=$cdn;
@@ -375,11 +375,11 @@  discard block
 block discarded – undo
375 375
 					$result[1]=$cdn;
376 376
 					break;
377 377
 				case "Ajax\lib\CDNCoreCss":
378
-					if($cdn->getFramework()==="Bootstrap")
378
+					if ($cdn->getFramework()==="Bootstrap")
379 379
 						$hasBootstrap=true;
380
-					elseif($cdn->getFramework()==="Semantic")
380
+					elseif ($cdn->getFramework()==="Semantic")
381 381
 						$hasSemantic=true;
382
-					if($hasSemantic || $hasBootstrap)
382
+					if ($hasSemantic || $hasBootstrap)
383 383
 						$result[2]=$cdn;
384 384
 					break;
385 385
 			}
@@ -387,14 +387,14 @@  discard block
 block discarded – undo
387 387
 		if ($hasJQuery===false) {
388 388
 			$result[0]=new CDNJQuery("x");
389 389
 		}
390
-		if ($hasJQueryUI===false&&isset($this->_ui)) {
390
+		if ($hasJQueryUI===false && isset($this->_ui)) {
391 391
 			$result[1]=new CDNGuiGen("x", $template);
392 392
 		}
393
-		if ($hasBootstrap===false&&isset($this->_bootstrap)) {
394
-			$result[2]=new CDNCoreCss("Bootstrap","x");
393
+		if ($hasBootstrap===false && isset($this->_bootstrap)) {
394
+			$result[2]=new CDNCoreCss("Bootstrap", "x");
395 395
 		}
396
-		if ($hasSemantic===false&&isset($this->_semantic)) {
397
-			$result[2]=new CDNCoreCss("Semantic","x");
396
+		if ($hasSemantic===false && isset($this->_semantic)) {
397
+			$result[2]=new CDNCoreCss("Semantic", "x");
398 398
 		}
399 399
 		ksort($result);
400 400
 		return implode("\n", $result);
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 			$this->_setDi($di);
408 408
 		}
409 409
 	}
410
-} else {
410
+}else {
411 411
 	class JsUtils extends _JsUtils {
412 412
 
413 413
 		public function setDi(DiInterface $di) {
Please login to merge, or discard this patch.
Ajax/common/traits/JqueryAjaxTrait.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
 	protected $ajaxLoader='<span></span><span></span><span></span><span></span><span></span>';
10 10
 
11 11
 	public abstract function _prep_value($value);
12
-	public abstract function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true);
12
+	public abstract function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true);
13 13
 	protected function addLoading(&$retour, $responseElement) {
14 14
 		$loading_notifier='<div class="ajax-loader">';
15 15
 		if ($this->ajaxLoader=='') {
16 16
 			$loading_notifier.="Loading...";
17
-		} else {
17
+		}else {
18 18
 			$loading_notifier.=$this->ajaxLoader;
19 19
 		}
20 20
 		$loading_notifier.='</div>';
@@ -22,20 +22,20 @@  discard block
 block discarded – undo
22 22
 		$retour.="\t\t$({$responseElement}).prepend('{$loading_notifier}');\n";
23 23
 	}
24 24
 
25
-	public function _get($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
26
-		return $this->_ajax("get", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly);
25
+	public function _get($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
26
+		return $this->_ajax("get", $url, $params, $responseElement, $jsCallback, $attr, $hasLoader, $immediatly);
27 27
 	}
28
-	public function _post($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
29
-		return $this->_ajax("post", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly);
28
+	public function _post($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
29
+		return $this->_ajax("post", $url, $params, $responseElement, $jsCallback, $attr, $hasLoader, $immediatly);
30 30
 	}
31 31
 
32
-	protected function _ajax($method,$url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
33
-		if(JString::isNull($params)){$params="{}";}
32
+	protected function _ajax($method, $url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
33
+		if (JString::isNull($params)) {$params="{}"; }
34 34
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
35 35
 		$retour=$this->_getAjaxUrl($url, $attr);
36 36
 		$responseElement=$this->_getResponseElement($responseElement);
37 37
 		$retour.="var self=this;\n";
38
-		if($hasLoader===true){
38
+		if ($hasLoader===true) {
39 39
 			$this->addLoading($retour, $responseElement);
40 40
 		}
41 41
 		$retour.="$.".$method."(url,".$params.").done(function( data ) {\n";
@@ -45,22 +45,22 @@  discard block
 block discarded – undo
45 45
 			return $retour;
46 46
 	}
47 47
 
48
-	protected function _getAjaxUrl($url,$attr){
48
+	protected function _getAjaxUrl($url, $attr) {
49 49
 		$url=$this->_correctAjaxUrl($url);
50 50
 		$retour="url='".$url."';\n";
51 51
 		$slash="/";
52
-		if(PhalconUtils::endsWith($url, "/"))
52
+		if (PhalconUtils::endsWith($url, "/"))
53 53
 			$slash="";
54
-			if(JString::isNotNull($attr)){
54
+			if (JString::isNotNull($attr)) {
55 55
 				if ($attr=="value")
56 56
 					$retour.="url=url+'".$slash."'+$(this).val();\n";
57
-					else if($attr!=null && $attr!=="")
57
+					else if ($attr!=null && $attr!=="")
58 58
 						$retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n";
59 59
 			}
60 60
 			return $retour;
61 61
 	}
62 62
 
63
-	protected function _getOnAjaxDone($responseElement,$jsCallback){
63
+	protected function _getOnAjaxDone($responseElement, $jsCallback) {
64 64
 		$retour="";
65 65
 		if ($responseElement!=="") {
66 66
 			$retour="\t$({$responseElement}).html( data );\n";
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		return $retour;
70 70
 	}
71 71
 
72
-	protected function _getResponseElement($responseElement){
72
+	protected function _getResponseElement($responseElement) {
73 73
 		if ($responseElement!=="") {
74 74
 			$responseElement=$this->_prep_value($responseElement);
75 75
 		}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	protected function _correctAjaxUrl($url) {
80 80
 		if (PhalconUtils::endsWith($url, "/"))
81 81
 			$url=substr($url, 0, strlen($url)-1);
82
-			if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) {
82
+			if (strncmp($url, 'http://', 7)!=0 && strncmp($url, 'https://', 8)!=0) {
83 83
 				$url=$this->_di->get("url")->get($url);
84 84
 			}
85 85
 			return $url;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @param string $jsCallback javascript code to execute after the request
94 94
 	 * @param boolean $immediatly
95 95
 	 */
96
-	public function _json($url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context="document",$immediatly=false) {
96
+	public function _json($url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context="document", $immediatly=false) {
97 97
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
98 98
 		$retour=$this->_getAjaxUrl($url, $attr);
99 99
 		$retour.="$.{$method}(url,".$params.").done(function( data ) {\n";
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 * @param string $url the request address
115 115
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","immediatly"=>true)
116 116
 	 */
117
-	public function _jsonOn($event,$element, $url,$parameters=array()) {
117
+	public function _jsonOn($event, $element, $url, $parameters=array()) {
118 118
 		$preventDefault=true;
119 119
 		$stopPropagation=true;
120 120
 		$jsCallback=null;
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		$params="{}";
125 125
 		$immediatly=true;
126 126
 		extract($parameters);
127
-		return $this->_add_event($element, $this->_json($url,$method, $params,$jsCallback, $attr,$context), $event, $preventDefault, $stopPropagation,$immediatly);
127
+		return $this->_add_event($element, $this->_json($url, $method, $params, $jsCallback, $attr, $context), $event, $preventDefault, $stopPropagation, $immediatly);
128 128
 	}
129 129
 
130 130
 	/**
@@ -136,19 +136,19 @@  discard block
 block discarded – undo
136 136
 	 * @param string $context jquery DOM element, array container.
137 137
 	 * @param boolean $immediatly
138 138
 	 */
139
-	public function _jsonArray($maskSelector, $url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context=null,$immediatly=false) {
139
+	public function _jsonArray($maskSelector, $url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context=null, $immediatly=false) {
140 140
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
141 141
 		$retour=$this->_getAjaxUrl($url, $attr);
142
-		if($context===null){
142
+		if ($context===null) {
143 143
 			$appendTo="\t\tnewElm.appendTo($('".$maskSelector."').parent());\n";
144
-			$newElm = "$('#'+newId)";
145
-		}else{
144
+			$newElm="$('#'+newId)";
145
+		}else {
146 146
 			$appendTo="\t\tnewElm.appendTo(".$context.");\n";
147
-			$newElm = $context.".find('#'+newId)";
147
+			$newElm=$context.".find('#'+newId)";
148 148
 		}
149 149
 		$retour.="var self = $(this);\n$.{$method}(url,".$params.").done(function( data ) {\n";
150 150
 		$retour.="\tdata=$.parseJSON(data);$.each(data, function(index, value) {\n"."\tvar created=false;var maskElm=$('".$maskSelector."').first();maskElm.hide();"."\tvar newId=(maskElm.attr('id') || 'mask')+'-'+index;"."\tvar newElm=".$newElm.";\n"."\tif(!newElm.length){\n"."\t\tnewElm=maskElm.clone();newElm.attr('id',newId);\n";
151
-		$retour.= $appendTo;
151
+		$retour.=$appendTo;
152 152
 		$retour.="\t}\n"."\tfor(var key in value){\n"."\t\t\tvar html = $('<div />').append($(newElm).clone()).html();\n"."\t\t\tif(html.indexOf('[['+key+']]')>-1){\n"."\t\t\t\tcontent=$(html.split('[['+key+']]').join(value[key]));\n"."\t\t\t\t$(newElm).replaceWith(content);newElm=content;\n"."\t\t\t}\n"."\t\tvar sel='[data-id=\"'+key+'\"]';if($(sel,newElm).length){\n"."\t\t\tvar selElm=$(sel,newElm);\n"."\t\t\t if(selElm.is('[value]')) { selElm.attr('value',value[key]);selElm.val(value[key]);} else { selElm.html(value[key]); }\n"."\t\t}\n"."}\n"."\t$(newElm).show(true);"."\n"."\t$(newElm).removeClass('hide');"."});\n";
153 153
 		$retour.="\t$(document).trigger('jsonReady',[data]);\n";
154 154
 		$retour.="\t".$jsCallback."\n"."});\n";
@@ -163,26 +163,26 @@  discard block
 block discarded – undo
163 163
 	 * @param string $url the request address
164 164
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get", "context"=>null)
165 165
 	 */
166
-	public function _jsonArrayOn($event,$element, $maskSelector,$url,$parameters=array()) {
166
+	public function _jsonArrayOn($event, $element, $maskSelector, $url, $parameters=array()) {
167 167
 		$preventDefault=true;
168 168
 		$stopPropagation=true;
169 169
 		$jsCallback=null;
170 170
 		$attr="id";
171 171
 		$method="get";
172
-		$context = null;
172
+		$context=null;
173 173
 		$params="{}";
174 174
 		$immediatly=true;
175 175
 		extract($parameters);
176
-		return $this->_add_event($element, $this->_jsonArray($maskSelector,$url,$method, $params,$jsCallback, $attr, $context), $event, $preventDefault, $stopPropagation,$immediatly);
176
+		return $this->_add_event($element, $this->_jsonArray($maskSelector, $url, $method, $params, $jsCallback, $attr, $context), $event, $preventDefault, $stopPropagation, $immediatly);
177 177
 	}
178 178
 
179
-	public function _postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) {
179
+	public function _postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true, $immediatly=false) {
180 180
 		$jsCallback=isset($jsCallback) ? $jsCallback : "";
181 181
 		$retour=$this->_getAjaxUrl($url, $attr);
182 182
 		$retour.="\nvar params=$('#".$form."').serialize();\n";
183 183
 		$responseElement=$this->_getResponseElement($responseElement);
184 184
 		$retour.="var self=this;\n";
185
-		if($hasLoader===true){
185
+		if ($hasLoader===true) {
186 186
 			$this->addLoading($retour, $responseElement);
187 187
 		}
188 188
 		$retour.="$.post(url,params).done(function( data ) {\n";
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 * @param string $responseElement
210 210
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true)
211 211
 	 */
212
-	public function _getOn($event,$element, $url, $params="{}", $responseElement="", $parameters=array()) {
212
+	public function _getOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) {
213 213
 		$preventDefault=true;
214 214
 		$stopPropagation=true;
215 215
 		$jsCallback=null;
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		$hasLoader=true;
218 218
 		$immediatly=true;
219 219
 		extract($parameters);
220
-		return $this->_add_event($element, $this->_get($url, $params, $responseElement, $jsCallback, $attr,$hasLoader), $event, $preventDefault, $stopPropagation,$immediatly);
220
+		return $this->_add_event($element, $this->_get($url, $params, $responseElement, $jsCallback, $attr, $hasLoader), $event, $preventDefault, $stopPropagation, $immediatly);
221 221
 	}
222 222
 
223 223
 	/**
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 	 * @param string $responseElement
231 231
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true)
232 232
 	 */
233
-	public function _postOn($event,$element, $url, $params="{}", $responseElement="", $parameters=array()) {
233
+	public function _postOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) {
234 234
 		$preventDefault=true;
235 235
 		$stopPropagation=true;
236 236
 		$jsCallback=null;
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 		$hasLoader=true;
239 239
 		$immediatly=true;
240 240
 		extract($parameters);
241
-		return $this->_add_event($element, $this->_post($url, $params, $responseElement, $jsCallback, $attr,$hasLoader), $event, $preventDefault, $stopPropagation,$immediatly);
241
+		return $this->_add_event($element, $this->_post($url, $params, $responseElement, $jsCallback, $attr, $hasLoader), $event, $preventDefault, $stopPropagation, $immediatly);
242 242
 	}
243 243
 
244 244
 	/**
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	 * @param string $responseElement
252 252
 	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"immediatly"=>true)
253 253
 	 */
254
-	public function _postFormOn($event,$element, $url, $form, $responseElement="", $parameters=array()) {
254
+	public function _postFormOn($event, $element, $url, $form, $responseElement="", $parameters=array()) {
255 255
 		$preventDefault=true;
256 256
 		$stopPropagation=true;
257 257
 		$validation=false;
@@ -260,6 +260,6 @@  discard block
 block discarded – undo
260 260
 		$hasLoader=true;
261 261
 		$immediatly=true;
262 262
 		extract($parameters);
263
-		return $this->_add_event($element, $this->_postForm($url, $form, $responseElement, $validation, $jsCallback, $attr,$hasLoader), $event, $preventDefault, $stopPropagation,$immediatly);
263
+		return $this->_add_event($element, $this->_postForm($url, $form, $responseElement, $validation, $jsCallback, $attr, $hasLoader), $event, $preventDefault, $stopPropagation, $immediatly);
264 264
 	}
265 265
 }
266 266
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/common/traits/JqueryEventsTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 trait JqueryEventsTrait {
6 6
 	public abstract function _prep_element($element);
7
-	public abstract function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true);
7
+	public abstract function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true);
8 8
 
9 9
 	/**
10 10
 	 * Blur
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public function _click($element='this', $js=array(), $ret_false=TRUE) {
48 48
 		if (!is_array($js)) {
49
-			$js=array (
49
+			$js=array(
50 50
 					$js
51 51
 			);
52 52
 		}
Please login to merge, or discard this patch.
Ajax/Jquery.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -17,21 +17,21 @@  discard block
 block discarded – undo
17 17
  * jQuery Class
18 18
  */
19 19
 class Jquery {
20
-	use JqueryEventsTrait,JqueryAjaxTrait,JqueryActionsTrait;
20
+	use JqueryEventsTrait, JqueryAjaxTrait, JqueryActionsTrait;
21 21
 	protected $_di;
22 22
 	protected $_ui;
23 23
 	protected $_bootstrap;
24 24
 	protected $_semantic;
25 25
 	protected $libraryFile;
26 26
 	protected $_javascript_folder='js';
27
-	protected $jquery_code_for_load=array ();
28
-	protected $jquery_code_for_compile=array ();
27
+	protected $jquery_code_for_load=array();
28
+	protected $jquery_code_for_compile=array();
29 29
 	protected $jquery_corner_active=FALSE;
30 30
 	protected $jquery_table_sorter_active=FALSE;
31 31
 	protected $jquery_table_sorter_pager_active=FALSE;
32 32
 
33
-	protected $jquery_events=array (
34
-			"bind","blur","change","click","dblclick","delegate","die","error","focus","focusin","focusout","hover","keydown","keypress","keyup","live","load","mousedown","mousseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","off","on","one","ready","resize","scroll","select","submit","toggle","trigger","triggerHandler","undind","undelegate","unload"
33
+	protected $jquery_events=array(
34
+			"bind", "blur", "change", "click", "dblclick", "delegate", "die", "error", "focus", "focusin", "focusout", "hover", "keydown", "keypress", "keyup", "live", "load", "mousedown", "mousseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "off", "on", "one", "ready", "resize", "scroll", "select", "submit", "toggle", "trigger", "triggerHandler", "undind", "undelegate", "unload"
35 35
 	);
36 36
 
37 37
 	public function setDi($di) {
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 	public function __construct($params) {
63 63
 		$this->params=array();
64
-		foreach ( $params as $key => $val ) {
64
+		foreach ($params as $key => $val) {
65 65
 				$this->params[$key]=$params[$key];
66 66
 		}
67 67
 	}
@@ -135,12 +135,12 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	public function _output($array_js='') {
137 137
 		if (!is_array($array_js)) {
138
-			$array_js=array (
138
+			$array_js=array(
139 139
 					$array_js
140 140
 			);
141 141
 		}
142 142
 
143
-		foreach ( $array_js as $js ) {
143
+		foreach ($array_js as $js) {
144 144
 			$this->jquery_code_for_compile[]="\t$js\n";
145 145
 		}
146 146
 	}
@@ -152,12 +152,12 @@  discard block
 block discarded – undo
152 152
 	 * @param string $param
153 153
 	 * @param boolean $immediatly delayed if false
154 154
 	 */
155
-	public function _genericCallValue($jQueryCall,$element='this', $param="", $immediatly=false) {
155
+	public function _genericCallValue($jQueryCall, $element='this', $param="", $immediatly=false) {
156 156
 		$element=$this->_prep_element($element);
157 157
 		if (isset($param)) {
158 158
 			$param=$this->_prep_value($param);
159 159
 			$str="$({$element}).{$jQueryCall}({$param});";
160
-		} else
160
+		}else
161 161
 			$str="$({$element}).{$jQueryCall}();";
162 162
 			if ($immediatly)
163 163
 				$this->jquery_code_for_compile[]=$str;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 * @param boolean $immediatly delayed if false
172 172
 	 * @return string
173 173
 	 */
174
-	public function _genericCallElement($jQueryCall,$to='this', $element, $immediatly=false) {
174
+	public function _genericCallElement($jQueryCall, $to='this', $element, $immediatly=false) {
175 175
 		$to=$this->_prep_element($to);
176 176
 		$element=$this->_prep_element($element);
177 177
 		$str="$({$to}).{$jQueryCall}({$element});";
@@ -189,12 +189,12 @@  discard block
 block discarded – undo
189 189
 	 */
190 190
 	public function sortable($element, $options=array()) {
191 191
 		if (count($options)>0) {
192
-			$sort_options=array ();
193
-			foreach ( $options as $k => $v ) {
192
+			$sort_options=array();
193
+			foreach ($options as $k => $v) {
194 194
 				$sort_options[]="\n\t\t".$k.': '.$v."";
195 195
 			}
196 196
 			$sort_options=implode(",", $sort_options);
197
-		} else {
197
+		}else {
198 198
 			$sort_options='';
199 199
 		}
200 200
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	 * @param boolean $stopPropagation Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
223 223
 	 * @return string
224 224
 	 */
225
-	public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true) {
225
+	public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true) {
226 226
 		if (is_array($js)) {
227 227
 			$js=implode("\n\t\t", $js);
228 228
 		}
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 			$event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
237 237
 		else
238 238
 			$event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
239
-		if($immediatly)
239
+		if ($immediatly)
240 240
 			$this->jquery_code_for_compile[]=$event;
241 241
 		return $event;
242 242
 	}
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 
277 277
 		// External references
278 278
 		$external_scripts=implode('', $this->jquery_code_for_load);
279
-		extract(array (
279
+		extract(array(
280 280
 				'library_src' => $external_scripts
281 281
 		));
282 282
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 		$script.='});';
292 292
 
293 293
 		$this->jquery_code_for_compile=array();
294
-		if($this->params["debug"]==false){
294
+		if ($this->params["debug"]==false) {
295 295
 			$script=$this->minify($script);
296 296
 		}
297 297
 		$output=($script_tags===FALSE) ? $script : $this->inline($script);
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 	 * @return void
312 312
 	 */
313 313
 	public function _clear_compile() {
314
-		$this->jquery_code_for_compile=array ();
314
+		$this->jquery_code_for_compile=array();
315 315
 	}
316 316
 
317 317
 	/**
@@ -320,12 +320,12 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	public function _document_ready($js) {
322 322
 		if (!is_array($js)) {
323
-			$js=array (
323
+			$js=array(
324 324
 					$js
325 325
 			);
326 326
 		}
327 327
 
328
-		foreach ( $js as $script ) {
328
+		foreach ($js as $script) {
329 329
 			$this->jquery_code_for_compile[]=$script;
330 330
 		}
331 331
 	}
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 	 * @return string
340 340
 	 */
341 341
 	public function _prep_element($element) {
342
-		if (strrpos($element, 'this')===false&&strrpos($element, 'event')===false&&strrpos($element, 'self')===false) {
342
+		if (strrpos($element, 'this')===false && strrpos($element, 'event')===false && strrpos($element, 'self')===false) {
343 343
 			$element='"'.addslashes($element).'"';
344 344
 		}
345 345
 		return $element;
@@ -357,14 +357,14 @@  discard block
 block discarded – undo
357 357
 		if (is_array($value)) {
358 358
 			$value=implode(",", $value);
359 359
 		}
360
-		if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false&&strrpos($value, 'self')===false) {
360
+		if (strrpos($value, 'this')===false && strrpos($value, 'event')===false && strrpos($value, 'self')===false) {
361 361
 			$value='"'.$value.'"';
362 362
 		}
363 363
 		return $value;
364 364
 	}
365 365
 
366 366
 	private function minify($input) {
367
-	if(trim($input) === "") return $input;
367
+	if (trim($input)==="") return $input;
368 368
 	return preg_replace(
369 369
 			array(
370 370
 					// Remove comment(s)
Please login to merge, or discard this patch.