Completed
Push — master ( b49918...3cf661 )
by Jean-Christophe
03:33
created
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   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,22 +12,22 @@
 block discarded – undo
12 12
 	use FieldsTrait;
13 13
 	protected $_equalWidth;
14 14
 
15
-	public function __construct($identifier, $fields=array(),$equalWidth=true) {
15
+	public function __construct($identifier, $fields=array(), $equalWidth=true) {
16 16
 		parent::__construct($identifier, "div");
17 17
 		$this->_equalWidth=$equalWidth;
18 18
 		$this->addItems($fields);
19 19
 	}
20 20
 
21
-	public function compile(JsUtils $js=NULL,View $view=NULL){
22
-		if($this->_equalWidth){
21
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
22
+		if ($this->_equalWidth) {
23 23
 			$count=$this->count();
24
-			$this->setClass( Wide::getConstants()["W".$count]." fields");
24
+			$this->setClass(Wide::getConstants()["W".$count]." fields");
25 25
 		}else
26 26
 			$this->setClass("fields");
27
-		return parent::compile($js,$view);
27
+		return parent::compile($js, $view);
28 28
 	}
29 29
 
30
-	public function setWidth($index,$width){
30
+	public function setWidth($index, $width) {
31 31
 		$this->_equalWidth=false;
32 32
 		return $this->getItem($index)->setWidth($width);
33 33
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@
 block discarded – undo
22 22
 		if($this->_equalWidth){
23 23
 			$count=$this->count();
24 24
 			$this->setClass( Wide::getConstants()["W".$count]." fields");
25
-		}else
26
-			$this->setClass("fields");
25
+		} else {
26
+					$this->setClass("fields");
27
+		}
27 28
 		return parent::compile($js,$view);
28 29
 	}
29 30
 
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.
Ajax/semantic/html/collections/form/HtmlFormDropdown.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
 
8 8
 class HtmlFormDropdown extends HtmlFormField {
9 9
 
10
-	public function __construct($identifier,$items=array(), $label=NULL,$value=NULL,$multiple=false) {
11
-		parent::__construct("field-".$identifier, (new HtmlDropdown("dropdown-".$identifier,$value,$items))->asSelect($identifier,$multiple), $label);
10
+	public function __construct($identifier, $items=array(), $label=NULL, $value=NULL, $multiple=false) {
11
+		parent::__construct("field-".$identifier, (new HtmlDropdown("dropdown-".$identifier, $value, $items))->asSelect($identifier, $multiple), $label);
12 12
 	}
13 13
 
14
-	public function setItems($items){
14
+	public function setItems($items) {
15 15
 		return $this->getField()->setItems($items);
16 16
 	}
17
-	public function addItem($item,$value=NULL,$image=NULL){
18
-		return $this->getField()->addItem($item,$value,$image);
17
+	public function addItem($item, $value=NULL, $image=NULL) {
18
+		return $this->getField()->addItem($item, $value, $image);
19 19
 	}
20
-	public static function multipleDropdown($identifier,$items=array(), $label=NULL,$value=NULL){
21
-		return new HtmlFormDropdown($identifier,$items,$label,$value,true);
20
+	public static function multipleDropdown($identifier, $items=array(), $label=NULL, $value=NULL) {
21
+		return new HtmlFormDropdown($identifier, $items, $label, $value, true);
22 22
 	}
23 23
 }
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlForm.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,52 +10,52 @@
 block discarded – undo
10 10
  * @author jc
11 11
  * @version 1.001
12 12
  */
13
-class HtmlForm extends HtmlSemCollection{
13
+class HtmlForm extends HtmlSemCollection {
14 14
 
15 15
 	use FieldsTrait;
16 16
 
17 17
 	protected $_fields;
18 18
 
19
-	public function __construct( $identifier, $elements=array()){
20
-		parent::__construct( $identifier, "form", "ui form");
19
+	public function __construct($identifier, $elements=array()) {
20
+		parent::__construct($identifier, "form", "ui form");
21 21
 		$this->setProperty("name", $this->identifier);
22 22
 		$this->_fields=array();
23 23
 		$this->addItems($elements);
24 24
 	}
25 25
 
26
-	public function addHeader($title,$niveau=1,$dividing=true){
27
-		$header=new HtmlHeader("",$niveau,$title);
28
-		if($dividing)
26
+	public function addHeader($title, $niveau=1, $dividing=true) {
27
+		$header=new HtmlHeader("", $niveau, $title);
28
+		if ($dividing)
29 29
 			$header->setDividing();
30 30
 		return $this->addItem($header);
31 31
 	}
32 32
 
33
-	public function addFields($fields,$label=NULL){
34
-		if(\is_array($fields)===false){
35
-			$fields = \func_get_args();
33
+	public function addFields($fields, $label=NULL) {
34
+		if (\is_array($fields)===false) {
35
+			$fields=\func_get_args();
36 36
 			$end=\end($fields);
37
-			if(\is_string($end)){
37
+			if (\is_string($end)) {
38 38
 				$label=$end;
39 39
 				\array_pop($fields);
40 40
 			}
41 41
 		}
42
-		$this->_fields=\array_merge($this->_fields,$fields);
43
-		$field=new HtmlFormField("", new HtmlFormFields("fields-".$this->identifier."-".$this->count(),$fields),$label);
42
+		$this->_fields=\array_merge($this->_fields, $fields);
43
+		$field=new HtmlFormField("", new HtmlFormFields("fields-".$this->identifier."-".$this->count(), $fields), $label);
44 44
 		return $this->addItem($field);
45 45
 	}
46 46
 
47
-	public function addItem($item){
47
+	public function addItem($item) {
48 48
 		$item=parent::addItem($item);
49
-		if(\is_subclass_of($item, HtmlFormField::class)===true){
49
+		if (\is_subclass_of($item, HtmlFormField::class)===true) {
50 50
 			$this->_fields[]=$item;
51 51
 		}
52 52
 		return $item;
53 53
 	}
54 54
 
55
-	public function getField($index){
56
-		if(\is_string($index)){
55
+	public function getField($index) {
56
+		if (\is_string($index)) {
57 57
 			$field=$this->getElementById($index, $this->_fields);
58
-		}else{
58
+		}else {
59 59
 			$field=$this->_fields[$index];
60 60
 		}
61 61
 		return $field;
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,8 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 	public function addHeader($title,$niveau=1,$dividing=true){
27 27
 		$header=new HtmlHeader("",$niveau,$title);
28
-		if($dividing)
29
-			$header->setDividing();
28
+		if($dividing) {
29
+					$header->setDividing();
30
+		}
30 31
 		return $this->addItem($header);
31 32
 	}
32 33
 
@@ -55,7 +56,7 @@  discard block
 block discarded – undo
55 56
 	public function getField($index){
56 57
 		if(\is_string($index)){
57 58
 			$field=$this->getElementById($index, $this->_fields);
58
-		}else{
59
+		} else{
59 60
 			$field=$this->_fields[$index];
60 61
 		}
61 62
 		return $field;
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormInput.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
 
8 8
 class HtmlFormInput extends HtmlFormField {
9 9
 
10
-	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
11
-		if(!isset($placeholder))
10
+	public function __construct($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) {
11
+		if (!isset($placeholder))
12 12
 			$placeholder=$label;
13
-		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
13
+		parent::__construct("field-".$identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label);
14 14
 	}
15 15
 
16
-	public function setPlaceholder($value){
16
+	public function setPlaceholder($value) {
17 17
 		return $this->getField()->setPlaceholder($value);
18 18
 	}
19 19
 
20
-	public function setValue($value){
20
+	public function setValue($value) {
21 21
 		return $this->getField()->setValue($value);
22 22
 	}
23 23
 }
24 24
\ 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
@@ -8,8 +8,9 @@
 block discarded – undo
8 8
 class HtmlFormInput extends HtmlFormField {
9 9
 
10 10
 	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
11
-		if(!isset($placeholder))
12
-			$placeholder=$label;
11
+		if(!isset($placeholder)) {
12
+					$placeholder=$label;
13
+		}
13 14
 		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
14 15
 	}
15 16
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/FieldsTrait.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
4 4
 
5 5
 use Ajax\service\JArray;
6 6
 trait FieldsTrait {
7
-	protected function createItem($value){
8
-		if(\is_array($value)){
9
-			$itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null)));
7
+	protected function createItem($value) {
8
+		if (\is_array($value)) {
9
+			$itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id", ""), JArray::getDefaultValue($value, "label", null), JArray::getDefaultValue($value, "type", "text"), JArray::getDefaultValue($value, "value", ""), JArray::getDefaultValue($value, "placeholder", JArray::getDefaultValue($value, "label", null)));
10 10
 			return $itemO;
11 11
 		}else
12 12
 			return new HtmlFormInput($value);
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,8 @@
 block discarded – undo
8 8
 		if(\is_array($value)){
9 9
 			$itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null)));
10 10
 			return $itemO;
11
-		}else
12
-			return new HtmlFormInput($value);
11
+		} else {
12
+					return new HtmlFormInput($value);
13
+		}
13 14
 	}
14 15
 }
15 16
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormCheckbox.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,21 +12,21 @@
 block discarded – undo
12 12
  */
13 13
 class HtmlFormCheckbox extends HtmlFormInput {
14 14
 
15
-	public function __construct($identifier, $label=NULL,$value=NULL,$type=NULL) {
15
+	public function __construct($identifier, $label=NULL, $value=NULL, $type=NULL) {
16 16
 		parent::__construct($identifier, $label, "checkbox", $value=NULL);
17
-		if(isset($label)){
17
+		if (isset($label)) {
18 18
 			$this->swapLabel();
19 19
 			$label=$this->getLabel();
20 20
 			$label->setClass="hidden";
21
-			$label->setProperty("tabindex",0);
21
+			$label->setProperty("tabindex", 0);
22 22
 		}
23 23
 		$this->setClass("ui checkbox");
24
-		if(isset($type))
24
+		if (isset($type))
25 25
 			$this->setType($type);
26
-		$this->wrap("<div class='field'>","</div>");
26
+		$this->wrap("<div class='field'>", "</div>");
27 27
 	}
28 28
 
29
-	public function setType($checkboxType){
29
+	public function setType($checkboxType) {
30 30
 		return $this->addToPropertyCtrl("class", $checkboxType, CheckboxType::getConstants());
31 31
 	}
32 32
 }
33 33
\ 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
@@ -21,8 +21,9 @@
 block discarded – undo
21 21
 			$label->setProperty("tabindex",0);
22 22
 		}
23 23
 		$this->setClass("ui checkbox");
24
-		if(isset($type))
25
-			$this->setType($type);
24
+		if(isset($type)) {
25
+					$this->setType($type);
26
+		}
26 27
 		$this->wrap("<div class='field'>","</div>");
27 28
 	}
28 29
 
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/CheckboxType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,5 +5,5 @@
 block discarded – undo
5 5
 use Ajax\common\BaseEnum;
6 6
 
7 7
 abstract class CheckboxType extends BaseEnum {
8
-	const STANDARD="",TOGGLE="toggle",SLIDER="slider";
8
+	const STANDARD="", TOGGLE="toggle", SLIDER="slider";
9 9
 }
10 10
\ No newline at end of file
Please login to merge, or discard this patch.