Completed
Push — master ( e87f8c...8310f7 )
by Jean-Christophe
02:41
created
Ajax/semantic/html/base/HtmlSemDoubleElement.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	use BaseTrait;
23 23
 	protected $_popup=NULL;
24 24
 	protected $_dimmer=NULL;
25
-	protected $_params=array ();
25
+	protected $_params=array();
26 26
 
27 27
 
28 28
 	public function __construct($identifier, $tagName="p", $baseClass="ui", $content=NULL) {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * @return HtmlDimmer
79 79
 	 */
80 80
 	public function addDimmer($params=array(), $content=NULL) {
81
-		$dimmer=new HtmlDimmer("dimmer-" . $this->identifier, $content);
81
+		$dimmer=new HtmlDimmer("dimmer-".$this->identifier, $content);
82 82
 		$dimmer->setParams($params);
83 83
 		$dimmer->setContainer($this);
84 84
 		$this->addContent($dimmer);
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function addLabel($label, $before=false, $icon=NULL) {
96 96
 		$labelO=$label;
97
-		if (\is_object($label) === false) {
98
-			$labelO=new HtmlLabel("label-" . $this->identifier, $label);
97
+		if (\is_object($label)===false) {
98
+			$labelO=new HtmlLabel("label-".$this->identifier, $label);
99 99
 			if (isset($icon))
100 100
 				$labelO->addIcon($icon);
101 101
 		} else {
102
-			$labelO->addToPropertyCtrl("class", "label", array ("label" ));
102
+			$labelO->addToPropertyCtrl("class", "label", array("label"));
103 103
 		}
104 104
 		$this->addContent($labelO, $before);
105 105
 		return $labelO;
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 	 * @param string $icon
114 114
 	 * @return HtmlSemDoubleElement
115 115
 	 */
116
-	public function attachLabel($label,$side=Side::TOP,$direction=Direction::NONE,$icon=NULL){
117
-		$label=$this->addLabel($label,true,$icon);
118
-		$label->setAttached($side,$direction);
116
+	public function attachLabel($label, $side=Side::TOP, $direction=Direction::NONE, $icon=NULL) {
117
+		$label=$this->addLabel($label, true, $icon);
118
+		$label->setAttached($side, $direction);
119 119
 		return $this;
120 120
 	}
121 121
 
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
 	 * Transforms the element into a link
124 124
 	 * @return HtmlSemDoubleElement
125 125
 	 */
126
-	public function asLink($href=NULL,$target=NULL) {
126
+	public function asLink($href=NULL, $target=NULL) {
127 127
 		if (isset($href))
128 128
 			$this->setProperty("href", $href);
129
-		if(isset($target))
129
+		if (isset($target))
130 130
 			$this->setProperty("target", $target);
131 131
 		return $this->setTagName("a");
132 132
 	}
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function jsShowDimmer($show=true) {
140 140
 		$status="hide";
141
-		if ($show === true)
141
+		if ($show===true)
142 142
 			$status="show";
143
-		return '$("#.' . $this->identifier . ').dimmer("' . $status . '");';
143
+		return '$("#.'.$this->identifier.').dimmer("'.$status.'");';
144 144
 	}
145 145
 
146 146
 	/**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * @see HtmlDoubleElement::run()
159 159
 	 */
160 160
 	public function run(JsUtils $js) {
161
-		$this->_bsComponent=$js->semantic()->generic("#" . $this->identifier);
161
+		$this->_bsComponent=$js->semantic()->generic("#".$this->identifier);
162 162
 		parent::run($js);
163 163
 		$this->addEventsOnRun($js);
164 164
 		if (isset($this->_popup)) {
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 		return $this->_bsComponent;
168 168
 	}
169 169
 
170
-	public function addList($elements,$ordered=false){
171
-		$list=new HtmlList("list-".$this->identifier,$elements);
170
+	public function addList($elements, $ordered=false) {
171
+		$list=new HtmlList("list-".$this->identifier, $elements);
172 172
 		$list->setOrdered($ordered);
173 173
 		$list->setClass("ui list");
174 174
 		$this->addContent($list);
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlMessage.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @version 1.001
16 16
  */
17 17
 class HtmlMessage extends HtmlSemDoubleElement {
18
-	use AttachedTrait,HasTimeoutTrait;
18
+	use AttachedTrait, HasTimeoutTrait;
19 19
 	protected $icon;
20 20
 	protected $close;
21 21
 
@@ -32,35 +32,35 @@  discard block
 block discarded – undo
32 32
 	 * @param string|HtmlSemDoubleElement $header
33 33
 	 * @return \Ajax\semantic\html\collections\HtmlMessage
34 34
 	 */
35
-	public function addHeader($header){
35
+	public function addHeader($header) {
36 36
 		$headerO=$header;
37
-		if(\is_string($header)){
38
-			$headerO=new HtmlSemDoubleElement("header-".$this->identifier,"div");
37
+		if (\is_string($header)) {
38
+			$headerO=new HtmlSemDoubleElement("header-".$this->identifier, "div");
39 39
 			$headerO->setClass("header");
40 40
 			$headerO->setContent($header);
41 41
 		}
42
-		return $this->addContent($headerO,true);
42
+		return $this->addContent($headerO, true);
43 43
 	}
44 44
 
45
-	public function setHeader($header){
45
+	public function setHeader($header) {
46 46
 		return $this->addHeader($header);
47 47
 	}
48 48
 
49
-	public function setIcon($icon){
49
+	public function setIcon($icon) {
50 50
 		$this->addToProperty("class", "icon");
51
-		$this->wrapContent("<div class='content'>","</div>");
51
+		$this->wrapContent("<div class='content'>", "</div>");
52 52
 		$this->icon=new HtmlIcon("icon-".$this->identifier, $icon);
53 53
 		return $this;
54 54
 	}
55 55
 
56
-	public function addLoader($loaderIcon="notched circle"){
56
+	public function addLoader($loaderIcon="notched circle") {
57 57
 		$this->setIcon($loaderIcon);
58 58
 		$this->icon->addToIcon("loading");
59 59
 		return $this;
60 60
 	}
61 61
 
62
-	public function setDismissable($dismiss=true){
63
-		if($dismiss===true)
62
+	public function setDismissable($dismiss=true) {
63
+		if ($dismiss===true)
64 64
 			$this->close=new HtmlIcon("close-".$this->identifier, "close");
65 65
 		else
66 66
 			$this->close=NULL;
@@ -71,43 +71,43 @@  discard block
 block discarded – undo
71 71
 	 * {@inheritDoc}
72 72
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
73 73
 	 */
74
-	public function run(JsUtils $js){
75
-		if(!isset($this->_bsComponent)){
76
-			if(isset($this->close)){
74
+	public function run(JsUtils $js) {
75
+		if (!isset($this->_bsComponent)) {
76
+			if (isset($this->close)) {
77 77
 				$js->execOn("click", "#".$this->identifier." .close", "$(this).closest('.message').transition({$this->_closeTransition})");
78 78
 			}
79
-			if(isset($this->_timeout)){
80
-				$js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});",true);
79
+			if (isset($this->_timeout)) {
80
+				$js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});", true);
81 81
 			}
82 82
 		}
83 83
 		return parent::run($js);
84 84
 	}
85 85
 
86
-	public function setState($visible=true){
87
-		$visible=($visible===true)?"visible":"hidden";
88
-		return $this->addToPropertyCtrl("class", $visible, array("visible","hidden"));
86
+	public function setState($visible=true) {
87
+		$visible=($visible===true) ? "visible" : "hidden";
88
+		return $this->addToPropertyCtrl("class", $visible, array("visible", "hidden"));
89 89
 	}
90 90
 
91
-	public function setVariation($value="floating"){
92
-		return $this->addToPropertyCtrl("class", $value, array("floating","compact"));
91
+	public function setVariation($value="floating") {
92
+		return $this->addToPropertyCtrl("class", $value, array("floating", "compact"));
93 93
 	}
94 94
 
95
-	public function setStyle($style){
95
+	public function setStyle($style) {
96 96
 		return $this->addToPropertyCtrl("class", $style, Style::getConstants());
97 97
 	}
98 98
 
99
-	public function setError(){
99
+	public function setError() {
100 100
 		return $this->setStyle("error");
101 101
 	}
102 102
 
103
-	public function setWarning(){
103
+	public function setWarning() {
104 104
 		return $this->setStyle("warning");
105 105
 	}
106 106
 
107
-	public function setMessage($message){
108
-		if(\is_array($this->content)){
107
+	public function setMessage($message) {
108
+		if (\is_array($this->content)) {
109 109
 			$this->content[\sizeof($this->content)-1]=$message;
110
-		}else
110
+		} else
111 111
 			$this->setContent($message);
112 112
 	}
113 113
 
Please login to merge, or discard this patch.