Completed
Push — master ( 2461e8...b569b1 )
by Jean-Christophe
04:01
created
Ajax/semantic/html/collections/menus/HtmlAccordionMenu.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -20,6 +20,9 @@
 block discarded – undo
20 20
 	protected $_tabsType="tabs";
21 21
 	protected $stacked="";
22 22
 
23
+	/**
24
+	 * @param string $identifier
25
+	 */
23 26
 	public function __construct($identifier, $tagName="ul") {
24 27
 		parent::__construct($identifier, $tagName);
25 28
 		$this->_template="<%tagName% %properties%>%tabs%</%tagName%>%content%";
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\content\HtmlAccordionMenuItem;
7 7
 use Ajax\JsUtils;
8 8
 
9
-class HtmlAccordionMenu extends HtmlMenu{
9
+class HtmlAccordionMenu extends HtmlMenu {
10 10
 	protected $params=array();
11 11
 
12
-	public function __construct( $identifier, $items=array() ){
13
-		parent::__construct( $identifier, $items);
12
+	public function __construct($identifier, $items=array()) {
13
+		parent::__construct($identifier, $items);
14 14
 		$this->addToProperty("class", "accordion");
15 15
 		$this->setVertical();
16 16
 	}
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 	protected function createItem($value) {
23 23
 		$title=$value;
24 24
 		$content="";
25
-		if(\is_array($value)){
26
-			$title=@$value[0];$content=@$value[1];
25
+		if (\is_array($value)) {
26
+			$title=@$value[0]; $content=@$value[1];
27 27
 		}
28 28
 		$itemO=new HtmlAccordionMenuItem("item-".$this->identifier."-".$this->count(), $title, $content);
29 29
 		return $itemO->setClass("item");
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 	 * @see BaseHtml::run()
35 35
 	 */
36 36
 	public function run(JsUtils $js) {
37
-		if(isset($this->_bsComponent)===false)
38
-			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
37
+		if (isset($this->_bsComponent)===false)
38
+			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier, $this->params);
39 39
 			$this->addEventsOnRun($js);
40 40
 			return $this->_bsComponent;
41 41
 	}
42 42
 
43
-	public function setExclusive($value){
43
+	public function setExclusive($value) {
44 44
 		$this->params["exclusive"]=$value;
45 45
 	}
46 46
 }
47 47
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@
 block discarded – undo
34 34
 	 * @see BaseHtml::run()
35 35
 	 */
36 36
 	public function run(JsUtils $js) {
37
-		if(isset($this->_bsComponent)===false)
38
-			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
37
+		if(isset($this->_bsComponent)===false) {
38
+					$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
39
+		}
39 40
 			$this->addEventsOnRun($js);
40 41
 			return $this->_bsComponent;
41 42
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/menus/HtmlMenu.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	/**
26 26
 	 * Sets the menu type
27 27
 	 * @param string $type one of text,item
28
-	 * @return \Ajax\semantic\html\collections\HtmlMenu
28
+	 * @return HtmlMenu
29 29
 	 */
30 30
 	public function setType($type=""){
31 31
 		return $this->addToPropertyCtrl("class", $type, array("","item","text"));
Please login to merge, or discard this patch.
Braces   +11 added lines, -9 removed lines patch added patch discarded remove patch
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
 			$item=$itemO;
58 58
 		}
59 59
 		$item=parent::addItem($item);
60
-		if(!$item instanceof HtmlMenu)
61
-			$item->addToPropertyCtrl("class", "item",array("item"));
62
-		else{
60
+		if(!$item instanceof HtmlMenu) {
61
+					$item->addToPropertyCtrl("class", "item",array("item"));
62
+		} else{
63 63
 			$this->setSecondary();
64 64
 		}
65 65
 		return $item;
@@ -129,8 +129,9 @@  discard block
 block discarded – undo
129 129
 
130 130
 	public function asTab($vertical=false){
131 131
 		$this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");});
132
-		if($vertical===true)
133
-			$this->setVertical();
132
+		if($vertical===true) {
133
+					$this->setVertical();
134
+		}
134 135
 		return $this->addToProperty("class", "tabular");
135 136
 	}
136 137
 
@@ -156,10 +157,11 @@  discard block
 block discarded – undo
156 157
 	 */
157 158
 	public function fromDatabaseObject($object, $function) {
158 159
 		$return=$function($object);
159
-		if(\is_array($return))
160
-			$this->addItems($return);
161
-		else
162
-		$this->addItem($return);
160
+		if(\is_array($return)) {
161
+					$this->addItems($return);
162
+		} else {
163
+				$this->addItem($return);
164
+		}
163 165
 	}
164 166
 
165 167
 	/**
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 class HtmlMenu extends HtmlSemCollection {
25 25
 
26 26
 	public function __construct($identifier, $items=array()) {
27
-		parent::__construct($identifier, "div","ui menu");
27
+		parent::__construct($identifier, "div", "ui menu");
28 28
 		$this->addItems($items);
29 29
 	}
30 30
 
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
 	 * @param string $type one of text,item
34 34
 	 * @return \Ajax\semantic\html\collections\HtmlMenu
35 35
 	 */
36
-	public function setType($type=""){
37
-		return $this->addToPropertyCtrl("class", $type, array("","item","text"));
36
+	public function setType($type="") {
37
+		return $this->addToPropertyCtrl("class", $type, array("", "item", "text"));
38 38
 	}
39 39
 
40
-	public function setActiveItem($index){
40
+	public function setActiveItem($index) {
41 41
 		$item=$this->getItem($index);
42
-		if($item!==null){
42
+		if ($item!==null) {
43 43
 			$item->addToProperty("class", "active");
44 44
 		}
45 45
 		return $this;
@@ -49,26 +49,26 @@  discard block
 block discarded – undo
49 49
 	 * {@inheritDoc}
50 50
 	 * @see \Ajax\common\html\html5\HtmlCollection::addItem()
51 51
 	 */
52
-	public function addItem($item){
53
-		if($item instanceof HtmlInput || $item instanceof HtmlImg){
54
-			$itemO=new HtmlSemDoubleElement("item-".$this->identifier,"div","");
52
+	public function addItem($item) {
53
+		if ($item instanceof HtmlInput || $item instanceof HtmlImg) {
54
+			$itemO=new HtmlSemDoubleElement("item-".$this->identifier, "div", "");
55 55
 			$itemO->setContent($item);
56 56
 			$item=$itemO;
57 57
 		}
58 58
 		$item=parent::addItem($item);
59
-		if(!$item instanceof HtmlMenu)
60
-			$item->addToPropertyCtrl("class", "item",array("item"));
61
-		else{
59
+		if (!$item instanceof HtmlMenu)
60
+			$item->addToPropertyCtrl("class", "item", array("item"));
61
+		else {
62 62
 			$this->setSecondary();
63 63
 		}
64 64
 		return $item;
65 65
 	}
66 66
 
67
-	public function generateMenuAsItem($menu,$header=null){
67
+	public function generateMenuAsItem($menu, $header=null) {
68 68
 		$count=$this->count();
69
-		$item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count,"div");
70
-		if(isset($header)){
71
-			$headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count,"div","header");
69
+		$item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div");
70
+		if (isset($header)) {
71
+			$headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header");
72 72
 			$headerItem->setContent($header);
73 73
 			$item->addContent($headerItem);
74 74
 		}
@@ -76,24 +76,24 @@  discard block
 block discarded – undo
76 76
 		$item->addContent($menu);
77 77
 		return $item;
78 78
 	}
79
-	public function addMenuAsItem($menu,$header=null){
80
-		return $this->addItem($this->generateMenuAsItem($menu,$header));
79
+	public function addMenuAsItem($menu, $header=null) {
80
+		return $this->addItem($this->generateMenuAsItem($menu, $header));
81 81
 	}
82 82
 
83
-	public function addPopupAsItem($value,$identifier, $content=""){
84
-		$value=new HtmlSemDoubleElement($identifier,"a","browse item",$value);
83
+	public function addPopupAsItem($value, $identifier, $content="") {
84
+		$value=new HtmlSemDoubleElement($identifier, "a", "browse item", $value);
85 85
 		$value->addContent(new HtmlIcon("", "dropdown"));
86 86
 		$value=$this->addItem($value);
87
-		$popup=new HtmlPopup($value,"popup-".$this->identifier."-".$this->count(),$content);
87
+		$popup=new HtmlPopup($value, "popup-".$this->identifier."-".$this->count(), $content);
88 88
 		$popup->setFlowing()->setPosition("bottom left")->setOn("click");
89
-		$this->wrap("",$popup);
89
+		$this->wrap("", $popup);
90 90
 		return $popup;
91 91
 	}
92 92
 
93
-	public function addDropdownAsItem($value,$items=NULL){
93
+	public function addDropdownAsItem($value, $items=NULL) {
94 94
 		$dd=$value;
95
-		if(\is_string($value)){
96
-			$dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(),$value,$items);
95
+		if (\is_string($value)) {
96
+			$dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(), $value, $items);
97 97
 		}
98 98
 		return $this->addItem($dd);
99 99
 	}
@@ -102,51 +102,51 @@  discard block
 block discarded – undo
102 102
 	 * @see \Ajax\common\html\html5\HtmlCollection::createItem()
103 103
 	 */
104 104
 	protected function createItem($value) {
105
-		$itemO=new HtmlLink("item-".\sizeof($this->content),"",$value);
105
+		$itemO=new HtmlLink("item-".\sizeof($this->content), "", $value);
106 106
 		return $itemO->setClass("item");
107 107
 	}
108 108
 
109
-	public function setInverted(){
109
+	public function setInverted() {
110 110
 		return $this->addToProperty("class", "inverted");
111 111
 	}
112 112
 
113
-	public function setSecondary(){
113
+	public function setSecondary() {
114 114
 		return $this->addToProperty("class", "secondary");
115 115
 	}
116 116
 
117
-	public function setVertical(){
118
-		return $this->addToPropertyCtrl("class", "vertical",array("vertical"));
117
+	public function setVertical() {
118
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical"));
119 119
 	}
120 120
 
121
-	public function setPosition($value="right"){
122
-		return $this->addToPropertyCtrl("class", $value,array("right","left"));
121
+	public function setPosition($value="right") {
122
+		return $this->addToPropertyCtrl("class", $value, array("right", "left"));
123 123
 	}
124 124
 
125
-	public function setPointing($value=Direction::NONE){
126
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
125
+	public function setPointing($value=Direction::NONE) {
126
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
127 127
 	}
128 128
 
129
-	public function asTab($vertical=false){
130
-		$this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");});
131
-		if($vertical===true)
129
+	public function asTab($vertical=false) {
130
+		$this->apply(function(HtmlDoubleElement & $item) {$item->setTagName("a"); });
131
+		if ($vertical===true)
132 132
 			$this->setVertical();
133 133
 		return $this->addToProperty("class", "tabular");
134 134
 	}
135 135
 
136
-	public function asPagination(){
137
-		$this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");});
136
+	public function asPagination() {
137
+		$this->apply(function(HtmlDoubleElement & $item) {$item->setTagName("a"); });
138 138
 			return $this->addToProperty("class", "pagination");
139 139
 	}
140 140
 
141
-	public function setFixed(){
141
+	public function setFixed() {
142 142
 		return $this->addToProperty("class", "fixed");
143 143
 	}
144 144
 
145
-	public function setFluid(){
145
+	public function setFluid() {
146 146
 		return $this->addToProperty("class", "fluid");
147 147
 	}
148 148
 
149
-	public function setCompact(){
149
+	public function setCompact() {
150 150
 		return $this->addToProperty("class", "compact");
151 151
 	}
152 152
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	 */
156 156
 	public function fromDatabaseObject($object, $function) {
157 157
 		$return=$function($object);
158
-		if(\is_array($return))
158
+		if (\is_array($return))
159 159
 			$this->addItems($return);
160 160
 		else
161 161
 		$this->addItem($return);
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
 	 * @param int $width
167 167
 	 * @return \Ajax\semantic\html\collections\menus\HtmlMenu
168 168
 	 */
169
-	public function setWidth($width){
170
-		if(\is_int($width)){
169
+	public function setWidth($width) {
170
+		if (\is_int($width)) {
171 171
 			$width=Wide::getConstants()["W".$width];
172 172
 		}
173 173
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
174
-		return $this->addToPropertyCtrl("class", "item",array("item"));
174
+		return $this->addToPropertyCtrl("class", "item", array("item"));
175 175
 	}
176 176
 
177
-	public function addImage($identifier, $src="", $alt=""){
178
-		return $this->addItem(new HtmlImg($identifier,$src,$alt));
177
+	public function addImage($identifier, $src="", $alt="") {
178
+		return $this->addItem(new HtmlImg($identifier, $src, $alt));
179 179
 	}
180 180
 
181
-	public static function vertical($identifier,$items=array()){
182
-		return (new HtmlMenu($identifier,$items))->setVertical();
181
+	public static function vertical($identifier, $items=array()) {
182
+		return (new HtmlMenu($identifier, $items))->setVertical();
183 183
 	}
184 184
 }
185 185
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAccordionMenuItem.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@
 block discarded – undo
4 4
 
5 5
 
6 6
 class HtmlAccordionMenuItem extends HtmlMenuItem {
7
-	public function __construct($identifier,$title,$content) {
8
-		parent::__construct($identifier, new HtmlAccordionItem("accordion-".$identifier, $title,$content));
7
+	public function __construct($identifier, $title, $content) {
8
+		parent::__construct($identifier, new HtmlAccordionItem("accordion-".$identifier, $title, $content));
9 9
 	}
10 10
 
11
-	public function setActive($value=true){
11
+	public function setActive($value=true) {
12 12
 		$this->content->setActive($value);
13 13
 		return $this;
14 14
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAccordionItem.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,30 +20,30 @@
 block discarded – undo
20 20
 		$this->_title=$title;
21 21
 	}
22 22
 
23
-	public function setTitle($title){
23
+	public function setTitle($title) {
24 24
 		$this->_title=$title;
25 25
 	}
26 26
 
27
-	public function setIcon($icon){
27
+	public function setIcon($icon) {
28 28
 		$this->_icon=$icon;
29 29
 	}
30 30
 
31
-	protected function createTitleElement(){
32
-		$element=new HtmlSemDoubleElement("title-".$this->identifier,"div","title");
33
-		$element->setContent(array(new HtmlIcon("", $this->_icon),$this->_title));
34
-		if($this->_active===true)
31
+	protected function createTitleElement() {
32
+		$element=new HtmlSemDoubleElement("title-".$this->identifier, "div", "title");
33
+		$element->setContent(array(new HtmlIcon("", $this->_icon), $this->_title));
34
+		if ($this->_active===true)
35 35
 			$element->addToProperty("class", "active");
36 36
 		return $element;
37 37
 	}
38 38
 
39
-	public function compile(JsUtils $js=NULL, View $view=NULL){
39
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
40 40
 		$this->titleElement=$this->createTitleElement();
41
-		return parent::compile($js,$view);
41
+		return parent::compile($js, $view);
42 42
 	}
43 43
 
44
-	public function setActive($value=true){
44
+	public function setActive($value=true) {
45 45
 		$this->_active=$value;
46
-		if($value===true)
46
+		if ($value===true)
47 47
 			$this->addToPropertyCtrl("class", "active", array("active"));
48 48
 		else
49 49
 			$this->removePropertyValue("class", "active");
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,8 +31,9 @@  discard block
 block discarded – undo
31 31
 	protected function createTitleElement(){
32 32
 		$element=new HtmlSemDoubleElement("title-".$this->identifier,"div","title");
33 33
 		$element->setContent(array(new HtmlIcon("", $this->_icon),$this->_title));
34
-		if($this->_active===true)
35
-			$element->addToProperty("class", "active");
34
+		if($this->_active===true) {
35
+					$element->addToProperty("class", "active");
36
+		}
36 37
 		return $element;
37 38
 	}
38 39
 
@@ -43,10 +44,11 @@  discard block
 block discarded – undo
43 44
 
44 45
 	public function setActive($value=true){
45 46
 		$this->_active=$value;
46
-		if($value===true)
47
-			$this->addToPropertyCtrl("class", "active", array("active"));
48
-		else
49
-			$this->removePropertyValue("class", "active");
47
+		if($value===true) {
48
+					$this->addToPropertyCtrl("class", "active", array("active"));
49
+		} else {
50
+					$this->removePropertyValue("class", "active");
51
+		}
50 52
 		return $this;
51 53
 	}
52 54
 }
53 55
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormField.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,8 +8,9 @@  discard block
 block discarded – undo
8 8
 	public function __construct($identifier, $field,$label=NULL) {
9 9
 		parent::__construct($identifier, "div","ui field");
10 10
 		$this->content=array();
11
-		if(isset($label))
12
-			$this->setLabel($label);
11
+		if(isset($label)) {
12
+					$this->setLabel($label);
13
+		}
13 14
 		$this->setField($field);
14 15
 	}
15 16
 
@@ -28,8 +29,9 @@  discard block
 block discarded – undo
28 29
 	}
29 30
 
30 31
 	public function getLabel(){
31
-		if(\array_key_exists("label", $this->content))
32
-			return $this->content["label"];
32
+		if(\array_key_exists("label", $this->content)) {
33
+					return $this->content["label"];
34
+		}
33 35
 	}
34 36
 
35 37
 	public function getField(){
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -8,26 +8,26 @@  discard block
 block discarded – undo
8 8
 
9 9
 class HtmlFormField extends HtmlSemDoubleElement {
10 10
 	protected $_container;
11
-	public function __construct($identifier, $field,$label=NULL) {
12
-		parent::__construct($identifier, "div","field");
11
+	public function __construct($identifier, $field, $label=NULL) {
12
+		parent::__construct($identifier, "div", "field");
13 13
 		$this->content=array();
14
-		$this->_states=[State::ERROR,State::DISABLED];
15
-		if(isset($label))
14
+		$this->_states=[State::ERROR, State::DISABLED];
15
+		if (isset($label))
16 16
 			$this->setLabel($label);
17 17
 		$this->setField($field);
18 18
 	}
19 19
 
20
-	public function setLabel($label){
20
+	public function setLabel($label) {
21 21
 		$labelO=$label;
22
-		if(\is_string($label)){
23
-			$labelO=new HtmlSemDoubleElement("","label","");
22
+		if (\is_string($label)) {
23
+			$labelO=new HtmlSemDoubleElement("", "label", "");
24 24
 			$labelO->setContent($label);
25
-			$labelO->setProperty("for", \str_replace("field-", "",$this->identifier));
25
+			$labelO->setProperty("for", \str_replace("field-", "", $this->identifier));
26 26
 		}
27 27
 		$this->content["label"]=$labelO;
28 28
 	}
29 29
 
30
-	public function setField($field){
30
+	public function setField($field) {
31 31
 		$this->content["field"]=$field;
32 32
 	}
33 33
 
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 	 * Returns the label or null
36 36
 	 * @return mixed
37 37
 	 */
38
-	public function getLabel(){
39
-		if(\array_key_exists("label", $this->content))
38
+	public function getLabel() {
39
+		if (\array_key_exists("label", $this->content))
40 40
 			return $this->content["label"];
41 41
 	}
42 42
 
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
 	 * Return the field
45 45
 	 * @return mixed
46 46
 	 */
47
-	public function getField(){
47
+	public function getField() {
48 48
 		return $this->content["field"];
49 49
 	}
50 50
 
51 51
 	/**
52 52
 	 * puts the label before or behind
53 53
 	 */
54
-	public function swapLabel(){
54
+	public function swapLabel() {
55 55
 		$label=$this->getLabel();
56 56
 		unset($this->content["label"]);
57 57
 		$this->content["label"]=$label;
@@ -62,27 +62,27 @@  discard block
 block discarded – undo
62 62
 	 * @param int $width
63 63
 	 * @return \Ajax\semantic\html\collections\form\HtmlFormField
64 64
 	 */
65
-	public function setWidth($width){
66
-		if(\is_int($width)){
65
+	public function setWidth($width) {
66
+		if (\is_int($width)) {
67 67
 			$width=Wide::getConstants()["W".$width];
68 68
 		}
69 69
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
70
-		if(isset($this->_container)){
70
+		if (isset($this->_container)) {
71 71
 			$this->_container->setEqualWidth(false);
72 72
 		}
73
-		return $this->addToPropertyCtrl("class", "wide",array("wide"));
73
+		return $this->addToPropertyCtrl("class", "wide", array("wide"));
74 74
 	}
75 75
 
76 76
 	/**
77 77
 	 * Field displays an error state
78 78
 	 * @return \Ajax\semantic\html\collections\form\HtmlFormField
79 79
 	 */
80
-	public function setError(){
80
+	public function setError() {
81 81
 		return $this->addToProperty("class", "error");
82 82
 	}
83 83
 
84
-	public function jsState($state){
85
-		return $this->jsDoJquery("addClass",$state);
84
+	public function jsState($state) {
85
+		return $this->jsDoJquery("addClass", $state);
86 86
 	}
87 87
 
88 88
 	public function setContainer($_container) {
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		return $this;
91 91
 	}
92 92
 
93
-	public function setReadonly(){
93
+	public function setReadonly() {
94 94
 		$this->getField()->setProperty("readonly", "");
95 95
 	}
96 96
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/menus/HtmlLabeledIconMenu.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
  * @author jc
13 13
  * @version 1.001
14 14
  */
15
-class HtmlLabeledIconMenu extends HtmlMenu{
15
+class HtmlLabeledIconMenu extends HtmlMenu {
16 16
 
17 17
 
18 18
 	/**
19 19
 	 * @param string $identifier
20 20
 	 * @param array $items icons
21 21
 	 */
22
-	public function __construct( $identifier, $items=array()){
23
-		parent::__construct( $identifier, $items);
22
+	public function __construct($identifier, $items=array()) {
23
+		parent::__construct($identifier, $items);
24 24
 		$this->addToProperty("class", "labeled icon");
25 25
 	}
26 26
 
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 	protected function createItem($value) {
32 32
 		$text="";
33 33
 		$v=$value;
34
-		if(\is_array($value)){
34
+		if (\is_array($value)) {
35 35
 			$v=@$value[0];
36 36
 			$text=@$value[1];
37 37
 		}
38 38
 		$count=\sizeof($this->content);
39 39
 		$value=new HtmlIcon("icon-".$count, $v);
40
-		$value->wrap("",$text);
41
-		$itemO=new HtmlLink("item-".$count,"",$value);
40
+		$value->wrap("", $text);
41
+		$itemO=new HtmlLink("item-".$count, "", $value);
42 42
 		return $itemO->setClass("item");
43 43
 	}
44 44
 }
45 45
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/menus/HtmlIconMenu.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
  * @author jc
13 13
  * @version 1.001
14 14
  */
15
-class HtmlIconMenu extends HtmlMenu{
15
+class HtmlIconMenu extends HtmlMenu {
16 16
 
17 17
 
18 18
 	/**
19 19
 	 * @param string $identifier
20 20
 	 * @param array $items icons
21 21
 	 */
22
-	public function __construct( $identifier, $items=array()){
23
-		parent::__construct( $identifier, $items);
22
+	public function __construct($identifier, $items=array()) {
23
+		parent::__construct($identifier, $items);
24 24
 		$this->addToProperty("class", "icon");
25 25
 	}
26 26
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	protected function createItem($value) {
33 33
 		$count=\sizeof($this->content);
34 34
 		$value=new HtmlIcon("icon-".$count, $value);
35
-		$itemO=new HtmlLink("item-".$count,"",$value);
35
+		$itemO=new HtmlLink("item-".$count, "", $value);
36 36
 		return $itemO->setClass("item");
37 37
 	}
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormFields.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -20,6 +20,9 @@
 block discarded – undo
20 20
 	protected $_tabsType="tabs";
21 21
 	protected $stacked="";
22 22
 
23
+	/**
24
+	 * @param string $identifier
25
+	 */
23 26
 	public function __construct($identifier, $tagName="ul") {
24 27
 		parent::__construct($identifier, $tagName);
25 28
 		$this->_template="<%tagName% %properties%>%tabs%</%tagName%>%content%";
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -15,26 +15,26 @@  discard block
 block discarded – undo
15 15
 	protected $_equalWidth;
16 16
 	protected $_name;
17 17
 
18
-	public function __construct($identifier, $fields=array(),$equalWidth=true) {
18
+	public function __construct($identifier, $fields=array(), $equalWidth=true) {
19 19
 		parent::__construct($identifier, "div");
20 20
 		$this->_equalWidth=$equalWidth;
21 21
 		$this->addItems($fields);
22 22
 	}
23 23
 
24
-	public function addFields($fields=NULL,$label=NULL){
25
-		if(!$fields instanceof HtmlFormFields){
26
-			if(\is_array($fields)===false){
27
-				$fields = \func_get_args();
24
+	public function addFields($fields=NULL, $label=NULL) {
25
+		if (!$fields instanceof HtmlFormFields) {
26
+			if (\is_array($fields)===false) {
27
+				$fields=\func_get_args();
28 28
 				$end=\end($fields);
29
-				if(\is_string($end)){
29
+				if (\is_string($end)) {
30 30
 					$label=$end;
31 31
 					\array_pop($fields);
32 32
 				}else $label=NULL;
33 33
 			}
34 34
 		}
35
-		if(isset($label))
35
+		if (isset($label))
36 36
 			$this->setLabel($label);
37
-		foreach ($fields as $field){
37
+		foreach ($fields as $field) {
38 38
 			$this->addItem($field);
39 39
 		}
40 40
 		return $this;
@@ -44,40 +44,40 @@  discard block
 block discarded – undo
44 44
 	 * @param string|HtmlSemDoubleElement $label
45 45
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
46 46
 	 */
47
-	public function setLabel($label){
47
+	public function setLabel($label) {
48 48
 		$labelO=$label;
49
-		if(\is_string($label)){
50
-			$labelO=new HtmlSemDoubleElement("","label","",$label);
49
+		if (\is_string($label)) {
50
+			$labelO=new HtmlSemDoubleElement("", "label", "", $label);
51 51
 		}
52
-		$this->insertItem($labelO,0);
52
+		$this->insertItem($labelO, 0);
53 53
 		return $labelO;
54 54
 	}
55
-	public function addItem($item){
55
+	public function addItem($item) {
56 56
 		$item=parent::addItem($item);
57 57
 		$item->setContainer($this);
58 58
 		return $item;
59 59
 	}
60
-	public function compile(JsUtils $js=NULL,View $view=NULL){
61
-		if($this->_equalWidth){
60
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
61
+		if ($this->_equalWidth) {
62 62
 			$count=$this->count();
63 63
 			$this->addToProperty("class", Wide::getConstants()["W".$count]." fields");
64 64
 		}else
65
-			$this->addToProperty("class","fields");
66
-		return parent::compile($js,$view);
65
+			$this->addToProperty("class", "fields");
66
+		return parent::compile($js, $view);
67 67
 	}
68 68
 
69
-	public function setWidth($index,$width){
69
+	public function setWidth($index, $width) {
70 70
 		$this->_equalWidth=false;
71 71
 		return $this->getItem($index)->setWidth($width);
72 72
 	}
73 73
 
74
-	public function setInline(){
74
+	public function setInline() {
75 75
 		$this->_equalWidth=false;
76 76
 		$this->addToProperty("class", "inline");
77 77
 		return $this;
78 78
 	}
79 79
 
80
-	public function setGrouped(){
80
+	public function setGrouped() {
81 81
 		$this->_equalWidth=false;
82 82
 		$this->addToProperty("class", "grouped");
83 83
 	}
@@ -91,34 +91,34 @@  discard block
 block discarded – undo
91 91
 		return $this;
92 92
 	}
93 93
 
94
-	public static function radios($name,$items=array(),$label=NULL,$value=null,$type=NULL){
94
+	public static function radios($name, $items=array(), $label=NULL, $value=null, $type=NULL) {
95 95
 		$fields=array();
96 96
 		$i=0;
97
-		foreach ($items as $val=>$caption){
98
-			$itemO=new HtmlFormRadio($name."-".$i++,$name,$caption,$val,$type);
99
-			if($val===$value){
97
+		foreach ($items as $val=>$caption) {
98
+			$itemO=new HtmlFormRadio($name."-".$i++, $name, $caption, $val, $type);
99
+			if ($val===$value) {
100 100
 				$itemO->getInput()->getField()->setProperty("checked", "");
101 101
 			}
102 102
 			$fields[]=$itemO;
103 103
 		}
104
-		$radios=new HtmlFormFields("fields-".$name,$fields);
105
-		if(isset($label))
104
+		$radios=new HtmlFormFields("fields-".$name, $fields);
105
+		if (isset($label))
106 106
 			$radios->setLabel($label)->setProperty("for", $name);
107 107
 		return $radios;
108 108
 	}
109 109
 
110
-	public static function checkeds($name,$items=array(),$label=NULL,$values=array(),$type=NULL){
110
+	public static function checkeds($name, $items=array(), $label=NULL, $values=array(), $type=NULL) {
111 111
 		$fields=array();
112 112
 		$i=0;
113
-		foreach ($items as $val=>$caption){
114
-			$itemO=new HtmlFormCheckbox($name."-".$i++,$name,$caption,$val,$type);
115
-			if(\array_search($val, $values)!==false){
113
+		foreach ($items as $val=>$caption) {
114
+			$itemO=new HtmlFormCheckbox($name."-".$i++, $name, $caption, $val, $type);
115
+			if (\array_search($val, $values)!==false) {
116 116
 				$itemO->getInput()->getField()->setProperty("checked", "");
117 117
 			}
118 118
 			$fields[]=$itemO;
119 119
 		}
120
-		$radios=new HtmlFormFields("fields-".$name,$fields);
121
-		if(isset($label))
120
+		$radios=new HtmlFormFields("fields-".$name, $fields);
121
+		if (isset($label))
122 122
 			$radios->setLabel($label)->setProperty("for", $name);
123 123
 			return $radios;
124 124
 	}
Please login to merge, or discard this patch.
Braces   +15 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,11 +29,14 @@  discard block
 block discarded – undo
29 29
 				if(\is_string($end)){
30 30
 					$label=$end;
31 31
 					\array_pop($fields);
32
-				}else $label=NULL;
32
+				} else {
33
+					$label=NULL;
34
+				}
33 35
 			}
34 36
 		}
35
-		if(isset($label))
36
-			$this->setLabel($label);
37
+		if(isset($label)) {
38
+					$this->setLabel($label);
39
+		}
37 40
 		foreach ($fields as $field){
38 41
 			$this->addItem($field);
39 42
 		}
@@ -61,8 +64,9 @@  discard block
 block discarded – undo
61 64
 		if($this->_equalWidth){
62 65
 			$count=$this->count();
63 66
 			$this->addToProperty("class", Wide::getConstants()["W".$count]." fields");
64
-		}else
65
-			$this->addToProperty("class","fields");
67
+		} else {
68
+					$this->addToProperty("class","fields");
69
+		}
66 70
 		return parent::compile($js,$view);
67 71
 	}
68 72
 
@@ -102,8 +106,9 @@  discard block
 block discarded – undo
102 106
 			$fields[]=$itemO;
103 107
 		}
104 108
 		$radios=new HtmlFormFields("fields-".$name,$fields);
105
-		if(isset($label))
106
-			$radios->setLabel($label)->setProperty("for", $name);
109
+		if(isset($label)) {
110
+					$radios->setLabel($label)->setProperty("for", $name);
111
+		}
107 112
 		return $radios;
108 113
 	}
109 114
 
@@ -118,8 +123,9 @@  discard block
 block discarded – undo
118 123
 			$fields[]=$itemO;
119 124
 		}
120 125
 		$radios=new HtmlFormFields("fields-".$name,$fields);
121
-		if(isset($label))
122
-			$radios->setLabel($label)->setProperty("for", $name);
126
+		if(isset($label)) {
127
+					$radios->setLabel($label)->setProperty("for", $name);
128
+		}
123 129
 			return $radios;
124 130
 	}
125 131
 
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlInput.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 class HtmlInput extends HtmlSingleElement {
9 9
 
10
-	public function __construct($identifier,$type="text",$value=NULL,$placeholder=NULL) {
10
+	public function __construct($identifier, $type="text", $value=NULL, $placeholder=NULL) {
11 11
 		parent::__construct($identifier, "input");
12 12
 		$this->setProperty("name", $identifier);
13 13
 		$this->setValue($value);
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	}
17 17
 
18 18
 	public function setValue($value) {
19
-		if(isset($value))
19
+		if (isset($value))
20 20
 		$this->setProperty("value", $value);
21 21
 		return $this;
22 22
 	}
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 		return $this->setProperty("type", $value);
26 26
 	}
27 27
 
28
-	public function setPlaceholder($value){
29
-		if(JString::isNotNull($value))
28
+	public function setPlaceholder($value) {
29
+		if (JString::isNotNull($value))
30 30
 			$this->setProperty("placeholder", $value);
31 31
 		return $this;
32 32
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@  discard block
 block discarded – undo
16 16
 	}
17 17
 
18 18
 	public function setValue($value) {
19
-		if(isset($value))
20
-		$this->setProperty("value", $value);
19
+		if(isset($value)) {
20
+				$this->setProperty("value", $value);
21
+		}
21 22
 		return $this;
22 23
 	}
23 24
 
@@ -26,8 +27,9 @@  discard block
 block discarded – undo
26 27
 	}
27 28
 
28 29
 	public function setPlaceholder($value){
29
-		if(JString::isNotNull($value))
30
-			$this->setProperty("placeholder", $value);
30
+		if(JString::isNotNull($value)) {
31
+					$this->setProperty("placeholder", $value);
32
+		}
31 33
 		return $this;
32 34
 	}
33 35
 }
34 36
\ No newline at end of file
Please login to merge, or discard this patch.