Completed
Push — master ( a07245...010ee5 )
by Jean-Christophe
03:13
created
Ajax/semantic/html/collections/menus/HtmlMenu.php 3 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	/**
34 34
 	 * Sets the menu type
35 35
 	 * @param string $type one of text,item
36
-	 * @return \Ajax\semantic\html\collections\HtmlMenu
36
+	 * @return HtmlMenu
37 37
 	 */
38 38
 	public function setType($type="") {
39 39
 		return $this->addToPropertyCtrl("class", $type, array ("","item","text" ));
@@ -81,6 +81,7 @@  discard block
 block discarded – undo
81 81
 	 * {@inheritDoc}
82 82
 	 *
83 83
 	 * @see \Ajax\common\html\HtmlCollection::insertItem()
84
+	 * @param HtmlIcon $item
84 85
 	 */
85 86
 	public function insertItem($item, $position=0) {
86 87
 		$item=parent::insertItem($this->getItemToInsert($item), $position);
Please login to merge, or discard this patch.
Braces   +19 added lines, -15 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
 	}
59 59
 
60 60
 	private function afterInsert($item) {
61
-		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false)
62
-			$item->addToPropertyCtrl("class", "item", array ("item" ));
63
-		else {
61
+		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) {
62
+					$item->addToPropertyCtrl("class", "item", array ("item" ));
63
+		} else {
64 64
 			$this->setSecondary();
65 65
 		}
66 66
 		return $item;
@@ -75,8 +75,9 @@  discard block
 block discarded – undo
75 75
 	public function addItem($item) {
76 76
 		$number=$item;
77 77
 		$item=parent::addItem($this->getItemToInsert($item));
78
-		if(\is_int($number))
79
-			$item->setProperty("data-page", $number);
78
+		if(\is_int($number)) {
79
+					$item->setProperty("data-page", $number);
80
+		}
80 81
 		return $this->afterInsert($item);
81 82
 	}
82 83
 
@@ -149,10 +150,11 @@  discard block
 block discarded – undo
149 150
 	}
150 151
 
151 152
 	public function setSecondary($value=true) {
152
-		if($value)
153
-			$this->addToProperty("class", "secondary");
154
-		else
155
-			$this->removePropertyValue("class", "secondary");
153
+		if($value) {
154
+					$this->addToProperty("class", "secondary");
155
+		} else {
156
+					$this->removePropertyValue("class", "secondary");
157
+		}
156 158
 		return $this;
157 159
 	}
158 160
 
@@ -172,8 +174,9 @@  discard block
 block discarded – undo
172 174
 		$this->apply(function (HtmlDoubleElement &$item) {
173 175
 			$item->setTagName("a");
174 176
 		});
175
-		if ($vertical === true)
176
-			$this->setVertical();
177
+		if ($vertical === true) {
178
+					$this->setVertical();
179
+		}
177 180
 		return $this->addToProperty("class", "tabular");
178 181
 	}
179 182
 
@@ -202,10 +205,11 @@  discard block
 block discarded – undo
202 205
 	 */
203 206
 	public function fromDatabaseObject($object, $function) {
204 207
 		$return=$function($object);
205
-		if (\is_array($return))
206
-			$this->addItems($return);
207
-		else
208
-			$this->addItem($return);
208
+		if (\is_array($return)) {
209
+					$this->addItems($return);
210
+		} else {
211
+					$this->addItem($return);
212
+		}
209 213
 	}
210 214
 
211 215
 	/**
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -39,20 +39,20 @@  discard block
 block discarded – undo
39 39
 	 * @return \Ajax\semantic\html\collections\HtmlMenu
40 40
 	 */
41 41
 	public function setType($type="") {
42
-		return $this->addToPropertyCtrl("class", $type, array ("","item","text" ));
42
+		return $this->addToPropertyCtrl("class", $type, array("", "item", "text"));
43 43
 	}
44 44
 
