Completed
Push — master ( 8e32f8...32ad89 )
by Jean-Christophe
03:26
created
Ajax/semantic/html/content/HtmlListItem.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 class HtmlListItem extends HtmlSemDoubleElement {
9 9
 	protected $image;
10
-	public function __construct($identifier,$content) {
10
+	public function __construct($identifier, $content) {
11 11
 		parent::__construct($identifier, "div", "item");
12 12
 		$this->_template='<%tagName% id="%identifier%" %properties%>%image%%content%</%tagName%>';
13 13
 		$this->content=$content;
14 14
 	}
15
-	public function addIcon($icon){
15
+	public function addIcon($icon) {
16 16
 		$content=$this->content;
17
-		$this->content=new HtmlSemDoubleElement("content-".$this->identifier,"div","content");
17
+		$this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
18 18
 		$this->content->setContent($content);
19
-		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon),true);
19
+		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon), true);
20 20
 	}
21 21
 }
22 22
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/Variation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,5 +5,5 @@
 block discarded – undo
5 5
 use Ajax\common\BaseEnum;
6 6
 
7 7
 abstract class Variation extends BaseEnum {
8
-	const ANIMATED="animated",AVATAR="avatar",COMPACT="compact",FLUID="fluid",INVERTED="inverted",PADDED="padded",TRANSPARENT="transparent";
8
+	const ANIMATED="animated", AVATAR="avatar", COMPACT="compact", FLUID="fluid", INVERTED="inverted", PADDED="padded", TRANSPARENT="transparent";
9 9
 }
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlList.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,22 +5,22 @@
 block discarded – undo
5 5
 use Ajax\semantic\html\base\HtmlSemCollection;
6 6
 use Ajax\semantic\html\content\HtmlListItem;
7 7
 
8
-class HtmlList extends HtmlSemCollection{
8
+class HtmlList extends HtmlSemCollection {
9 9
 
10 10
 
11
-	public function __construct( $identifier, $items=array()){
12
-		parent::__construct( $identifier, "div", "ui list");
11
+	public function __construct($identifier, $items=array()) {
12
+		parent::__construct($identifier, "div", "ui list");
13 13
 		$this->addItems($items);
14 14
 	}
15 15
 
16 16
 
17
-	protected function createItem($value){
17
+	protected function createItem($value) {
18 18
 		$count=$this->count();
19
-		if(\is_array($value)){
19
+		if (\is_array($value)) {
20 20
 			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]);
21 21
 			$item->addIcon($value[1]);
22 22
 		}else
23
-			$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
23
+			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value);
24 24
 		return $item;
25 25
 	}
26 26
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,9 @@
 block discarded – undo
19 19
 		if(\is_array($value)){
20 20
 			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]);
21 21
 			$item->addIcon($value[1]);
22
-		}else
23
-			$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
22
+		} else {
23
+					$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
24
+		}
24 25
 		return $item;
25 26
 	}
26 27
 
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDropdown.php 2 patches
Braces   +28 added lines, -20 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		$itemO=$item;
35 35
 		if(\is_object($item)===false){
36 36
 			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image);
37
-		}elseif($itemO instanceof HtmlDropdownItem){
37
+		} elseif($itemO instanceof HtmlDropdownItem){
38 38
 			$this->addToProperty("class", "vertical");
39 39
 		}
40 40
 		$this->items[]=$itemO;
@@ -42,8 +42,9 @@  discard block
 block discarded – undo
42 42
 	}
43 43
 
44 44
 	public function addInput($name){
45
-		if(!isset($name))
46
-			$name="input-".$this->identifier;
45
+		if(!isset($name)) {
46
+					$name="input-".$this->identifier;
47
+		}
47 48
 		$this->setAction("activate");
48 49
 		$this->input=new HtmlInput($name,"hidden");
49 50
 	}
@@ -53,7 +54,7 @@  discard block
 block discarded – undo
53 54
 			foreach ($items as $k=>$v){
54 55
 				$this->addItem($v)->setData($k);
55 56
 			}
56
-		}else{
57
+		} else{
57 58
 			foreach ($items as $item){
58 59
 				$this->addItem($item);
59 60
 			}
@@ -67,7 +68,7 @@  discard block
 block discarded – undo
67 68
 		if($dropdown===false){
68 69
 			$this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php';
69 70
 			$dropdown="menu";
70
-		}else{
71
+		} else{
71 72
 			$dropdown="dropdown";
72 73
 			$this->mClass="menu";
73 74
 		}
@@ -83,18 +84,22 @@  discard block
 block discarded – undo
83 84
 	}
84 85
 
85 86
 	public function asButton($floating=false){
86
-		if($floating)
87
-			$this->addToProperty("class", "floating");
87
+		if($floating) {
88
+					$this->addToProperty("class", "floating");
89
+		}
88 90
 		return $this->addToProperty("class", "button");
89 91
 	}
90 92
 
91 93
 	public function asSelect($name=NULL,$multiple=false,$selection=true){
92
-		if(isset($name))
93
-			$this->addInput($name);
94
-		if($multiple)
95
-			$this->addToProperty("class", "multiple");
96
-		if ($selection)
97
-			$this->addToPropertyCtrl("class", "selection",array("selection"));
94
+		if(isset($name)) {
95
+					$this->addInput($name);
96
+		}
97
+		if($multiple) {
98
+					$this->addToProperty("class", "multiple");
99
+		}
100
+		if ($selection) {
101
+					$this->addToPropertyCtrl("class", "selection",array("selection"));
102
+		}
98 103
 		return $this;
99 104
 	}
100 105
 
@@ -104,8 +109,9 @@  discard block
 block discarded – undo
104 109
 	}
105 110
 
106 111
 	public function setSelect($name=NULL,$multiple=false){
107
-		if(!isset($name))
108
-			$name="select-".$this->identifier;
112
+		if(!isset($name)) {
113
+					$name="select-".$this->identifier;
114
+		}
109 115
 		$this->input=null;
110 116
 		if($multiple){
111 117
 			$this->setProperty("multiple", true);
@@ -136,12 +142,13 @@  discard block
 block discarded – undo
136 142
 	public function setValue($value){
137 143
 		if(isset($this->input)){
138 144
 			$this->input->setProperty("value", $value);
139
-		}else{
145
+		} else{
140 146
 			$this->setProperty("value", $value);
141 147
 		}
142 148
 		$textElement=$this->getElementById("text-".$this->identifier, $this->content);
143
-		if(isset($textElement))
144
-			$textElement->setContent($value);
149
+		if(isset($textElement)) {
150
+					$textElement->setContent($value);
151
+		}
145 152
 		return $this;
146 153
 	}
147 154
 
@@ -151,8 +158,9 @@  discard block
 block discarded – undo
151 158
 	 */
152 159
 	public function run(JsUtils $js) {
153 160
 		if($this->propertyContains("class", "simple")===false){
154
-			if(isset($this->_bsComponent)===false)
155
-				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->params);
161
+			if(isset($this->_bsComponent)===false) {
162
+							$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->params);
163
+			}
156 164
 			$this->addEventsOnRun($js);
157 165
 			return $this->_bsComponent;
158 166
 		}
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -17,31 +17,31 @@  discard block
 block discarded – undo
17 17
 	}
