Completed
Push — master ( 2ffc14...238349 )
by Jean-Christophe
02:59
created
Ajax/semantic/html/collections/form/traits/FieldTrait.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 	abstract public function addToProperty($name, $value, $separator=" ");
21 21
 	abstract public function addLabel($caption, $style="label-default", $leftSeparator=" ");
22
-	abstract public function addContent($content,$before=false);
22
+	abstract public function addContent($content, $before=false);
23 23
 	abstract public function getField();
24 24
 	abstract public function getDataField();
25 25
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	}
29 29
 
30 30
 	public function addLoading() {
31
-		if ($this->_hasIcon === false) {
31
+		if ($this->_hasIcon===false) {
32 32
 			throw new \Exception("Input must have an icon for showing a loader, use addIcon before");
33 33
 		}
34 34
 		return $this->addToProperty("class", State::LOADING);
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function labeled($label, $direction=Direction::LEFT, $icon=NULL) {
44 44
 		$field=$this->getField();
45
-		$labelO=$field->addLabel($label,$direction===Direction::LEFT,$icon);
46
-		$field->addToProperty("class", $direction . " labeled");
45
+		$labelO=$field->addLabel($label, $direction===Direction::LEFT, $icon);
46
+		$field->addToProperty("class", $direction." labeled");
47 47
 		return $labelO;
48 48
 	}
49 49
 
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 	 * @param string $checkboxType
55 55
 	 * @return HtmlLabel
56 56
 	 */
57
-	public function labeledCheckbox($direction=Direction::LEFT,$caption="",$value=NULL,$checkboxType=NULL){
58
-		return $this->labeled(new HtmlCheckbox("lbl-ck-".$this->getField()->getIdentifier(),$caption,$value,$checkboxType),$direction);
57
+	public function labeledCheckbox($direction=Direction::LEFT, $caption="", $value=NULL, $checkboxType=NULL) {
58
+		return $this->labeled(new HtmlCheckbox("lbl-ck-".$this->getField()->getIdentifier(), $caption, $value, $checkboxType), $direction);
59 59
 	}
60 60
 
61 61
 	/**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 * @return HtmlLabel
65 65
 	 */
66 66
 	public function labeledToCorner($icon, $direction=Direction::LEFT) {
67
-		return $this->labeled("", $direction . " corner", $icon)->toCorner($direction);
67
+		return $this->labeled("", $direction." corner", $icon)->toCorner($direction);
68 68
 	}
69 69
 
70 70
 	/**
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
 	public function addAction($action, $direction=Direction::RIGHT, $icon=NULL, $labeled=false) {
78 78
 		$field=$this->getField();
79 79
 		$actionO=$action;
80
-		if (\is_object($action) === false) {
81
-			$actionO=new HtmlButton("action-" . $this->identifier, $action);
80
+		if (\is_object($action)===false) {
81
+			$actionO=new HtmlButton("action-".$this->identifier, $action);
82 82
 			if (isset($icon))
83 83
 				$actionO->addIcon($icon, true, $labeled);
84 84
 		}
85
-		$field->addToProperty("class", $direction . " action");
86
-		$field->addContent($actionO, \strstr($direction, Direction::LEFT) !== false);
85
+		$field->addToProperty("class", $direction." action");
86
+		$field->addContent($actionO, \strstr($direction, Direction::LEFT)!==false);
87 87
 		return $actionO;
88 88
 	}
89 89
 
@@ -93,34 +93,34 @@  discard block
 block discarded – undo
93 93
 	 * @param string $direction
94 94
 	 * @return HtmlLabel
95 95
 	 */
96
-	public function addDropdown($label="", $items=array(),$direction=Direction::RIGHT){
97
-		$labelO=new HtmlDropdown("dd-".$this->identifier,$label,$items);
98
-		$labelO->asSelect("select-".$this->identifier,false,true);
99
-		return $this->labeled($labelO,$direction);
96
+	public function addDropdown($label="", $items=array(), $direction=Direction::RIGHT) {
97
+		$labelO=new HtmlDropdown("dd-".$this->identifier, $label, $items);
98
+		$labelO->asSelect("select-".$this->identifier, false, true);
99
+		return $this->labeled($labelO, $direction);
100 100
 	}
101 101
 
102 102
 	public function setTransparent() {
103 103
 		return $this->getField()->addToProperty("class", "transparent");
104 104
 	}
105 105
 
106
-	public function setReadonly(){
106
+	public function setReadonly() {
107 107
 		$this->getDataField()->setProperty("readonly", "");
108 108
 		return $this;
109 109
 	}
110 110
 
111
-	public function setName($name){
112
-		$this->getDataField()->setProperty("name",$name);
111
+	public function setName($name) {
112
+		$this->getDataField()->setProperty("name", $name);
113 113
 		return $this;
114 114
 	}
115 115
 
116
-	public function setFluid(){
117
-		$this->getField()->addToProperty("class","fluid");
116
+	public function setFluid() {
117
+		$this->getField()->addToProperty("class", "fluid");
118 118
 		return $this;
119 119
 	}
120 120
 
121 121
 	public function setDisabled($disable=true) {
122 122
 		$field=$this->getField();
123
-		if($disable)
123
+		if ($disable)
124 124
 			$field->addToProperty("class", "disabled");
125 125
 		return $this;
126 126
 	}
Please login to merge, or discard this patch.