45 45
 	public function setActiveItem($index) {
46 46
 		$item=$this->getItem($index);
47
-		if ($item !== null) {
47
+		if ($item!==null) {
48 48
 			$item->addToProperty("class", "active");
49 49
 		}
50 50
 		return $this;
51 51
 	}
52 52
 
53 53
 	private function getItemToInsert($item) {
54
-		if ($item instanceof HtmlInput || $item instanceof HtmlImg || $item instanceof HtmlIcon || $item instanceof HtmlButtonGroups || $item instanceof HtmlButton ) {
55
-			$itemO=new HtmlMenuItem("item-" . $this->identifier . "-" . \sizeof($this->content) , $item);
54
+		if ($item instanceof HtmlInput || $item instanceof HtmlImg || $item instanceof HtmlIcon || $item instanceof HtmlButtonGroups || $item instanceof HtmlButton) {
55
+			$itemO=new HtmlMenuItem("item-".$this->identifier."-".\sizeof($this->content), $item);
56 56
 			$item=$itemO;
57 57
 		}
58 58
 		return $item;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
 	private function afterInsert($item) {
62 62
 		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false)
63
-			$item->addToPropertyCtrl("class", "item", array ("item" ));
63
+			$item->addToPropertyCtrl("class", "item", array("item"));
64 64
 		else {
65 65
 			$this->setSecondary();
66 66
 		}
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	public function addItem($item) {
77 77
 		$number=$item;
78 78
 		$item=parent::addItem($this->getItemToInsert($item));
79
-		if(\is_int($number))
79
+		if (\is_int($number))
80 80
 			$item->setProperty("data-page", $number);
81 81
 		return $this->afterInsert($item);
82 82
 	}
@@ -94,15 +94,15 @@  discard block
 block discarded – undo
94 94
 
95 95
 	public function generateMenuAsItem($menu, $header=null) {
96 96
 		$count=$this->count();
97
-		$item=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "div");
97
+		$item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div");
98 98
 		if (isset($header)) {
99
-			$headerItem=new HtmlSemDoubleElement("item-header-" . $this->identifier . "-" . $count, "div", "header");
99
+			$headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header");
100 100
 			$headerItem->setContent($header);
101 101
 			$item->addContent($headerItem);
102 102
 			$this->_itemHeader=$headerItem;
103 103
 		}
104
-		if(\is_array($menu)){
105
-			$menu=new HtmlMenu("menu-" . $this->identifier . "-" . $count,$menu);
104
+		if (\is_array($menu)) {
105
+			$menu=new HtmlMenu("menu-".$this->identifier."-".$count, $menu);
106 106
 		}
107 107
 		$menu->setClass("menu");
108 108
 		$item->addContent($menu);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		$value=new HtmlSemDoubleElement($identifier, "a", "browse item", $value);
118 118
 		$value->addContent(new HtmlIcon("", "dropdown"));
119 119
 		$value=$this->addItem($value);
120
-		$popup=new HtmlPopup($value, "popup-" . $this->identifier . "-" . $this->count(), $content);
120
+		$popup=new HtmlPopup($value, "popup-".$this->identifier."-".$this->count(), $content);
121 121
 		$popup->setFlowing()->setPosition("bottom left")->setOn("click");
122 122
 		$this->wrap("", $popup);
123 123
 		return $popup;
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	public function addDropdownAsItem($value, $items=NULL) {
127 127
 		$dd=$value;
128 128
 		if (\is_string($value)) {
129
-			$dd=new HtmlDropdown("dropdown-" . $this->identifier . "-" . $this->count(), $value, $items);
129
+			$dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(), $value, $items);
130 130
 		}
131 131
 		$this->addItem($dd);
132 132
 		return $dd;
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 * @see \Ajax\common\html\html5\HtmlCollection::createItem()
140 140
 	 */
141 141
 	protected function createItem($value) {
142
-		$itemO=new HtmlMenuItem($this->identifier."-item-" . \sizeof($this->content),"");
142
+		$itemO=new HtmlMenuItem($this->identifier."-item-".\sizeof($this->content), "");
143 143
 		$itemO->setTagName("a");
144 144
 		$itemO->setContent($value);
145 145
 		return $itemO;
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	}
151 151
 
152 152
 	public function setSecondary($value=true) {
153
-		if($value)
153
+		if ($value)
154 154
 			$this->addToProperty("class", "secondary");
155 155
 		else
156 156
 			$this->removePropertyValue("class", "secondary");
@@ -158,28 +158,28 @@  discard block
 block discarded – undo
158 158
 	}
159 159
 
160 160
 	public function setVertical() {
161
-		return $this->addToPropertyCtrl("class", "vertical", array ("vertical" ));
161
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical"));
162 162
 	}
163 163
 
164 164
 	public function setPosition($value="right") {
165
-		return $this->addToPropertyCtrl("class", $value, array ("right","left" ));
165
+		return $this->addToPropertyCtrl("class", $value, array("right", "left"));
166 166
 	}
167 167
 
168 168
 	public function setPointing($value=Direction::NONE) {
169
-		return $this->addToPropertyCtrl("class", $value . " pointing", Direction::getConstantValues("pointing"));
169
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
170 170
 	}
171 171
 
172 172
 	public function asTab($vertical=false) {
173
-		$this->apply(function (HtmlDoubleElement &$item) {
173
+		$this->apply(function(HtmlDoubleElement&$item) {
174 174
 			$item->setTagName("a");
175 175
 		});
176
-		if ($vertical === true)
176
+		if ($vertical===true)
177 177
 			$this->setVertical();
178 178
 		return $this->addToProperty("class", "tabular");
179 179
 	}
180 180
 
181 181
 	public function asPagination() {
182
-		$this->apply(function (HtmlDoubleElement &$item) {
182
+		$this->apply(function(HtmlDoubleElement&$item) {
183 183
 			$item->setTagName("a");
184 184
 		});
185 185
 		return $this->addToProperty("class", "pagination");
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
 	 */
217 217
 	public function setWidth($width) {
218 218
 		if (\is_int($width)) {
219
-			$width=Wide::getConstants()["W" . $width];
219
+			$width=Wide::getConstants()["W".$width];
220 220
 		}
221 221
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
222
-		return $this->addToPropertyCtrl("class", "item", array ("item" ));
222
+		return $this->addToPropertyCtrl("class", "item", array("item"));
223 223
 	}
224 224
 
225 225
 	public function addImage($identifier, $src="", $alt="") {
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 		return $this->_itemHeader;
235 235
 	}
236 236
 
237
-	public function run(JsUtils $js){
238
-		$result= parent::run($js);
237
+	public function run(JsUtils $js) {
238
+		$result=parent::run($js);
239 239
 		return $result->setItemSelector(".item");
240 240
 	}
241 241
 }
242 242
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAbsractItem.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -11,6 +11,9 @@
 block discarded – undo
11 11
 
12 12
 abstract class HtmlAbsractItem extends HtmlSemDoubleElement {
13 13
 
14
+	/**
15
+	 * @param string $baseClass
16
+	 */
14 17
 	public function __construct($identifier, $baseClass,$content=NULL) {
15 18
 		parent::__construct($identifier, "div", $baseClass);
16 19
 		$this->content=array();
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Ajax\semantic\html\base\HtmlSemDoubleElement;
6 6
 use Ajax\JsUtils;
7 7
 use Ajax\service\JArray;
8
-
9 8
 use Ajax\semantic\html\base\constants\State;
10 9
 
11 10
 class HtmlProgress extends HtmlSemDoubleElement {
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 abstract class HtmlAbsractItem extends HtmlSemDoubleElement {
13 13
 
14
-	public function __construct($identifier, $baseClass,$content=NULL) {
14
+	public function __construct($identifier, $baseClass, $content=NULL) {
15 15
 		parent::__construct($identifier, "div", $baseClass);
16 16
 		$this->content=array();
17 17
 		$this->initContent($content);
@@ -19,53 +19,53 @@  discard block
 block discarded – undo
19 19
 
20 20
 	protected abstract function initContent($content);
21 21
 
22
-	public function setIcon($icon){
22
+	public function setIcon($icon) {
23 23
 		$this->content["icon"]=new HtmlIcon("icon-".$this->identifier, $icon);
24 24
 	}
25 25
 
26
-	public function setImage($image){
26
+	public function setImage($image) {
27 27
 		$image=new HtmlImg("icon-".$this->identifier, $image);
28 28
 		$image->asAvatar();
29 29
 		$this->content["image"]=$image;
30 30
 	}
31 31
 
32
-	private function createContent(){
33
-		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier,"div","content");
32
+	private function createContent() {
33
+		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
34 34
 		return $this->content["content"];
35 35
 	}
36 36
 
37
-	public function setTitle($title,$description=NULL,$baseClass="title"){
38
-		$title=new HtmlSemDoubleElement("","div",$baseClass,$title);
39
-		if(\array_key_exists("content", $this->content)===false){
37
+	public function setTitle($title, $description=NULL, $baseClass="title") {
38
+		$title=new HtmlSemDoubleElement("", "div", $baseClass, $title);
39
+		if (\array_key_exists("content", $this->content)===false) {
40 40
 			$this->createContent();
41 41
 		}
42 42
 		$this->content["content"]->addContent($title);
43
-		if(isset($description)){
44
-			$description=new HtmlSemDoubleElement("","div","description",$description);
43
+		if (isset($description)) {
44
+			$description=new HtmlSemDoubleElement("", "div", "description", $description);
45 45
 			$this->content["content"]->addContent($description);
46 46
 		}
47 47
 		return $this;
48 48
 	}
49 49
 
50
-	public function getPart($partName="header"){
51
-		$content=\array_merge($this->content["content"]->getContent(),array(@$this->content["icon"],@$this->content["image"]));
50
+	public function getPart($partName="header") {
51
+		$content=\array_merge($this->content["content"]->getContent(), array(@$this->content["icon"], @$this->content["image"]));
52 52
 		return $this->getElementByPropertyValue("class", $partName, $content);
53 53
 	}
54 54
 
55
-	public function setActive($value=true){
56
-		if($value){
55
+	public function setActive($value=true) {
56
+		if ($value) {
57 57
 			$this->setTagName("div");
58 58
 			$this->removeProperty("href");
59 59
 			$this->addToPropertyCtrl("class", "active", array("active"));
60
-		}else{
60
+		} else {
61 61
 			$this->removePropertyValue("class", "active");
62 62
 		}
63 63
 		return $this;
64 64
 	}
65 65
 
66
-	public function asLink($href=NULL,$part=NULL){
66
+	public function asLink($href=NULL, $part=NULL) {
67 67
 		$this->setTagName("a");
68
-		if(isset($href))
68
+		if (isset($href))
69 69
 			$this->setProperty("href", $href);
70 70
 		return $this;
71 71
 	}
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
78 78
 	 */
79 79
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
80
-		if(\is_array($this->content))
81
-			$this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]);
80
+		if (\is_array($this->content))
81
+			$this->content=JArray::sortAssociative($this->content, ["icon", "image", "content"]);
82 82
 		return parent::compile($js, $view);
83 83
 	}
84 84
 }
85 85
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 			$this->setTagName("div");
58 58
 			$this->removeProperty("href");
59 59
 			$this->addToPropertyCtrl("class", "active", array("active"));
60
-		}else{
60
+		} else{
61 61
 			$this->removePropertyValue("class", "active");
62 62
 		}
63 63
 		return $this;
@@ -65,8 +65,9 @@  discard block
 block discarded – undo
65 65
 
66 66
 	public function asLink($href=NULL,$part=NULL){
67 67
 		$this->setTagName("a");
68
-		if(isset($href))
69
-			$this->setProperty("href", $href);
68
+		if(isset($href)) {
69
+					$this->setProperty("href", $href);
70
+		}
70 71
 		return $this;
71 72
 	}
72 73
 
@@ -77,8 +78,9 @@  discard block
 block discarded – undo
77 78
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
78 79
 	 */
79 80
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
80
-		if(\is_array($this->content))
81
-			$this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]);
81
+		if(\is_array($this->content)) {
82
+					$this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]);
83
+		}
82 84
 		return parent::compile($js, $view);
83 85
 	}
84 86
 }
85 87
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlGridRow.php 4 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,6 +22,9 @@  discard block
 block discarded – undo
22 22
 	private $_colSize;
23 23
 	private $_implicite=false;
24 24
 
25
+	/**
26
+	 * @param string $identifier
27
+	 */
25 28
 	public function __construct( $identifier,$numCols=NULL,$colSizing=false,$implicite=false){
26 29
 		parent::__construct( $identifier,"div","row");
27 30
 		$this->_implicite=$implicite;
@@ -55,7 +58,7 @@  discard block
 block discarded – undo
55 58
 	/**
56 59
 	 * return the col at $index
57 60
 	 * @param int $index
58
-	 * @return \Ajax\semantic\html\collections\HtmlGridCol
61
+	 * @return \Ajax\common\html\HtmlDoubleElement
59 62
 	 */
60 63
 	public function getCol($index){
61 64
 		return $this->getItem($index);
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -16,24 +16,24 @@  discard block
 block discarded – undo
16 16
  * @author jc
17 17
  * @version 1.001
18 18
  */
19
-class HtmlGridRow extends HtmlSemCollection{
19
+class HtmlGridRow extends HtmlSemCollection {
20 20
 	use TextAlignmentTrait;
21 21
 
22 22
 	private $_colSize;
23 23
 	private $_implicite=false;
24 24
 
25
-	public function __construct( $identifier,$numCols=NULL,$colSizing=false,$implicite=false){
26
-		parent::__construct( $identifier,"div","row");
25
+	public function __construct($identifier, $numCols=NULL, $colSizing=false, $implicite=false) {
26
+		parent::__construct($identifier, "div", "row");
27 27
 		$this->_implicite=$implicite;
28 28
 		$width=null;
29
-		if(isset($numCols)){
30
-			$numCols=min(16,$numCols);
31
-			$numCols=max(1,$numCols);
32
-			if($colSizing)
29
+		if (isset($numCols)) {
30
+			$numCols=min(16, $numCols);
31
+			$numCols=max(1, $numCols);
32
+			if ($colSizing)
33 33
 				$width=(int)(16/$numCols);
34 34
 			else
35 35
 				$this->_colSize=16/$numCols;
36
-			for ($i=0;$i<$numCols;$i++){
36
+			for ($i=0; $i<$numCols; $i++) {
37 37
 				$this->addItem($width);
38 38
 			}
39 39
 		}
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 	 * @param int $width
45 45
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
46 46
 	 */
47
-	public function setWidth($width){
48
-		if(\is_int($width)){
47
+	public function setWidth($width) {
48
+		if (\is_int($width)) {
49 49
 			$width=Wide::getConstants()["W".$width];
50 50
 		}
51 51
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
52
-		return $this->addToPropertyCtrl("class", "column",array("column"));
52
+		return $this->addToPropertyCtrl("class", "column", array("column"));
53 53
 	}
54 54
 
55 55
 	/**
@@ -57,29 +57,29 @@  discard block
 block discarded – undo
57 57
 	 * @param int $index
58 58
 	 * @return \Ajax\semantic\html\collections\HtmlGridCol
59 59
 	 */
60
-	public function getCol($index){
60
+	public function getCol($index) {
61 61
 		return $this->getItem($index);
62 62
 	}
63 63
 
64
-	public function setColsCount($colsCount,$toCreate=true){
64
+	public function setColsCount($colsCount, $toCreate=true) {
65 65
 		$this->setWidth($colsCount);
66
-		if($toCreate===true){
66
+		if ($toCreate===true) {
67 67
 			$count=$this->count();
68
-			for($i=$count;$i<$colsCount;$i++){
68
+			for ($i=$count; $i<$colsCount; $i++) {
69 69
 				$this->addItem(null);
70 70
 			}
71 71
 		}
72 72
 		return $this;
73 73
 	}
74 74
 
75
-	public function addCols($colCount){
76
-		for($i=0;$i<$colCount;$i++){
75
+	public function addCols($colCount) {
76
+		for ($i=0; $i<$colCount; $i++) {
77 77
 			$this->addItem(null);
78 78
 		}
79 79
 		return $this;
80 80
 	}
81 81
 
82
-	public function addCol($width=NULL){
82
+	public function addCol($width=NULL) {
83 83
 		return $this->addItem($width);
84 84
 	}
85 85
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 * stretch the row contents to take up the entire column height
88 88
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
89 89
 	 */
90
-	public function setStretched(){
90
+	public function setStretched() {
91 91
 		return $this->addToProperty("class", "stretched");
92 92
 	}
93 93
 
@@ -95,19 +95,19 @@  discard block
 block discarded – undo
95 95
 	 * @param string $color
96 96
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
97 97
 	 */
98
-	public function setColor($color){
99
-		return $this->addToPropertyCtrl("class", $color,Color::getConstants());
98
+	public function setColor($color) {
99
+		return $this->addToPropertyCtrl("class", $color, Color::getConstants());
100 100
 	}
101 101
 
102
-	public function setValues($values,$force=false){
102
+	public function setValues($values, $force=false) {
103 103
 		$count=$this->count();
104
-		if($force===true){
105
-			for($i=$count;$i<\sizeof($values);$i++){
106
-				$this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1),null));
104
+		if ($force===true) {
105
+			for ($i=$count; $i<\sizeof($values); $i++) {
106
+				$this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1), null));
107 107
 			}
108 108
 		}
109
-		$count=\min(array($this->count(),\sizeof($values)));
110
-		for($i=0;$i<$count;$i++){
109
+		$count=\min(array($this->count(), \sizeof($values)));
110
+		for ($i=0; $i<$count; $i++) {
111 111
 			$this->content[$i]->setValue($values[$i]);
112 112
 		}
113 113
 		return $this;
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
 	 * {@inheritDoc}
118 118
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
119 119
 	 */
120
-	protected function createItem($value){
121
-		$col=new HtmlGridCol($this->identifier."-col-".($this->count()+1),$value);
120
+	protected function createItem($value) {
121
+		$col=new HtmlGridCol($this->identifier."-col-".($this->count()+1), $value);
122 122
 		return $col;
123 123
 	}
124 124
 
125
-	public function compile(JsUtils $js=NULL,&$view=NULL){
126
-		if($this->_implicite===true){
125
+	public function compile(JsUtils $js=NULL, &$view=NULL) {
126
+		if ($this->_implicite===true) {
127 127
 			$this->_template="%wrapContentBefore%%content%%wrapContentAfter%";
128 128
 		}
129
-		return parent::compile($js,$view);
129
+		return parent::compile($js, $view);
130 130
 	}
131 131
 }
132 132
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,10 +29,11 @@
 block discarded – undo
29 29
 		if(isset($numCols)){
30 30
 			$numCols=min(16,$numCols);
31 31
 			$numCols=max(1,$numCols);
32
-			if($colSizing)
33
-				$width=(int)(16/$numCols);
34
-			else
35
-				$this->_colSize=16/$numCols;
32
+			if($colSizing) {
33
+							$width=(int)(16/$numCols);
34
+			} else {
35
+							$this->_colSize=16/$numCols;
36
+			}
36 37
 			for ($i=0;$i<$numCols;$i++){
37 38
 				$this->addItem($width);
38 39
 			}
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Ajax\semantic\html\base\HtmlSemDoubleElement;
6 6
 use Ajax\JsUtils;
7 7
 use Ajax\service\JArray;
8
-
9 8
 use Ajax\semantic\html\base\constants\State;
10 9
 
11 10
 class HtmlProgress extends HtmlSemDoubleElement {
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlButton.php 3 patches
Doc Comments   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	/**
39 39
 	 * Set the button value
40 40
 	 * @param string $value
41
-	 * @return \Ajax\semantic\html\HtmlButton
41
+	 * @return HtmlButton
42 42
 	 */
43 43
 	public function setValue($value) {
44 44
 		$this->content=$value;
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 
48 48
 	/**
49 49
 	 * define the button style
50
-	 * @param string|int $cssStyle
51
-	 * @return \Ajax\semantic\html\HtmlButton default : ""
50
+	 * @param string $cssStyle
51
+	 * @return HtmlButton default : ""
52 52
 	 */
53 53
 	public function setStyle($cssStyle) {
54 54
 		return $this->addToProperty("class", $cssStyle);
@@ -98,7 +98,6 @@  discard block
 block discarded – undo
98 98
 
99 99
 	/**
100 100
 	 * Add and return a button label
101
-	 * @param string $caption
102 101
 	 * @param string $before
103 102
 	 * @param string $icon
104 103
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	public function setFocusable($value=true) {
58
-		if ($value === true)
58
+		if ($value===true)
59 59
 			$this->setProperty("tabindex", "0");
60 60
 		else {
61 61
 			$this->removeProperty("tabindex");
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 
66 66
 	public function setAnimated($content, $animation="") {
67 67
 		$this->setTagName("div");
68
-		$this->addToProperty("class", "animated " . $animation);
69
-		$visible=new HtmlSemDoubleElement("visible-" . $this->identifier, "div");
68
+		$this->addToProperty("class", "animated ".$animation);
69
+		$visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div");
70 70
 		$visible->setClass("visible content");
71 71
 		$visible->setContent($this->content);
72
-		$hidden=new HtmlSemDoubleElement("hidden-" . $this->identifier, "div");
72
+		$hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div");
73 73
 		$hidden->setClass("hidden content");
74 74
 		$hidden->setContent($content);
75
-		$this->content=array ($visible,$hidden );
75
+		$this->content=array($visible, $hidden);
76 76
 		return $hidden;
77 77
 	}
78 78
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	public function asIcon($icon) {
85 85
 		$iconO=$icon;
86 86
 		if (\is_string($icon)) {
87
-			$iconO=new HtmlIcon("icon-" . $this->identifier, $icon);
87
+			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
88 88
 		}
89 89
 		$this->addToProperty("class", "icon");
90 90
 		$this->content=$iconO;
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
 	public function addLabel($label, $before=false, $icon=NULL) {
107 107
 		$this->tagName="div";
108 108
 		$this->addToProperty("class", "labeled");
109
-		$this->content=new HtmlButton("button-" . $this->identifier, $this->content);
109
+		$this->content=new HtmlButton("button-".$this->identifier, $this->content);
110 110
 		$this->content->setTagName("div");
111
-		$label=new HtmlLabel("label-" . $this->identifier, $label, $icon,"a");
111
+		$label=new HtmlLabel("label-".$this->identifier, $label, $icon, "a");
112 112
 		$label->setBasic();
113 113
 		$this->addContent($label, $before);
114 114
 		return $label;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	public function fromArray($array) {
122 122
 		$array=parent::fromArray($array);
123
-		foreach ( $array as $key => $value ) {
123
+		foreach ($array as $key => $value) {
124 124
 			$this->setProperty($key, $value);
125 125
 		}
126 126
 		return $array;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	}
176 176
 
177 177
 	public static function social($identifier, $social, $value=NULL) {
178
-		if ($value === NULL)
178
+		if ($value===NULL)
179 179
 			$value=\ucfirst($social);
180 180
 		$return=new HtmlButton($identifier, $value);
181 181
 		$return->addIcon($social);
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	}
196 196
 
197 197
 	public function asLink($href=NULL) {
198
-		$lnk=new HtmlLink("lnk-".$this->identifier,$href,$this->content);
198
+		$lnk=new HtmlLink("lnk-".$this->identifier, $href, $this->content);
199 199
 		$this->content=$lnk;
200 200
 		return $this;
201 201
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	public function setFocusable($value=true) {
58
-		if ($value === true)
59
-			$this->setProperty("tabindex", "0");
60
-		else {
58
+		if ($value === true) {
59
+					$this->setProperty("tabindex", "0");
60
+		} else {
61 61
 			$this->removeProperty("tabindex");
62 62
 		}
63 63
 		return $this;
@@ -175,8 +175,9 @@  discard block
 block discarded – undo
175 175
 	}
176 176
 
177 177
 	public static function social($identifier, $social, $value=NULL) {
178
-		if ($value === NULL)
179
-			$value=\ucfirst($social);
178
+		if ($value === NULL) {
179
+					$value=\ucfirst($social);
180
+		}
180 181
 		$return=new HtmlButton($identifier, $value);
181 182
 		$return->addIcon($social);
182 183
 		return $return->addToPropertyCtrl("class", $social, Social::getConstants());
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlIconGroups.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -13,6 +13,9 @@
 block discarded – undo
13 13
  */
14 14
 class HtmlIconGroups extends HtmlSemCollection {
15 15
 
16
+	/**
17
+	 * @param string $identifier
18
+	 */
16 19
 	public function __construct($identifier, $icons=array(), $size="") {
17 20
 		parent::__construct($identifier, "i", "icons");
18 21
 		$this->addItems($icons);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 			$icon=JArray::getValue($value, "icon", 0);
26 26
 			$size=JArray::getValue($value, "size", 1);
27 27
 		}
28
-		$iconO=new HtmlIcon("icon-" . $this->identifier, $icon);
28
+		$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
29 29
 		if (isset($size)) {
30 30
 			$iconO->setSize($size);
31 31
 		}
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	protected function createCondition($value) {
36
-		return ($value instanceof HtmlIcon) === false;
36
+		return ($value instanceof HtmlIcon)===false;
37 37
 	}
38 38
 
39 39
 	public function getIcon($index) {
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabel.php 4 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 
21 21
 	/**
22 22
 	 *
23
-	 * @param string $side
24 23
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
25 24
 	 */
26 25
 	public function setPointing($value=Direction::NONE) {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -91,12 +91,12 @@
 block discarded – undo
91 91
 	}
92 92
 
93 93
 	/**
94
-	*  Adds an image
95
-	* @param string $src
96
-	* @param string $alt
97
-	* @param boolean $before
98
-	* @return \Ajax\semantic\html\elements\html5\HtmlImg
99
-	*/
94
+	 *  Adds an image
95
+	 * @param string $src
96
+	 * @param string $alt
97
+	 * @param boolean $before
98
+	 * @return \Ajax\semantic\html\elements\html5\HtmlImg
99
+	 */
100 100
 	public function addImage($src, $alt="", $before=true) {
101 101
 		$img=new HtmlImg("image-" . $this->identifier, $src, $alt);
102 102
 		$img->setClass("");
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
25 25
 	 */
26 26
 	public function setPointing($value=Direction::NONE) {
27
-		if($value==="left" || $value==="right")
27
+		if ($value==="left" || $value==="right")
28 28
 			return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
29 29
 		else
30
-			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
30
+			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing", true));
31 31
 	}
32 32
 
33 33
 	/**
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
37 37
 	 */
38 38
 	public function toCorner($side="left") {
39
-		return $this->addToPropertyCtrl("class", $side . " corner", array ("right corner","left corner" ));
39
+		return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner"));
40 40
 	}
41 41
 
42
-	public function setHorizontal(){
43
-		return $this->addToPropertyCtrl("class", "hozizontal",array("horizontal"));
42
+	public function setHorizontal() {
43
+		return $this->addToPropertyCtrl("class", "hozizontal", array("horizontal"));
44 44
 	}
45 45
 
46
-	public function setFloating(){
47
-		return $this->addToPropertyCtrl("class", "floating",array("floating"));
46
+	public function setFloating() {
47
+		return $this->addToPropertyCtrl("class", "floating", array("floating"));
48 48
 	}
49 49
 
50 50
 	/**
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 		return $this->addToProperty("class", "tag");
56 56
 	}
57 57
 
58
-	public function setEmpty(){
58
+	public function setEmpty() {
59 59
 		$this->content=NULL;
60
-		return $this->addToPropertyCtrl("class", "empty",array("empty"));
60
+		return $this->addToPropertyCtrl("class", "empty", array("empty"));
61 61
 	}
62 62
 
63 63
 	public function setBasic() {
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function addEmphasisImage($src, $alt="", $before=true) {
75 75
 		$this->addToProperty("class", "image");
76
-		return $this->addImage($src,$alt,$before);
76
+		return $this->addImage($src, $alt, $before);
77 77
 	}
78 78
 
79 79
 	/**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 * @return \Ajax\semantic\html\elements\html5\HtmlImg
85 85
 	 */
86 86
 	public function addAvatarImage($src, $alt="", $before=true) {
87
-		$img=$this->addImage($src,$alt,$before);
87
+		$img=$this->addImage($src, $alt, $before);
88 88
 		$img->setClass("ui image");
89 89
 		$img->asAvatar();
90 90
 		return $img;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	* @return \Ajax\semantic\html\elements\html5\HtmlImg
99 99
 	*/
100 100
 	public function addImage($src, $alt="", $before=true) {
101
-		$img=new HtmlImg("image-" . $this->identifier, $src, $alt);
101
+		$img=new HtmlImg("image-".$this->identifier, $src, $alt);
102 102
 		$img->setClass("");
103 103
 		$this->addContent($img, $before);
104 104
 		return $img;
@@ -110,21 +110,21 @@  discard block
 block discarded – undo
110 110
 	 * @return \Ajax\common\html\HtmlDoubleElement
111 111
 	 */
112 112
 	public function addDetail($detail) {
113
-		$div=new HtmlSemDoubleElement("detail-" . $this->identifier, $this->tagName,"detail");
113
+		$div=new HtmlSemDoubleElement("detail-".$this->identifier, $this->tagName, "detail");
114 114
 		$div->setContent($detail);
115 115
 		$this->addContent($div);
116 116
 		return $div;
117 117
 	}
118 118
 
119 119
 	public function asRibbon($direction=Direction::NONE) {
120
-		return $this->addToPropertyCtrl("class", $direction." ribbon", array ("ribbon","right ribbon","left ribbon" ));
120
+		return $this->addToPropertyCtrl("class", $direction." ribbon", array("ribbon", "right ribbon", "left ribbon"));
121 121
 	}
122 122
 
123
-	public function setAttached($side=Side::TOP,$direction=Direction::NONE){
124
-		if($direction!==Direction::NONE)
125
-			return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
123
+	public function setAttached($side=Side::TOP, $direction=Direction::NONE) {
124
+		if ($direction!==Direction::NONE)
125
+			return $this->addToPropertyCtrl("class", $side." ".$direction." attached", Side::getConstantValues($direction." attached"));
126 126
 		else
127
-			return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
127
+			return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached"));
128 128
 	}
129 129
 
130 130
 	public static function ribbon($identifier, $caption) {
Please login to merge, or discard this patch.
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@  discard block
 block discarded – undo
14 14
 	public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") {
15 15
 		parent::__construct($identifier, $tagName, "ui label");
16 16
 		$this->content=$caption;
17
-		if (isset($icon)===true)
18
-			$this->addIcon($icon);
17
+		if (isset($icon)===true) {
18
+					$this->addIcon($icon);
19
+		}
19 20
 	}
20 21
 
21 22
 	/**
@@ -24,10 +25,11 @@  discard block
 block discarded – undo
24 25
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
25 26
 	 */
26 27
 	public function setPointing($value=Direction::NONE) {
27
-		if($value==="left" || $value==="right")
28
-			return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
29
-		else
30
-			return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
28
+		if($value==="left" || $value==="right") {
29
+					return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
30
+		} else {
31
+					return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
32
+		}
31 33
 	}
32 34
 
33 35
 	/**
@@ -121,10 +123,11 @@  discard block
 block discarded – undo
121 123
 	}
122 124
 
123 125
 	public function setAttached($side=Side::TOP,$direction=Direction::NONE){
124
-		if($direction!==Direction::NONE)
125
-			return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
126
-		else
127
-			return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
126
+		if($direction!==Direction::NONE) {
127
+					return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
128
+		} else {
129
+					return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
130
+		}
128 131
 	}
129 132
 
130 133
 	public static function ribbon($identifier, $caption) {
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlList.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -10,6 +10,9 @@  discard block
 block discarded – undo
10 10
 class HtmlList extends HtmlSemCollection {
11 11
 	protected $_hasCheckedList;
12 12
 
13
+	/**
14
+	 * @param string $identifier
15
+	 */
13 16
 	public function __construct($identifier, $items=array()) {
14 17
 		parent::__construct($identifier, "div", "ui list");
15 18
 		$this->addItems($items);
@@ -22,6 +25,9 @@  discard block
 block discarded – undo
22 25
 		return $item;
23 26
 	}
24 27
 
28
+	/**
29
+	 * @param integer $niveau
30
+	 */
25 31
 	public function addHeader($niveau, $content) {
26 32
 		$header=new HtmlHeader("header-" . $this->identifier, $niveau, $content, "page");
27 33
 		$this->wrap($header);
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 
19 19
 	protected function createItem($value) {
20 20
 		$count=$this->count();
21
-		$item=new HtmlListItem("item-" . $this->identifier . "-" . $count, $value);
21
+		$item=new HtmlListItem("item-".$this->identifier."-".$count, $value);
22 22
 		return $item;
23 23
 	}
24 24
 
25 25
 	public function addHeader($niveau, $content) {
26
-		$header=new HtmlHeader("header-" . $this->identifier, $niveau, $content, "page");
26
+		$header=new HtmlHeader("header-".$this->identifier, $niveau, $content, "page");
27 27
 		$this->wrap($header);
28 28
 		return $header;
29 29
 	}
30 30
 
31
-	public function getItemPart($index,$partName="header"){
31
+	public function getItemPart($index, $partName="header") {
32 32
 		return $this->getItem($index)->getPart($partName);
33 33
 	}
34 34
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 
39 39
 	public function asLink() {
40
-		$this->addToPropertyCtrl("class", "link", array ("link" ));
40
+		$this->addToPropertyCtrl("class", "link", array("link"));
41 41
 		return $this->contentAs("a");
42 42
 	}
43 43
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	}
61 61
 
62 62
 	public function run(JsUtils $js) {
63
-		if ($this->_hasCheckedList === true) {
64
-			$jsCode=include dirname(__FILE__) . '/../../components/jsTemplates/tplCheckedList.php';
65
-			$jsCode=\str_replace("%identifier%", "#" . $this->identifier, $jsCode);
63
+		if ($this->_hasCheckedList===true) {
64
+			$jsCode=include dirname(__FILE__).'/../../components/jsTemplates/tplCheckedList.php';
65
+			$jsCode=\str_replace("%identifier%", "#".$this->identifier, $jsCode);
66 66
 			$this->executeOnRun($jsCode);
67 67
 		}
68 68
 		return parent::run($js);
@@ -86,24 +86,24 @@  discard block
 block discarded – undo
86 86
 
87 87
 	public function addCheckedList($items=array(), $masterItem=NULL, $values=array()) {
88 88
 		$count=$this->count();
89
-		$identifier=$this->identifier . "-" . $count;
89
+		$identifier=$this->identifier."-".$count;
90 90
 		if (isset($masterItem)) {
91
-			$masterO=new HtmlFormCheckbox("master-" . $identifier, $masterItem);
91
+			$masterO=new HtmlFormCheckbox("master-".$identifier, $masterItem);
92 92
 			$masterO->getField()->addToProperty("class", "master");
93 93
 			$masterO->setClass("item");
94 94
 			$this->addItem($masterO);
95 95
 		}
96
-		$fields=array ();
96
+		$fields=array();
97 97
 		$i=0;
98
-		foreach ( $items as $val => $caption ) {
99
-			$itemO=new HtmlFormCheckbox($identifier . "-" . $i++, $caption, $val, "child");
100
-			if (\array_search($val, $values) !== false) {
98
+		foreach ($items as $val => $caption) {
99
+			$itemO=new HtmlFormCheckbox($identifier."-".$i++, $caption, $val, "child");
100
+			if (\array_search($val, $values)!==false) {
101 101
 				$itemO->getField()->getField()->setProperty("checked", "");
102 102
 			}
103 103
 			$itemO->setClass("item");
104 104
 			$fields[]=$itemO;
105 105
 		}
106
-		if (isset($masterO) === true) {
106
+		if (isset($masterO)===true) {
107 107
 			$list=new HtmlList("", $fields);
108 108
 			$list->setClass("list");
109 109
 			$masterO->addContent($list);
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlAccordion.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -10,6 +10,9 @@  discard block
 block discarded – undo
10 10
 
11 11
 	protected $params=array();
12 12
 
13
+	/**
14
+	 * @param string $identifier
15
+	 */
13 16
 	public function __construct( $identifier, $tagName="div", $baseClass="ui"){
14 17
 		parent::__construct( $identifier, "div", "ui accordion");
15 18
 	}
@@ -29,6 +32,9 @@  discard block
 block discarded – undo
29 32
 		return ($value instanceof HtmlAccordionItem)===false;
30 33
 	}
31 34
 
35
+	/**
36
+	 * @param string $title
37
+	 */
32 38
 	public function addPanel($title,$content){
33 39
 		return $this->addItem([$title,$content]);
34 40
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,9 @@
 block discarded – undo
62 62
 	 * @see BaseHtml::run()
63 63
 	 */
64 64
 	public function run(JsUtils $js) {
65
-		if(isset($this->_bsComponent)===false)
66
-			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
65
+		if(isset($this->_bsComponent)===false) {
66
+					$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
67
+		}
67 68
 			$this->addEventsOnRun($js);
68 69
 			return $this->_bsComponent;
69 70
 	}
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -6,31 +6,31 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\content\HtmlAccordionItem;
7 7
 use Ajax\JsUtils;
8 8
 
9
-class HtmlAccordion extends HtmlSemCollection{
9
+class HtmlAccordion extends HtmlSemCollection {
10 10
 
11 11
 	protected $params=array();
12 12
 
13
-	public function __construct( $identifier, $tagName="div", $baseClass="ui"){
14
-		parent::__construct( $identifier, "div", "ui accordion");
13
+	public function __construct($identifier, $tagName="div", $baseClass="ui") {
14
+		parent::__construct($identifier, "div", "ui accordion");
15 15
 	}
16 16
 
17 17
 
18
-	protected function createItem($value){
18
+	protected function createItem($value) {
19 19
 		$count=$this->count();
20 20
 		$title=$value;
21 21
 		$content=NULL;
22
-		if(\is_array($value)){
23
-			$title=@$value[0];$content=@$value[1];
22
+		if (\is_array($value)) {
23
+			$title=@$value[0]; $content=@$value[1];
24 24
 		}
25
-		return new HtmlAccordionItem("item-".$this->identifier."-".$count, $title,$content);
25
+		return new HtmlAccordionItem("item-".$this->identifier."-".$count, $title, $content);
26 26
 	}
27 27
 
28
-	protected function createCondition($value){
28
+	protected function createCondition($value) {
29 29
 		return ($value instanceof HtmlAccordionItem)===false;
30 30
 	}
31 31
 
32
-	public function addPanel($title,$content){
33
-		return $this->addItem([$title,$content]);
32
+	public function addPanel($title, $content) {
33
+		return $this->addItem([$title, $content]);
34 34
 	}
35 35
 
36 36
 	/**
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	 * @param string $action a Phalcon action
43 43
 	 * @param array $params
44 44
 	 */
45
-	public function forwardPanel(JsUtils $js,$title,$initialController,$controller,$action,$params=array()){
46
-		return $this->addPanel($title, $js->forward($initialController, $controller, $action,$params));
45
+	public function forwardPanel(JsUtils $js, $title, $initialController, $controller, $action, $params=array()) {
46
+		return $this->addPanel($title, $js->forward($initialController, $controller, $action, $params));
47 47
 	}
48 48
 
49 49
 	/**
@@ -54,30 +54,30 @@  discard block
 block discarded – undo
54 54
 	 * @param string $viewName
55 55
 	 * @param $params The parameters to pass to the view
56 56
 	 */
57
-	public function renderViewPanel(JsUtils $js,$title,$initialController, $viewName, $params=array()) {
58
-		return $this->addPanel($title, $js->renderContent($initialController, $viewName,$params));
57
+	public function renderViewPanel(JsUtils $js, $title, $initialController, $viewName, $params=array()) {
58
+		return $this->addPanel($title, $js->renderContent($initialController, $viewName, $params));
59 59
 	}
60 60
 	/*
61 61
 	 * (non-PHPdoc)
62 62
 	 * @see BaseHtml::run()
63 63
 	 */
64 64
 	public function run(JsUtils $js) {
65
-		if(isset($this->_bsComponent)===false)
66
-			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
65
+		if (isset($this->_bsComponent)===false)
66
+			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier, $this->params);
67 67
 			$this->addEventsOnRun($js);
68 68
 			return $this->_bsComponent;
69 69
 	}
70 70
 
71
-	public function setStyled(){
71
+	public function setStyled() {
72 72
 		return $this->addToProperty("class", "styled");
73 73
 	}
74 74
 
75
-	public function activate($index){
75
+	public function activate($index) {
76 76
 		$this->getItem($index)->setActive(true);
77 77
 		return $this;
78 78
 	}
79 79
 
80
-	public function setExclusive($value){
80
+	public function setExclusive($value) {
81 81
 		$this->params["exclusive"]=$value;
82 82
 	}
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlModal.php 3 patches
Doc Comments   +9 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,6 +14,9 @@  discard block
 block discarded – undo
14 14
 	protected $_params=array();
15 15
 	protected $_paramParts=array();
16 16
 
17
+	/**
18
+	 * @param string $identifier
19
+	 */
17 20
 	public function __construct($identifier, $header="", $content="", $actions=array()) {
18 21
 		parent::__construct($identifier, "div","ui modal");
19 22
 		if(isset($header)){
@@ -27,6 +30,9 @@  discard block
 block discarded – undo
27 30
 		}
28 31
 	}
29 32
 
33
+	/**
34
+	 * @param string $value
35
+	 */
30 36
 	public function setHeader($value) {
31 37
 		$this->content["header"]=new HtmlSemDoubleElement("header-" . $this->identifier, "a", "header", $value);
32 38
 		return $this;
@@ -103,6 +109,9 @@  discard block
 block discarded – undo
103 109
 		return $this->addElementInPart(new HtmlSemDoubleElement($part."-" . $this->identifier, "div", $uiClass, $content), $part);
104 110
 	}
105 111
 
112
+	/**
113
+	 * @param BaseHtml $element
114
+	 */
106 115
 	private function addElementInPart($element,$part) {
107 116
 		$this->content[$part]->addContent($element);
108 117
 		return $element;
@@ -145,7 +154,6 @@  discard block
 block discarded – undo
145 154
 	/**
146 155
 	 * render the content of $controller::$action and set the response to the modal content
147 156
 	 * @param JsUtils $js
148
-	 * @param string $title The panel title
149 157
 	 * @param Controller $initialControllerInstance
150 158
 	 * @param string $controllerName the controller name
151 159
 	 * @param string $actionName the action name
Please login to merge, or discard this patch.
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@  discard block
 block discarded – undo
43 43
 			foreach ($actions as $action){
44 44
 				$this->addAction($action);
45 45
 			}
46
-		}
47
-		else{
46
+		} else{
48 47
 			$this->addAction($actions);
49 48
 		}
50 49
 		return $this;
@@ -60,8 +59,9 @@  discard block
 block discarded – undo
60 59
 				$class="cancel";
61 60
 			}
62 61
 			$action=new HtmlButton("action-".$this->identifier,$action);
63
-			if($class!=="")
64
-				$action->addToProperty("class", $class);
62
+			if($class!=="") {
63
+							$action->addToProperty("class", $class);
64
+			}
65 65
 		}
66 66
 		return $this->addElementInPart($action, "actions");
67 67
 	}
@@ -169,8 +169,9 @@  discard block
 block discarded – undo
169 169
 	 * @see BaseHtml::run()
170 170
 	 */
171 171
 	public function run(JsUtils $js) {
172
-		if(isset($this->_bsComponent)===false)
173
-			$this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts);
172
+		if(isset($this->_bsComponent)===false) {
173
+					$this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts);
174
+		}
174 175
 		$this->addEventsOnRun($js);
175 176
 		return $this->_bsComponent;
176 177
 	}
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -15,117 +15,117 @@  discard block
 block discarded – undo
15 15
 	protected $_paramParts=array();
16 16
 
17 17
 	public function __construct($identifier, $header="", $content="", $actions=array()) {
18
-		parent::__construct($identifier, "div","ui modal");
19
-		if(isset($header)){
18
+		parent::__construct($identifier, "div", "ui modal");
19
+		if (isset($header)) {
20 20
 			$this->setHeader($header);
21 21
 		}
22
-		if(isset($content)){
22
+		if (isset($content)) {
23 23
 			$this->setContent($content);
24 24
 		}
25
-		if(isset($actions)){
25
+		if (isset($actions)) {
26 26
 			$this->setActions($actions);
27 27
 		}
28 28
 	}
29 29
 
30 30
 	public function setHeader($value) {
31
-		$this->content["header"]=new HtmlSemDoubleElement("header-" . $this->identifier, "a", "header", $value);
31
+		$this->content["header"]=new HtmlSemDoubleElement("header-".$this->identifier, "a", "header", $value);
32 32
 		return $this;
33 33
 	}
34 34
 
35 35
 	public function setContent($value) {
36
-		$this->content["content"]=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", $value);
36
+		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content", $value);
37 37
 		return $this;
38 38
 	}
39 39
 
40 40
 	public function setActions($actions) {
41
-		$this->content["actions"]=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "actions");
42
-		if(\is_array($actions)){
43
-			foreach ($actions as $action){
41
+		$this->content["actions"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "actions");
42
+		if (\is_array($actions)) {
43
+			foreach ($actions as $action) {
44 44
 				$this->addAction($action);
45 45
 			}
46 46
 		}
47
-		else{
47
+		else {
48 48
 			$this->addAction($actions);
49 49
 		}
50 50
 		return $this;
51 51
 	}
52 52
 
53
-	public function addAction($action){
54
-		if(!$action instanceof BaseHtml){
53
+	public function addAction($action) {
54
+		if (!$action instanceof BaseHtml) {
55 55
 			$class="";
56
-			if(\array_search($action, ["Okay","Yes"])!==false){
56
+			if (\array_search($action, ["Okay", "Yes"])!==false) {
57 57
 				$class="approve";
58 58
 			}
59
-			if(\array_search($action, ["Cancel","No"])!==false){
59
+			if (\array_search($action, ["Cancel", "No"])!==false) {
60 60
 				$class="cancel";
61 61
 			}
62
-			$action=new HtmlButton("action-".$this->identifier,$action);
63
-			if($class!=="")
62
+			$action=new HtmlButton("action-".$this->identifier, $action);
63
+			if ($class!=="")
64 64
 				$action->addToProperty("class", $class);
65 65
 		}
66 66
 		return $this->addElementInPart($action, "actions");
67 67
 	}
68 68
 
69
-	public function addContent($content,$before=false){
70
-		$this->content["content"]->addContent($content,$before);
69
+	public function addContent($content, $before=false) {
70
+		$this->content["content"]->addContent($content, $before);
71 71
 		return $this;
72 72
 	}
73 73
 
74
-	public function addImageContent($image,$description=NULL){
74
+	public function addImageContent($image, $description=NULL) {
75 75
 		$content=$this->content["content"];
76
-		if(isset($description)){
77
-			$description=new HtmlSemDoubleElement("description-".$this->identifier,"div","description",$description);
78
-			$content->addContent($description,true);
76
+		if (isset($description)) {
77
+			$description=new HtmlSemDoubleElement("description-".$this->identifier, "div", "description", $description);
78
+			$content->addContent($description, true);
79 79
 		}
80
-		if($image!==""){
81
-			$img=new HtmlImage("image-".$this->identifier,$image,"","medium");
82
-			$content->addContent($img,true);
83
-			$content->addToProperty("class","image");
80
+		if ($image!=="") {
81
+			$img=new HtmlImage("image-".$this->identifier, $image, "", "medium");
82
+			$content->addContent($img, true);
83
+			$content->addToProperty("class", "image");
84 84
 		}
85 85
 		return $this;
86 86
 	}
87 87
 
88
-	public function addIconContent($icon,$description=NULL){
88
+	public function addIconContent($icon, $description=NULL) {
89 89
 		$content=$this->content["content"];
90
-		if(isset($description)){
91
-			$description=new HtmlSemDoubleElement("description-".$this->identifier,"div","description",$description);
92
-			$content->addContent($description,true);
90
+		if (isset($description)) {
91
+			$description=new HtmlSemDoubleElement("description-".$this->identifier, "div", "description", $description);
92
+			$content->addContent($description, true);
93 93
 		}
94
-		if($icon!==""){
95
-			$img=new HtmlIcon("image-".$this->identifier,$icon);
96
-			$content->addContent($img,true);
97
-			$content->addToProperty("class","image");
94
+		if ($icon!=="") {
95
+			$img=new HtmlIcon("image-".$this->identifier, $icon);
96
+			$content->addContent($img, true);
97
+			$content->addToProperty("class", "image");
98 98
 		}
99 99
 		return $this;
100 100
 	}
101 101
 
102
-	private function addContentInPart($content,$uiClass,$part) {
103
-		return $this->addElementInPart(new HtmlSemDoubleElement($part."-" . $this->identifier, "div", $uiClass, $content), $part);
102
+	private function addContentInPart($content, $uiClass, $part) {
103
+		return $this->addElementInPart(new HtmlSemDoubleElement($part."-".$this->identifier, "div", $uiClass, $content), $part);
104 104
 	}
105 105
 
106
-	private function addElementInPart($element,$part) {
106
+	private function addElementInPart($element, $part) {
107 107
 		$this->content[$part]->addContent($element);
108 108
 		return $element;
109 109
 	}
110 110
 
111
-	public function showDimmer($value){
112
-		$value=$value?"show":"hide";
111
+	public function showDimmer($value) {
112
+		$value=$value ? "show" : "hide";
113 113
 		$this->_paramParts[]=["'".$value." dimmer'"];
114 114
 		return $this;
115 115
 	}
116 116
 
117
-	public function setInverted(){
117
+	public function setInverted() {
118 118
 		$this->_params["inverted"]=true;
119 119
 		return $this;
120 120
 	}
121 121
 
122
-	public function setBasic(){
122
+	public function setBasic() {
123 123
 		return $this->addToProperty("class", "basic");
124 124
 	}
125 125
 
126 126
 
127
-	public function setTransition($value){
128
-		$this->_paramParts[]=["'setting'","'transition'","'".$value."'"];
127
+	public function setTransition($value) {
128
+		$this->_paramParts[]=["'setting'", "'transition'", "'".$value."'"];
129 129
 	}
130 130
 
131 131
 	/**
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 	 * @param string $viewName
136 136
 	 * @param $params The parameters to pass to the view
137 137
 	 */
138
-	public function renderView(JsUtils $js,$initialController,$viewName, $params=array()) {
139
-		return $this->setContent($js->renderContent($initialController, $viewName,$params));
138
+	public function renderView(JsUtils $js, $initialController, $viewName, $params=array()) {
139
+		return $this->setContent($js->renderContent($initialController, $viewName, $params));
140 140
 	}
141 141
 
142 142
 	/**
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 	 * @param string $controllerName the controller name
148 148
 	 * @param string $actionName the action name
149 149
 	 */
150
-	public function forward(JsUtils $js,$initialControllerInstance,$controllerName,$actionName,$params=NULL){
151
-		return $this->setContent($js->forward($initialControllerInstance, $controllerName, $actionName,$params));
150
+	public function forward(JsUtils $js, $initialControllerInstance, $controllerName, $actionName, $params=NULL) {
151
+		return $this->setContent($js->forward($initialControllerInstance, $controllerName, $actionName, $params));
152 152
 	}
153 153
 
154 154
 	/**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
159 159
 	 */
160 160
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
161
-		$this->content=JArray::sortAssociative($this->content, ["header","content","actions" ]);
161
+		$this->content=JArray::sortAssociative($this->content, ["header", "content", "actions"]);
162 162
 		return parent::compile($js, $view);
163 163
 	}
164 164
 	/*
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
 	 * @see BaseHtml::run()
167 167
 	 */
168 168
 	public function run(JsUtils $js) {
169
-		if(isset($this->_bsComponent)===false)
170
-			$this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts);
169
+		if (isset($this->_bsComponent)===false)
170
+			$this->_bsComponent=$js->semantic()->modal("#".$this->identifier, $this->_params, $this->_paramParts);
171 171
 		$this->addEventsOnRun($js);
172 172
 		return $this->_bsComponent;
173 173
 	}
Please login to merge, or discard this patch.