18 18
 	protected $mClass="menu";
19 19
 	protected $mTagName="div";
20
-	protected $items=array ();
21
-	protected $params=array("action"=>"nothing","on"=>"hover");
20
+	protected $items=array();
21
+	protected $params=array("action"=>"nothing", "on"=>"hover");
22 22
 	protected $input;
23 23
 
24 24
 	public function __construct($identifier, $value="", $items=array()) {
25 25
 		parent::__construct($identifier, "div");
26 26
 		$this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php';
27 27
 		$this->setProperty("class", "ui dropdown");
28
-		$content=new HtmlSemDoubleElement("text-".$this->identifier,"div");
28
+		$content=new HtmlSemDoubleElement("text-".$this->identifier, "div");
29 29
 		$content->setClass("text");
30 30
 		$content->setContent($value);
31
-		$content->wrap("",new HtmlIcon("", "dropdown"));
31
+		$content->wrap("", new HtmlIcon("", "dropdown"));
32 32
 		$this->content=array($content);
33 33
 		$this->tagName="div";
34 34
 		$this->addItems($items);
35 35
 	}
36 36
 
37
-	public function addItem($item,$value=NULL,$image=NULL){
38
-		$itemO=$this->beforeAddItem($item,$value,$image);
37
+	public function addItem($item, $value=NULL, $image=NULL) {
38
+		$itemO=$this->beforeAddItem($item, $value, $image);
39 39
 		$this->items[]=$itemO;
40 40
 		return $itemO;
41 41
 	}
42 42
 
43
-	public function addIcon($icon,$before=true,$labeled=false){
44
-		$this->addIconP($icon,$before,$labeled);
43
+	public function addIcon($icon, $before=true, $labeled=false) {
44
+		$this->addIconP($icon, $before, $labeled);
45 45
 		return $this->getElementById("text-".$this->identifier, $this->content)->setWrapAfter("");
46 46
 	}
47 47
 	/**
@@ -50,20 +50,20 @@  discard block
 block discarded – undo
50 50
 	 * @param number $position
51 51
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown
52 52
 	 */
53
-	public function insertItem($item,$position=0){
53
+	public function insertItem($item, $position=0) {
54 54
 		$itemO=$this->beforeAddItem($item);
55
-		 $start = array_slice($this->items, 0, $position);
56
-		 $end = array_slice($this->items, $position);
57
-		 $start[] = $item;
55
+		 $start=array_slice($this->items, 0, $position);
56
+		 $end=array_slice($this->items, $position);
57
+		 $start[]=$item;
58 58
 		 $this->items=array_merge($start, $end);
59 59
 		 return $itemO;
60 60
 	}
61 61
 
62
-	protected function beforeAddItem($item,$value=NULL,$image=NULL){
62
+	protected function beforeAddItem($item, $value=NULL, $image=NULL) {
63 63
 		$itemO=$item;
64
-		if(!$item instanceof HtmlDropdownItem){
65
-			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image);
66
-		}elseif($itemO instanceof HtmlDropdownItem){
64
+		if (!$item instanceof HtmlDropdownItem) {
65
+			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items), $item, $value, $image);
66
+		}elseif ($itemO instanceof HtmlDropdownItem) {
67 67
 			$this->addToProperty("class", "vertical");
68 68
 		}
69 69
 		return $itemO;
@@ -76,76 +76,76 @@  discard block
 block discarded – undo
76 76
 		$this->addItem($function($object));
77 77
 	}
78 78
 
79
-	public function addInput($name){
80
-		if(!isset($name))
79
+	public function addInput($name) {
80
+		if (!isset($name))
81 81
 			$name="input-".$this->identifier;
82 82
 		$this->setAction("activate");
83
-		$this->input=new HtmlInput($name,"hidden");
83
+		$this->input=new HtmlInput($name, "hidden");
84 84
 	}
85 85
 
86
-	public function addItems($items){
87
-		if(JArray::isAssociative($items)){
88
-			foreach ($items as $k=>$v){
86
+	public function addItems($items) {
87
+		if (JArray::isAssociative($items)) {
88
+			foreach ($items as $k=>$v) {
89 89
 				$this->addItem($v)->setData($k);
90 90
 			}
91
-		}else{
92
-			foreach ($items as $item){
91
+		}else {
92
+			foreach ($items as $item) {
93 93
 				$this->addItem($item);
94 94
 			}
95 95
 		}
96 96
 	}
97 97
 
98
-	public function count(){
98
+	public function count() {
99 99
 		return \sizeof($this->items);
100 100
 	}
101 101
 	/**
102 102
 	 * @param boolean $dropdown
103 103
 	 */
104
-	public function asDropdown($dropdown){
105
-		if($dropdown===false){
104
+	public function asDropdown($dropdown) {
105
+		if ($dropdown===false) {
106 106
 			$this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php';
107 107
 			$dropdown="menu";
108
-		}else{
108
+		}else {
109 109
 			$dropdown="dropdown";
110 110
 			$this->mClass="menu";
111 111
 		}
112
-		return $this->addToPropertyCtrl("class", $dropdown,array("menu","dropdown"));
112
+		return $this->addToPropertyCtrl("class", $dropdown, array("menu", "dropdown"));
113 113
 	}
114 114
 
115
-	public function setVertical(){
116
-		return $this->addToPropertyCtrl("class", "vertical",array("vertical"));
115
+	public function setVertical() {
116
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical"));
117 117
 	}
118 118
 
119
-	public function setSimple(){
120
-		return $this->addToPropertyCtrl("class", "simple",array("simple"));
119
+	public function setSimple() {
120
+		return $this->addToPropertyCtrl("class", "simple", array("simple"));
121 121
 	}
122 122
 
123
-	public function asButton($floating=false){
124
-		if($floating)
123
+	public function asButton($floating=false) {
124
+		if ($floating)
125 125
 			$this->addToProperty("class", "floating");
126 126
 		return $this->addToProperty("class", "button");
127 127
 	}
128 128
 
129
-	public function asSelect($name=NULL,$multiple=false,$selection=true){
130
-		if(isset($name))
129
+	public function asSelect($name=NULL, $multiple=false, $selection=true) {
130
+		if (isset($name))
131 131
 			$this->addInput($name);
132
-		if($multiple)
132
+		if ($multiple)
133 133
 			$this->addToProperty("class", "multiple");
134 134
 		if ($selection)
135
-			$this->addToPropertyCtrl("class", "selection",array("selection"));
135
+			$this->addToPropertyCtrl("class", "selection", array("selection"));
136 136
 		return $this;
137 137
 	}
138 138
 
139
-	public function asSearch($name=NULL,$multiple=false,$selection=false){
140
-		$this->asSelect($name,$multiple,$selection);
139
+	public function asSearch($name=NULL, $multiple=false, $selection=false) {
140
+		$this->asSelect($name, $multiple, $selection);
141 141
 		return $this->addToProperty("class", "search");
142 142
 	}
143 143
 
144
-	public function setSelect($name=NULL,$multiple=false){
145
-		if(!isset($name))
144
+	public function setSelect($name=NULL, $multiple=false) {
145
+		if (!isset($name))
146 146
 			$name="select-".$this->identifier;
147 147
 		$this->input=null;
148
-		if($multiple){
148
+		if ($multiple) {
149 149
 			$this->setProperty("multiple", true);
150 150
 			$this->addToProperty("class", "multiple");
151 151
 		}
@@ -153,32 +153,32 @@  discard block
 block discarded – undo
153 153
 		$this->tagName="select";
154 154
 		$this->setProperty("name", $name);
155 155
 		$this->content=null;
156
-		foreach ($this->items as $item){
156
+		foreach ($this->items as $item) {
157 157
 			$item->asOption();
158 158
 		}
159 159
 		return $this;
160 160
 	}
161 161
 
162
-	public function asSubmenu($pointing=NULL){
162
+	public function asSubmenu($pointing=NULL) {
163 163
 		$this->setClass("ui dropdown link item");
164
-		if(isset($pointing)){
164
+		if (isset($pointing)) {
165 165
 			$this->setPointing($pointing);
166 166
 		}
167 167
 		return $this;
168 168
 	}
169 169
 
170
-	public function setPointing($value=Direction::NONE){
171
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
170
+	public function setPointing($value=Direction::NONE) {
171
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
172 172
 	}
173 173
 
174
-	public function setValue($value){
175
-		if(isset($this->input)){
174
+	public function setValue($value) {
175
+		if (isset($this->input)) {
176 176
 			$this->input->setProperty("value", $value);
177
-		}else{
177
+		}else {
178 178
 			$this->setProperty("value", $value);
179 179
 		}
180 180
 		$textElement=$this->getElementById("text-".$this->identifier, $this->content);
181
-		if(isset($textElement))
181
+		if (isset($textElement))
182 182
 			$textElement->setContent($value);
183 183
 		return $this;
184 184
 	}
@@ -188,19 +188,19 @@  discard block
 block discarded – undo
188 188
 	 * @see BaseHtml::run()
189 189
 	 */
190 190
 	public function run(JsUtils $js) {
191
-		if($this->propertyContains("class", "simple")===false){
192
-			if(isset($this->_bsComponent)===false)
193
-				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->params);
191
+		if ($this->propertyContains("class", "simple")===false) {
192
+			if (isset($this->_bsComponent)===false)
193
+				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier, $this->params);
194 194
 			$this->addEventsOnRun($js);
195 195
 			return $this->_bsComponent;
196 196
 		}
197 197
 	}
198 198
 
199
-	public function setAction($action){
199
+	public function setAction($action) {
200 200
 		$this->params["action"]=$action;
201 201
 	}
202 202
 
203
-	public function setFullTextSearch($value){
203
+	public function setFullTextSearch($value) {
204 204
 		$this->params["fullTextSearch"]=$value;
205 205
 	}
206 206
 }
207 207
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlBreadcrumb.php 3 patches
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
 	 * Associate an ajax get to the breadcrumb elements, displayed in $targetSelector
56 56
 	 * $attr member is used to build each element url
57 57
 	 * @param string $targetSelector the target of the get
58
-	 * @param string $attr the html attribute used to build the elements url
59
-	 * @return HtmlBreadcrumbs
58
+	 * @return HtmlBreadcrumb
60 59
 	 */
61 60
 	public function autoGetOnClick($targetSelector){
62 61
 		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
@@ -118,7 +117,7 @@  discard block
 block discarded – undo
118 117
 	/**
119 118
 	 * sets the function who generates the href elements. default : function($element){return $element->getContent()}
120 119
 	 * @param function $_hrefFunction
121
-	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
120
+	 * @return HtmlBreadcrumb
122 121
 	 */
123 122
 	public function setHrefFunction($_hrefFunction) {
124 123
 		$this->_hrefFunction = $_hrefFunction;
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * @author jc
15 15
  * @version 1.001
16 16
  */
17
-class HtmlBreadcrumb extends HtmlSemNavElement{
17
+class HtmlBreadcrumb extends HtmlSemNavElement {
18 18
 	/**
19 19
 	 * @var integer the start index for href generation
20 20
 	 */
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 	 * @param boolean $autoActive sets the last element's class to <b>active</b> if true
41 41
 	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
42 42
 	 */
43
-	public function __construct( $identifier,$items=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){
44
-		parent::__construct( $identifier, "div", "ui breadcrumb");
43
+	public function __construct($identifier, $items=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) {
44
+		parent::__construct($identifier, "div", "ui breadcrumb");
45 45
 		$this->startIndex=$startIndex;
46 46
 		$this->autoActive=$autoActive;
47 47
 		$this->_contentSeparator="<div class='divider'> / </div>";
48
-		$this->_hrefFunction=function ($e){return $e->getContent();};
49
-		if(isset($hrefFunction)){
48
+		$this->_hrefFunction=function($e) {return $e->getContent(); };
49
+		if (isset($hrefFunction)) {
50 50
 			$this->_hrefFunction=$hrefFunction;
51 51
 		}
52 52
 		$this->addItems($items);
@@ -59,23 +59,23 @@  discard block
 block discarded – undo
59 59
 	 * @param string $attr the html attribute used to build the elements url
60 60
 	 * @return HtmlBreadcrumbs
61 61
 	 */
62
-	public function autoGetOnClick($targetSelector){
63
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
62
+	public function autoGetOnClick($targetSelector) {
63
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
64 64
 	}
65 65
 
66
-	public function contentAsString(){
67
-		if($this->autoActive){
66
+	public function contentAsString() {
67
+		if ($this->autoActive) {
68 68
 			$this->setActive();
69 69
 		}
70 70
 		return parent::contentAsString();
71 71
 	}
72 72
 
73
-	public function setActive($index=null){
74
-		if(!isset($index)){
73
+	public function setActive($index=null) {
74
+		if (!isset($index)) {
75 75
 			$index=sizeof($this->content)-1;
76 76
 		}
77 77
 		$activeItem=$this->content[$index];
78
-		$activeItem->addToProperty("class","active");
78
+		$activeItem->addToProperty("class", "active");
79 79
 		$activeItem->setTagName("div");
80 80
 	}
81 81
 
@@ -84,15 +84,15 @@  discard block
 block discarded – undo
84 84
 	 * @param Dispatcher $dispatcher the request dispatcher
85 85
 	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
86 86
 	 */
87
-	public function fromDispatcher($dispatcher,$startIndex=0){
87
+	public function fromDispatcher($dispatcher, $startIndex=0) {
88 88
 		$this->startIndex=$startIndex;
89 89
 		$params=$dispatcher->getParams();
90 90
 		$action=$dispatcher->getActionName();
91 91
 		$items=array($dispatcher->getControllerName());
92
-		if(\sizeof($params)>0 || \strtolower($action)!="index" ){
92
+		if (\sizeof($params)>0 || \strtolower($action)!="index") {
93 93
 			$items[]=$action;
94
-			foreach ($params as $p){
95
-				if(\is_object($p)===false)
94
+			foreach ($params as $p) {
95
+				if (\is_object($p)===false)
96 96
 					$items[]=$p;
97 97
 			}
98 98
 		}
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
 	 * @param string $separator
106 106
 	 * @return string
107 107
 	 */
108
-	public function getHref($index=null,$separator="/"){
109
-		if(!isset($index)){
108
+	public function getHref($index=null, $separator="/") {
109
+		if (!isset($index)) {
110 110
 			$index=sizeof($this->content);
111 111
 		}
112
-		if($this->absolutePaths===true){
112
+		if ($this->absolutePaths===true) {
113 113
 			return $this->_hrefFunction($this->content[$index]);
114
-		}else{
115
-			return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1));
114
+		}else {
115
+			return $this->root.implode($separator, array_slice(array_map(function($e) {return $this->_hrefFunction($e); }, $this->content), $this->startIndex, $index+1));
116 116
 		}
117 117
 	}
118 118
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
123 123
 	 */
124 124
 	public function setHrefFunction($_hrefFunction) {
125
-		$this->_hrefFunction = $_hrefFunction;
125
+		$this->_hrefFunction=$_hrefFunction;
126 126
 		return $this;
127 127
 	}
128 128
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	}
133 133
 
134 134
 	public function setAutoActive($autoActive) {
135
-		$this->autoActive = $autoActive;
135
+		$this->autoActive=$autoActive;
136 136
 		return $this;
137 137
 	}
138 138
 
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
 	 * @see \Ajax\bootstrap\html\BaseHtml::compile()
142 142
 	 */
143 143
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
144
-		if($this->autoActive){
144
+		if ($this->autoActive) {
145 145
 			$this->setActive();
146 146
 		}
147 147
 		$count=$this->count();
148
-		for($i=1;$i<$count;$i++){
148
+		for ($i=1; $i<$count; $i++) {
149 149
 			$this->content[$i]->wrap($this->getContentDivider($i-1));
150 150
 		}
151 151
 		return parent::compile($js, $view);
@@ -156,16 +156,16 @@  discard block
 block discarded – undo
156 156
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::on()
157 157
 	 */
158 158
 	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
159
-		foreach ($this->content as $element){
160
-				$element->on($event,$jsCode,$stopPropagation,$preventDefault);
159
+		foreach ($this->content as $element) {
160
+				$element->on($event, $jsCode, $stopPropagation, $preventDefault);
161 161
 		}
162 162
 		return $this;
163 163
 	}
164 164
 
165 165
 
166 166
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
167
-		foreach ($this->content as $element){
168
-			if($element->getProperty($this->attr)!=NULL)
167
+		foreach ($this->content as $element) {
168
+			if ($element->getProperty($this->attr)!=NULL)
169 169
 				$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
170 170
 		}
171 171
 		return $this;
@@ -177,35 +177,35 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	protected function createItem($value) {
179 179
 		$count=$this->count();
180
-		$itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count,"a","section");
181
-		if(\is_array($value))
180
+		$itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "a", "section");
181
+		if (\is_array($value))
182 182
 			$itemO->fromArray($value);
183
-		else{
183
+		else {
184 184
 			$itemO->setContent($value);
185 185
 			$itemO->setProperty($this->attr, $this->getHref($count));
186 186
 		}
187 187
 		return $itemO;
188 188
 	}
189 189
 
190
-	public function addIcon($icon,$index){
190
+	public function addIcon($icon, $index) {
191 191
 		$item=$this->getItem($index);
192
-		if(isset($item)){
192
+		if (isset($item)) {
193 193
 			$icon=new HtmlIcon("icon-".$this->identifier, $icon);
194 194
 			$item->wrapContent($icon);
195 195
 		}
196 196
 	}
197 197
 
198
-	public function addItem($item){
198
+	public function addItem($item) {
199 199
 		$itemO=parent::addItem($item);
200 200
 		$this->addToPropertyCtrl("class", "section", array("section"));
201 201
 		return $itemO;
202 202
 	}
203 203
 
204
-	public function asLinks(){
204
+	public function asLinks() {
205 205
 		$this->contentAs("a");
206 206
 	}
207 207
 
208
-	public function asTexts(){
208
+	public function asTexts() {
209 209
 		$this->contentAs("div");
210 210
 	}
211 211
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -92,8 +92,9 @@  discard block
 block discarded – undo
92 92
 		if(\sizeof($params)>0 || \strtolower($action)!="index" ){
93 93
 			$items[]=$action;
94 94
 			foreach ($params as $p){
95
-				if(\is_object($p)===false)
96
-					$items[]=$p;
95
+				if(\is_object($p)===false) {
96
+									$items[]=$p;
97
+				}
97 98
 			}
98 99
 		}
99 100
 		return $this->addItems($items);
@@ -111,7 +112,7 @@  discard block
 block discarded – undo
111 112
 		}
112 113
 		if($this->absolutePaths===true){
113 114
 			return $this->_hrefFunction($this->content[$index]);
114
-		}else{
115
+		} else{
115 116
 			return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1));
116 117
 		}
117 118
 	}
@@ -165,8 +166,9 @@  discard block
 block discarded – undo
165 166
 
166 167
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
167 168
 		foreach ($this->content as $element){
168
-			if($element->getProperty($this->attr)!=NULL)
169
-				$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
169
+			if($element->getProperty($this->attr)!=NULL) {
170
+							$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
171
+			}
170 172
 		}
171 173
 		return $this;
172 174
 	}
@@ -178,9 +180,9 @@  discard block
 block discarded – undo
178 180
 	protected function createItem($value) {
179 181
 		$count=$this->count();
180 182
 		$itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count,"a","section");
181
-		if(\is_array($value))
182
-			$itemO->fromArray($value);
183
-		else{
183
+		if(\is_array($value)) {
184
+					$itemO->fromArray($value);
185
+		} else{
184 186
 			$itemO->setContent($value);
185 187
 			$itemO->setProperty($this->attr, $this->getHref($count));
186 188
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlMenuItem.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 class HtmlListItem extends HtmlSemDoubleElement {
9 9
 	protected $image;
10
-	public function __construct($identifier,$content) {
10
+	public function __construct($identifier, $content) {
11 11
 		parent::__construct($identifier, "div", "item");
12 12
 		$this->_template='<%tagName% id="%identifier%" %properties%>%image%%content%</%tagName%>';
13 13
 		$this->content=$content;
14 14
 	}
15
-	public function addIcon($icon){
15
+	public function addIcon($icon) {
16 16
 		$content=$this->content;
17
-		$this->content=new HtmlSemDoubleElement("content-".$this->identifier,"div","content");
17
+		$this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
18 18
 		$this->content->setContent($content);
19
-		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon),true);
19
+		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon), true);
20 20
 	}
21 21
 }
22 22
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlSegmentGroups.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,20 +6,20 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\base\HtmlSemCollection;
7 7
 use Ajax\semantic\html\base\constants\Sens;
8 8
 
9
-class HtmlSegmentGroups extends HtmlSemCollection{
9
+class HtmlSegmentGroups extends HtmlSemCollection {
10 10
 
11 11
 
12
-	public function __construct( $identifier, $items=array()){
13
-		parent::__construct( $identifier, "div","ui segments");
12
+	public function __construct($identifier, $items=array()) {
13
+		parent::__construct($identifier, "div", "ui segments");
14 14
 		$this->addItems($items);
15 15
 	}
16 16
 
17 17
 
18
-	protected function createItem($value){
19
-		return new HtmlSegment("segment-".$this->count(),$value);
18
+	protected function createItem($value) {
19
+		return new HtmlSegment("segment-".$this->count(), $value);
20 20
 	}
21 21
 
22
-	protected function createCondition($value){
22
+	protected function createCondition($value) {
23 23
 		return !($value instanceof HtmlSegment);
24 24
 	}
25 25
 
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 	 * @param string $type one of "raised","stacked","piled" default : ""
29 29
 	 * @return \Ajax\semantic\html\elements\HtmlSegmentGroups
30 30
 	 */
31
-	public function setType($type){
31
+	public function setType($type) {
32 32
 		return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants());
33 33
 	}
34 34
 
35
-	public function setSens($sens=Sens::VERTICAL){
35
+	public function setSens($sens=Sens::VERTICAL) {
36 36
 		return $this->addToPropertyCtrl("class", $sens, Sens::getConstants());
37 37
 	}
38 38
 
39
-	public static function group($identifier,$items=array(),$type="",$sens=Sens::VERTICAL){
40
-		$group=new HtmlSegmentGroups($identifier,$items);
39
+	public static function group($identifier, $items=array(), $type="", $sens=Sens::VERTICAL) {
40
+		$group=new HtmlSegmentGroups($identifier, $items);
41 41
 		$group->setSens($sens);
42 42
 		return $group->setType($type);
43 43
 	}
Please login to merge, or discard this patch.
Ajax/common/html/BaseHtml.php 3 patches
Doc Comments   +35 added lines patch added patch discarded remove patch
@@ -108,6 +108,10 @@  discard block
 block discarded – undo
108 108
 		return true;
109 109
 	}
110 110
 
111
+	/**
112
+	 * @param string $propertyName
113
+	 * @param string $value
114
+	 */
111 115
 	protected function propertyContains($propertyName,$value){
112 116
 		$values=$this->getProperty($propertyName);
113 117
 		if(isset($values)){
@@ -142,12 +146,19 @@  discard block
 block discarded – undo
142 146
 		return $this;
143 147
 	}
144 148
 
149
+	/**
150
+	 * @param string $name
151
+	 */
145 152
 	protected function removeProperty($name){
146 153
 		if(\array_key_exists($name, $this->properties))
147 154
 			unset($this->properties[$name]);
148 155
 		return $this;
149 156
 	}
150 157
 
158
+	/**
159
+	 * @param string $name
160
+	 * @param string[] $typeCtrl
161
+	 */
151 162
 	protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") {
152 163
 		if ($this->ctrl($name, $value, $typeCtrl)===true) {
153 164
 			if (is_array($typeCtrl)) {
@@ -172,6 +183,9 @@  discard block
 block discarded – undo
172 183
 		return $this->addToProperty($name, $value);
173 184
 	}
174 185
 
186
+	/**
187
+	 * @param string $name
188
+	 */
175 189
 	public function addToPropertyCtrl($name, $value, $typeCtrl) {
176 190
 		// if($this->ctrl($name, $value, $typeCtrl)===true){
177 191
 		return $this->addToPropertyUnique($name, $value, $typeCtrl);
@@ -239,6 +253,9 @@  discard block
 block discarded – undo
239 253
 
240 254
 	}
241 255
 
256
+	/**
257
+	 * @param string $before
258
+	 */
242 259
 	public function wrap($before, $after="") {
243 260
 		if(isset($before)){
244 261
 			$this->wrapBefore.=$before;
@@ -307,6 +324,9 @@  discard block
 block discarded – undo
307 324
 		}
308 325
 	}
309 326
 
327
+	/**
328
+	 * @param string $operation
329
+	 */
310 330
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
311 331
 		$params=array (
312 332
 				"url" => $url,
@@ -317,14 +337,23 @@  discard block
 block discarded – undo
317 337
 		return $this;
318 338
 	}
319 339
 
340
+	/**
341
+	 * @param string $event
342
+	 */
320 343
 	public function getOn($event, $url, $responseElement="", $parameters=array()) {
321 344
 		return $this->_ajaxOn("get", $event, $url, $responseElement, $parameters);
322 345
 	}
323 346
 
347
+	/**
348
+	 * @param string $url
349
+	 */
324 350
 	public function getOnClick($url, $responseElement="", $parameters=array()) {
325 351
 		return $this->getOn("click", $url, $responseElement, $parameters);
326 352
 	}
327 353
 
354
+	/**
355
+	 * @param string $event
356
+	 */
328 357
 	public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) {
329 358
 		$parameters ["params"]=$params;
330 359
 		return $this->_ajaxOn("post", $event, $url, $responseElement, $parameters);
@@ -334,6 +363,9 @@  discard block
 block discarded – undo
334 363
 		return $this->postOn("click", $url, $params, $responseElement, $parameters);
335 364
 	}
336 365
 
366
+	/**
367
+	 * @param string $event
368
+	 */
337 369
 	public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) {
338 370
 		$parameters ["form"]=$form;
339 371
 		return $this->_ajaxOn("postForm", $event, $url, $responseElement, $parameters);
@@ -383,6 +415,9 @@  discard block
 block discarded – undo
383 415
 		return $value;
384 416
 	}
385 417
 
418
+	/**
419
+	 * @param string $jqueryCall
420
+	 */
386 421
 	public function jsDoJquery($jqueryCall, $param=""){
387 422
 		return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");";
388 423
 	}
Please login to merge, or discard this patch.
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -50,16 +50,18 @@  discard block
 block discarded – undo
50 50
 	}
51 51
 
52 52
 	public function getProperty($name) {
53
-		if (array_key_exists($name, $this->properties))
54
-			return $this->properties [$name];
53
+		if (array_key_exists($name, $this->properties)) {
54
+					return $this->properties [$name];
55
+		}
55 56
 	}
56 57
 
57 58
 	public function addToProperty($name, $value, $separator=" ") {
58 59
 		$v=@$this->properties[$name];
59
-		if (isset($v)&&$v!=="")
60
-			$v=$v.$separator.$value;
61
-		else
62
-			$v=$value;
60
+		if (isset($v)&&$v!=="") {
61
+					$v=$v.$separator.$value;
62
+		} else {
63
+					$v=$value;
64
+		}
63 65
 
64 66
 		return $this->setProperty($name, $v);
65 67
 	}
@@ -117,8 +119,9 @@  discard block
 block discarded – undo
117 119
 	}
118 120
 
119 121
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
120
-		if ($this->ctrl($name, $value, $typeCtrl)===true)
121
-			return $this->setProperty($name, $value);
122
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
123
+					return $this->setProperty($name, $value);
124
+		}
122 125
 		return $this;
123 126
 	}
124 127
 
@@ -143,8 +146,9 @@  discard block
 block discarded – undo
143 146
 	}
144 147
 
145 148
 	protected function removeProperty($name){
146
-		if(\array_key_exists($name, $this->properties))
147
-			unset($this->properties[$name]);
149
+		if(\array_key_exists($name, $this->properties)) {
150
+					unset($this->properties[$name]);
151
+		}
148 152
 		return $this;
149 153
 	}
150 154
 
@@ -164,8 +168,9 @@  discard block
 block discarded – undo
164 168
 	}
165 169
 
166 170
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
167
-		if (@class_exists($typeCtrl, true))
168
-			$typeCtrl=$typeCtrl::getConstants();
171
+		if (@class_exists($typeCtrl, true)) {
172
+					$typeCtrl=$typeCtrl::getConstants();
173
+		}
169 174
 		if (is_array($typeCtrl)) {
170 175
 			$this->removeOldValues($this->properties [$name], $typeCtrl);
171 176
 		}
@@ -348,15 +353,18 @@  discard block
 block discarded – undo
348 353
 			$flag=false;
349 354
 			$index=0;
350 355
 			while ( !$flag&&$index<sizeof($elements) ) {
351
-				if ($elements [$index] instanceof BaseHtml)
352
-					$flag=($elements [$index]->getIdentifier()===$identifier);
356
+				if ($elements [$index] instanceof BaseHtml) {
357
+									$flag=($elements [$index]->getIdentifier()===$identifier);
358
+				}
353 359
 				$index++;
354 360
 			}
355
-			if ($flag===true)
356
-				return $elements [$index-1];
361
+			if ($flag===true) {
362
+							return $elements [$index-1];
363
+			}
357 364
 		} elseif ($elements instanceof BaseHtml) {
358
-			if ($elements->getIdentifier()===$identifier)
359
-				return $elements;
365
+			if ($elements->getIdentifier()===$identifier) {
366
+							return $elements;
367
+			}
360 368
 		}
361 369
 		return null;
362 370
 	}
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 abstract class BaseHtml extends BaseWidget {
17 17
 	protected $_template;
18 18
 	protected $tagName;
19
-	protected $properties=array ();
20
-	protected $events=array ();
19
+	protected $properties=array();
20
+	protected $events=array();
21 21
 	protected $wrapBefore="";
22 22
 	protected $wrapAfter="";
23 23
 	protected $_bsComponent;
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 	public function addToProperty($name, $value, $separator=" ") {
58 58
 		$v=@$this->properties[$name];
59
-		if (isset($v)&&$v!=="")
59
+		if (isset($v) && $v!=="")
60 60
 			$v=$v.$separator.$value;
61 61
 		else
62 62
 			$v=$value;
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 
72 72
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
73 73
 		$result=$this->getTemplate();
74
-		foreach ( $this as $key => $value ) {
75
-			if (PhalconUtils::startsWith($key, "_")===false&&$key!=="events") {
74
+		foreach ($this as $key => $value) {
75
+			if (PhalconUtils::startsWith($key, "_")===false && $key!=="events") {
76 76
 				if (is_array($value)) {
77 77
 					$v=PropertyWrapper::wrap($value, $js);
78
-				} else {
78
+				}else {
79 79
 					$v=$value;
80 80
 				}
81 81
 				$result=str_ireplace("%".$key."%", $v, $result);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		if (isset($view)===true) {
88 88
 			$controls=$view->getVar("q");
89 89
 			if (isset($controls)===false) {
90
-				$controls=array ();
90
+				$controls=array();
91 91
 			}
92 92
 			$controls [$this->identifier]=$result;
93 93
 			$view->setVar("q", $controls);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 			if (array_search($value, $typeCtrl)===false) {
101 101
 				throw new \Exception("La valeur passée a propriété `".$name."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
102 102
 			}
103
-		} else {
103
+		}else {
104 104
 			if (!$typeCtrl($value)) {
105 105
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$name);
106 106
 			}
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 		return true;
109 109
 	}
110 110
 
111
-	protected function propertyContains($propertyName,$value){
111
+	protected function propertyContains($propertyName, $value) {
112 112
 		$values=$this->getProperty($propertyName);
113
-		if(isset($values)){
113
+		if (isset($values)) {
114 114
 			return JString::contains($values, $value);
115 115
 		}
116 116
 		return false;
@@ -137,13 +137,13 @@  discard block
 block discarded – undo
137 137
 		return $this;
138 138
 	}
139 139
 
140
-	protected function removePropertyValue($name,$value){
140
+	protected function removePropertyValue($name, $value) {
141 141
 		$this->properties[$name]=\str_replace($value, "", $this->properties[$name]);
142 142
 		return $this;
143 143
 	}
144 144
 
145
-	protected function removeProperty($name){
146
-		if(\array_key_exists($name, $this->properties))
145
+	protected function removeProperty($name) {
146
+		if (\array_key_exists($name, $this->properties))
147 147
 			unset($this->properties[$name]);
148 148
 		return $this;
149 149
 	}
@@ -196,28 +196,28 @@  discard block
 block discarded – undo
196 196
 	}
197 197
 
198 198
 	public function fromArray($array) {
199
-		foreach ( $this as $key => $value ) {
199
+		foreach ($this as $key => $value) {
200 200
 			if (array_key_exists($key, $array) && !PhalconUtils::startsWith($key, "_")) {
201 201
 					$setter="set".ucfirst($key);
202 202
 					$this->$setter($array [$key]);
203 203
 				unset($array [$key]);
204 204
 			}
205 205
 		}
206
-		foreach ( $array as $key => $value ) {
206
+		foreach ($array as $key => $value) {
207 207
 			if (method_exists($this, $key)) {
208 208
 				try {
209 209
 					$this->$key($value);
210 210
 					unset($array [$key]);
211
-				} catch ( \Exception $e ) {
211
+				} catch (\Exception $e) {
212 212
 					// Nothing to do
213 213
 				}
214
-			} else {
214
+			}else {
215 215
 				$setter="set".ucfirst($key);
216 216
 				if (method_exists($this, $setter)) {
217 217
 					try {
218 218
 						$this->$setter($value);
219 219
 						unset($array [$key]);
220
-					} catch ( \Exception $e ) {
220
+					} catch (\Exception $e) {
221 221
 						// Nothing to do
222 222
 					}
223 223
 				}
@@ -226,21 +226,21 @@  discard block
 block discarded – undo
226 226
 		return $array;
227 227
 	}
228 228
 
229
-	public function fromDatabaseObjects($objects,$function) {
230
-		if(isset($objects)){
231
-			foreach ($objects as $object){
232
-				$this->fromDatabaseObject($object,$function);
229
+	public function fromDatabaseObjects($objects, $function) {
230
+		if (isset($objects)) {
231
+			foreach ($objects as $object) {
232
+				$this->fromDatabaseObject($object, $function);
233 233
 			}
234 234
 		}
235 235
 		return $this;
236 236
 	}
237 237
 
238
-	public function fromDatabaseObject($object,$function){
238
+	public function fromDatabaseObject($object, $function) {
239 239
 
240 240
 	}
241 241
 
242 242
 	public function wrap($before, $after="") {
243
-		if(isset($before)){
243
+		if (isset($before)) {
244 244
 			$this->wrapBefore.=$before;
245 245
 		}
246 246
 		$this->wrapAfter=$after.$this->wrapAfter;
@@ -262,13 +262,13 @@  discard block
 block discarded – undo
262 262
 		if (array_key_exists($event, $this->events)) {
263 263
 			if (is_array($this->events [$event])) {
264 264
 				$this->events [$event] []=$jsCode;
265
-			} else {
266
-				$this->events [$event]=array (
265
+			}else {
266
+				$this->events [$event]=array(
267 267
 						$this->events [$event],
268 268
 						$jsCode
269 269
 				);
270 270
 			}
271
-		} else {
271
+		}else {
272 272
 			$this->events [$event]=$jsCode;
273 273
 		}
274 274
 	}
@@ -287,14 +287,14 @@  discard block
 block discarded – undo
287 287
 
288 288
 	public function addEventsOnRun(JsUtils $js) {
289 289
 		if (isset($this->_bsComponent)) {
290
-			foreach ( $this->events as $event => $jsCode ) {
290
+			foreach ($this->events as $event => $jsCode) {
291 291
 				$code=$jsCode;
292 292
 				if (is_array($jsCode)) {
293 293
 					$code="";
294
-					foreach ( $jsCode as $jsC ) {
294
+					foreach ($jsCode as $jsC) {
295 295
 						if ($jsC instanceof AjaxCall) {
296 296
 							$code.="\n".$jsC->compile($js);
297
-						} else {
297
+						}else {
298 298
 							$code.="\n".$jsC;
299 299
 						}
300 300
 					}
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 	}
309 309
 
310 310
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
311
-		$params=array (
311
+		$params=array(
312 312
 				"url" => $url,
313 313
 				"responseElement" => $responseElement
314 314
 		);
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 		if (is_array($elements)) {
348 348
 			$flag=false;
349 349
 			$index=0;
350
-			while ( !$flag&&$index<sizeof($elements) ) {
350
+			while (!$flag && $index<sizeof($elements)) {
351 351
 				if ($elements [$index] instanceof BaseHtml)
352 352
 					$flag=($elements [$index]->getIdentifier()===$identifier);
353 353
 				$index++;
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 		return null;
362 362
 	}
363 363
 
364
-	public function __toString(){
364
+	public function __toString() {
365 365
 		return $this->compile();
366 366
 	}
367 367
 
@@ -377,25 +377,25 @@  discard block
 block discarded – undo
377 377
 		if (is_array($value)) {
378 378
 			$value=implode(",", $value);
379 379
 		}
380
-		if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false) {
380
+		if (strrpos($value, 'this')===false && strrpos($value, 'event')===false) {
381 381
 			$value='"'.$value.'"';
382 382
 		}
383 383
 		return $value;
384 384
 	}
385 385
 
386
-	public function jsDoJquery($jqueryCall, $param=""){
386
+	public function jsDoJquery($jqueryCall, $param="") {
387 387
 		return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");";
388 388
 	}
389 389
 
390
-	public function jsHtml($content=""){
391
-		return $this->jsDoJquery("html",$content);
390
+	public function jsHtml($content="") {
391
+		return $this->jsDoJquery("html", $content);
392 392
 	}
393 393
 
394
-	public function jsShow(){
394
+	public function jsShow() {
395 395
 		return $this->jsDoJquery("show");
396 396
 	}
397 397
 
398
-	public function jsHide(){
398
+	public function jsHide() {
399 399
 		return $this->jsDoJquery("hide");
400 400
 	}
401 401
 
Please login to merge, or discard this patch.
Ajax/semantic/html/base/HtmlSemNavElement.php 3 patches
Doc Comments   +10 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,6 +22,11 @@  discard block
 block discarded – undo
22 22
 	protected $_contentSeparator="";
23 23
 
24 24
 
25
+	/**
26
+	 * @param string $identifier
27
+	 * @param string $tagName
28
+	 * @param string $baseClass
29
+	 */
25 30
 	public function __construct($identifier,$tagName,$baseClass){
26 31
 		parent::__construct($identifier,$tagName,$baseClass);
27 32
 		$this->root="";
@@ -32,8 +37,7 @@  discard block
 block discarded – undo
32 37
 	 * Associate an ajax get to the elements, displayed in $targetSelector
33 38
 	 * $attr member is used to build each element url
34 39
 	 * @param string $targetSelector the target of the get
35
-	 * @param string $attr the html attribute used to build the elements url
36
-	 * @return HtmlNavElement
40
+	 * @return HtmlSemNavElement
37 41
 	 */
38 42
 	public function autoGetOnClick($targetSelector){
39 43
 		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
@@ -65,7 +69,7 @@  discard block
 block discarded – undo
65 69
 	/**
66 70
 	 * Define the html attribute for each element url in ajax
67 71
 	 * @param string $attr html attribute
68
-	 * @return HtmlNavElement
72
+	 * @return HtmlSemNavElement
69 73
 	 */
70 74
 	public function setAttr($attr) {
71 75
 		$this->attr = $attr;
@@ -105,6 +109,9 @@  discard block
 block discarded – undo
105 109
 		return $this;
106 110
 	}
107 111
 
112
+	/**
113
+	 * @param integer $index
114
+	 */
108 115
 	protected function getContentDivider($index){
109 116
 		if(\is_array($this->_contentSeparator)===true){
110 117
 			return @$this->_contentSeparator[$index];
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 	protected $_contentSeparator="";
23 23
 
24 24
 
25
-	public function __construct($identifier,$tagName,$baseClass){
26
-		parent::__construct($identifier,$tagName,$baseClass);
25
+	public function __construct($identifier, $tagName, $baseClass) {
26
+		parent::__construct($identifier, $tagName, $baseClass);
27 27
 		$this->root="";
28 28
 		$this->attr="data-ajax";
29 29
 	}
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 	 * @param string $attr the html attribute used to build the elements url
36 36
 	 * @return HtmlNavElement
37 37
 	 */
38
-	public function autoGetOnClick($targetSelector){
39
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
38
+	public function autoGetOnClick($targetSelector) {
39
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
40 40
 	}
41 41
 
42
-	public function contentAsString(){
42
+	public function contentAsString() {
43 43
 		return JArray::implode($this->_contentSeparator, $this->content);
44 44
 	}
45 45
 
@@ -47,15 +47,15 @@  discard block
 block discarded – undo
47 47
 	 * Generate the jquery script to set the elements to the HtmlNavElement
48 48
 	 * @param JsUtils $jsUtils
49 49
 	 */
50
-	public function jsSetContent(JsUtils $jsUtils){
51
-		$jsUtils->html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true);
50
+	public function jsSetContent(JsUtils $jsUtils) {
51
+		$jsUtils->html("#".$this->identifier, str_replace("\"", "'", $this->contentAsString()), true);
52 52
 	}
53 53
 
54 54
 	public function getRoot() {
55 55
 		return $this->root;
56 56
 	}
57 57
 	public function setRoot($root) {
58
-		$this->root = $root;
58
+		$this->root=$root;
59 59
 		return $this;
60 60
 	}
61 61
 	public function getAttr() {
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
 	 * @return HtmlNavElement
69 69
 	 */
70 70
 	public function setAttr($attr) {
71
-		$this->attr = $attr;
71
+		$this->attr=$attr;
72 72
 		return $this;
73 73
 	}
74 74
 
75 75
 	public function __call($method, $args) {
76
-		if(isset($this->$method) && is_callable($this->$method)) {
76
+		if (isset($this->$method) && is_callable($this->$method)) {
77 77
 			return call_user_func_array(
78 78
 					$this->$method,
79 79
 					$args
@@ -81,32 +81,32 @@  discard block
 block discarded – undo
81 81
 		}
82 82
 	}
83 83
 
84
-	public abstract function fromDispatcher($dispatcher,$startIndex=0);
84
+	public abstract function fromDispatcher($dispatcher, $startIndex=0);
85 85
 
86 86
 
87
-	public function setContentDivider($divider,$index=NULL) {
87
+	public function setContentDivider($divider, $index=NULL) {
88 88
 		$divider="<div class='divider'> {$divider} </div>";
89 89
 		return $this->setDivider($divider, $index);
90 90
 	}
91 91
 
92
-	public function setIconContentDivider($iconContentDivider,$index=NULL) {
92
+	public function setIconContentDivider($iconContentDivider, $index=NULL) {
93 93
 		$contentDivider="<i class='".$iconContentDivider." icon divider'></i>";
94 94
 		return $this->setDivider($contentDivider, $index);
95 95
 	}
96 96
 
97
-	protected function setDivider($divider,$index){
98
-		if(isset($index)){
99
-			if(\is_array($this->_contentSeparator)===false)
100
-				$this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator);
97
+	protected function setDivider($divider, $index) {
98
+		if (isset($index)) {
99
+			if (\is_array($this->_contentSeparator)===false)
100
+				$this->_contentSeparator=array_fill(0, $this->count()-1, $this->_contentSeparator);
101 101
 			$this->_contentSeparator[$index]=$divider;
102
-		}else{
102
+		}else {
103 103
 			$this->_contentSeparator=$divider;
104 104
 		}
105 105
 		return $this;
106 106
 	}
107 107
 
108
-	protected function getContentDivider($index){
109
-		if(\is_array($this->_contentSeparator)===true){
108
+	protected function getContentDivider($index) {
109
+		if (\is_array($this->_contentSeparator)===true) {
110 110
 			return @$this->_contentSeparator[$index];
111 111
 		}
112 112
 		return $this->_contentSeparator;
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,10 +96,11 @@
 block discarded – undo
96 96
 
97 97
 	protected function setDivider($divider,$index){
98 98
 		if(isset($index)){
99
-			if(\is_array($this->_contentSeparator)===false)
100
-				$this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator);
99
+			if(\is_array($this->_contentSeparator)===false) {
100
+							$this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator);
101
+			}
101 102
 			$this->_contentSeparator[$index]=$divider;
102
-		}else{
103
+		} else{
103 104
 			$this->_contentSeparator=$divider;
104 105
 		}
105 106
 		return $this;
Please login to merge, or discard this patch.