Completed
Push — master ( 73e21a...085edf )
by Jean-Christophe
04:37
created
Ajax/semantic/html/base/HtmlSemDoubleElement.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 
50 50
 	public function addDimmer($params=array(), $content=NULL) {
51
-		$dimmer=new HtmlDimmer("dimmer-" . $this->identifier, $content);
51
+		$dimmer=new HtmlDimmer("dimmer-".$this->identifier, $content);
52 52
 		$dimmer->setParams($params);
53 53
 		$dimmer->setContainer($this);
54 54
 		$this->addContent($dimmer);
@@ -57,20 +57,20 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function addLabel($label, $before=false, $icon=NULL) {
59 59
 		$labelO=$label;
60
-		if (\is_object($label) === false) {
61
-			$labelO=new HtmlLabel("label-" . $this->identifier, $label);
60
+		if (\is_object($label)===false) {
61
+			$labelO=new HtmlLabel("label-".$this->identifier, $label);
62 62
 			if (isset($icon))
63 63
 				$labelO->addIcon($icon);
64
-		} else {
65
-			$labelO->addToPropertyCtrl("class", "label", array ("label" ));
64
+		}else {
65
+			$labelO->addToPropertyCtrl("class", "label", array("label"));
66 66
 		}
67 67
 		$this->addContent($labelO, $before);
68 68
 		return $labelO;
69 69
 	}
70 70
 
71
-	public function attachLabel($label,$side,$direction=Direction::NONE,$icon=NULL){
72
-		$label=$this->addLabel($label,true,$icon);
73
-		$label->setAttached($side,$direction);
71
+	public function attachLabel($label, $side, $direction=Direction::NONE, $icon=NULL) {
72
+		$label=$this->addLabel($label, true, $icon);
73
+		$label->setAttached($side, $direction);
74 74
 		return $this;
75 75
 	}
76 76
 
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
 
87 87
 	public function jsShowDimmer($show=true) {
88 88
 		$status="hide";
89
-		if ($show === true)
89
+		if ($show===true)
90 90
 			$status="show";
91
-		return '$("#.' . $this->identifier . ').dimmer("' . $status . '");';
91
+		return '$("#.'.$this->identifier.').dimmer("'.$status.'");';
92 92
 	}
93 93
 
94 94
 	public function compile(JsUtils $js=NULL, $view=NULL) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	}
99 99
 
100 100
 	public function run(JsUtils $js) {
101
-		$this->_bsComponent=$js->semantic()->generic("#" . $this->identifier);
101
+		$this->_bsComponent=$js->semantic()->generic("#".$this->identifier);
102 102
 		parent::run($js);
103 103
 		$this->addEventsOnRun($js);
104 104
 		if (isset($this->_popup)) {
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/Size.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,5 +2,5 @@
 block discarded – undo
2 2
 namespace Ajax\semantic\html\base\constants;
3 3
 	use Ajax\common\BaseEnum;
4 4
 abstract class Size extends BaseEnum {
5
-	const MASSIVE="massive",HUGE="huge",BIG="big",LARGE="large",MEDIUM="",SMALL="small",TINY="tiny",MINI="mini";
5
+	const MASSIVE="massive", HUGE="huge", BIG="big", LARGE="large", MEDIUM="", SMALL="small", TINY="tiny", MINI="mini";
6 6
 }
7 7
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/Direction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,5 +2,5 @@
 block discarded – undo
2 2
 namespace Ajax\semantic\html\base\constants;
3 3
 	use Ajax\common\BaseEnum;
4 4
 abstract class Direction extends BaseEnum {
5
-	const RIGHT="right", LEFT="left",DOWN="down",UP="up",NONE="",BELOW="below";
5
+	const RIGHT="right", LEFT="left", DOWN="down", UP="up", NONE="", BELOW="below";
6 6
 }
7 7
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlMenuItem.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,27 +9,27 @@
 block discarded – undo
9 9
 class HtmlMenuItem extends HtmlAbsractItem {
10 10
 
11 11
 	public function __construct($identifier, $content) {
12
-		parent::__construct($identifier,"item",$content);
12
+		parent::__construct($identifier, "item", $content);
13 13
 	}
14 14
 
15
-	protected function initContent($content){
16
-		if(\is_array($content)){
17
-			if(JArray::isAssociative($content)===false){
15
+	protected function initContent($content) {
16
+		if (\is_array($content)) {
17
+			if (JArray::isAssociative($content)===false) {
18 18
 				$icon=@$content[0];
19 19
 				$title=@$content[1];
20 20
 				$desc=@$content[2];
21
-			}else{
21
+			}else {
22 22
 				$icon=@$content["icon"];
23 23
 				$title=@$content["title"];
24 24
 				$desc=@$content["description"];
25 25
 			}
26
-			if(isset($icon)===true){
26
+			if (isset($icon)===true) {
27 27
 				$this->setIcon($icon);
28 28
 			}
29
-			if(isset($title)===true){
30
-				$this->setTitle($title,$desc);
29
+			if (isset($title)===true) {
30
+				$this->setTitle($title, $desc);
31 31
 			}
32
-		}else{
32
+		}else {
33 33
 			$this->setContent($content);
34 34
 		}
35 35
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlStepItem.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,48 +8,48 @@
 block discarded – undo
8 8
 class HtmlStepItem extends HtmlAbsractItem {
9 9
 
10 10
 	public function __construct($identifier, $content) {
11
-		parent::__construct($identifier,"step",$content);
11
+		parent::__construct($identifier, "step", $content);
12 12
 	}
13
-	protected function initContent($content){
14
-		if(\is_array($content)){
15
-			if(JArray::isAssociative($content)===false){
13
+	protected function initContent($content) {
14
+		if (\is_array($content)) {
15
+			if (JArray::isAssociative($content)===false) {
16 16
 				$icon=@$content[0];
17 17
 				$title=@$content[1];
18 18
 				$desc=@$content[2];
19 19
 				$status=@$content[3];
20
-			}else{
20
+			}else {
21 21
 				$icon=@$content["icon"];
22 22
 				$title=@$content["title"];
23 23
 				$desc=@$content["description"];
24 24
 				$status=@$content["status"];
25 25
 			}
26
-			if(isset($icon)===true){
26
+			if (isset($icon)===true) {
27 27
 				$this->setIcon($icon);
28 28
 			}
29
-			if(isset($status)===true){
29
+			if (isset($status)===true) {
30 30
 				$this->setStatus($status);
31 31
 			}
32
-			if(isset($title)===true){
33
-				$this->setTitle($title,$desc);
32
+			if (isset($title)===true) {
33
+				$this->setTitle($title, $desc);
34 34
 			}
35
-		}else{
35
+		}else {
36 36
 			$this->setContent($content);
37 37
 		}
38 38
 	}
39 39
 
40
-	public function setActive(){
40
+	public function setActive() {
41 41
 		return $this->setStatus(StepStatus::ACTIVE);
42 42
 	}
43 43
 
44
-	public function setCompleted(){
44
+	public function setCompleted() {
45 45
 		return $this->setStatus(StepStatus::COMPLETED);
46 46
 	}
47 47
 
48
-	public function setStatus($status){
48
+	public function setStatus($status) {
49 49
 		return $this->addToPropertyCtrl("class", $status, StepStatus::getConstants());
50 50
 	}
51 51
 
52
-	public function removeStatus(){
52
+	public function removeStatus() {
53 53
 		$this->removePropertyValues("class", StepStatus::getConstants());
54 54
 	}
55 55
 }
56 56
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlListItem.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@  discard block
 block discarded – undo
9 9
 	protected $image;
10 10
 
11 11
 	public function __construct($identifier, $content=NULL) {
12
-		parent::__construct($identifier,"item",$content);
12
+		parent::__construct($identifier, "item", $content);
13 13
 	}
14
-	protected function initContent($content){
15
-		if(\is_array($content)){
16
-			if(JArray::isAssociative($content)===false){
14
+	protected function initContent($content) {
15
+		if (\is_array($content)) {
16
+			if (JArray::isAssociative($content)===false) {
17 17
 				$icon=@$content[0];
18 18
 				$title=@$content[1];
19 19
 				$desc=@$content[2];
20
-			}else{
20
+			}else {
21 21
 				$icon=@$content["icon"];
22 22
 				$image=@$content["image"];
23 23
 				$title=@$content["title"];
@@ -25,21 +25,21 @@  discard block
 block discarded – undo
25 25
 				$desc=@$content["description"];
26 26
 				$items=@$content["items"];
27 27
 			}
28
-			if(isset($icon)===true){
28
+			if (isset($icon)===true) {
29 29
 				$this->setIcon($icon);
30 30
 			}
31
-			if(isset($image)===true){
31
+			if (isset($image)===true) {
32 32
 				$this->setImage($image);
33 33
 			}
34
-			if(isset($title)===true){
35
-				$this->setTitle($title,$desc);
36
-			}elseif (isset($header)===true){
37
-				$this->setTitle($header,$desc,"header");
34
+			if (isset($title)===true) {
35
+				$this->setTitle($title, $desc);
36
+			}elseif (isset($header)===true) {
37
+				$this->setTitle($header, $desc, "header");
38 38
 			}
39
-			if(isset($items)===true){
39
+			if (isset($items)===true) {
40 40
 				$this->addList($items);
41 41
 			}
42
-		}else{
42
+		}else {
43 43
 			$this->setContent($content);
44 44
 		}
45 45
 	}
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 		return $list;
51 51
 	}
52 52
 
53
-	public function getList(){
53
+	public function getList() {
54 54
 		return $this->content["list"];
55 55
 	}
56 56
 
57
-	public function getItem($index){
57
+	public function getItem($index) {
58 58
 		return $this->getList()->getItem($index);
59 59
 	}
60 60
 }
61 61
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAbsractItem.php 1 patch
Spacing   +17 added lines, -17 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,48 +19,48 @@  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(){
55
+	public function setActive() {
56 56
 		$this->setTagName("div");
57 57
 		$this->removeProperty("href");
58 58
 		return $this->addToPropertyCtrl("class", "active", array("active"));
59 59
 	}
60 60
 
61
-	public function asLink($href=NULL,$part=NULL){
61
+	public function asLink($href=NULL, $part=NULL) {
62 62
 		$this->setTagName("a");
63
-		if(isset($href))
63
+		if (isset($href))
64 64
 			$this->setProperty("href", $href);
65 65
 		return $this;
66 66
 	}
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
73 73
 	 */
74 74
 	public function compile(JsUtils $js=NULL, $view=NULL) {
75
-		if(\is_array($this->content))
76
-			$this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]);
75
+		if (\is_array($this->content))
76
+			$this->content=JArray::sortAssociative($this->content, ["icon", "image", "content"]);
77 77
 		return parent::compile($js, $view);
78 78
 	}
79 79
 }
80 80
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAccordionItem.php 1 patch
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=NULL){
39
+	public function compile(JsUtils $js=NULL, $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.
Ajax/semantic/html/collections/form/HtmlFormField.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -10,33 +10,33 @@  discard block
 block discarded – undo
10 10
 
11 11
 class HtmlFormField extends HtmlSemDoubleElement {
12 12
 	protected $_container;
13
-	public function __construct($identifier, $field,$label=NULL) {
14
-		parent::__construct($identifier, "div","field");
13
+	public function __construct($identifier, $field, $label=NULL) {
14
+		parent::__construct($identifier, "div", "field");
15 15
 		$this->content=array();
16
-		$this->_states=[State::ERROR,State::DISABLED];
17
-		if(isset($label))
16
+		$this->_states=[State::ERROR, State::DISABLED];
17
+		if (isset($label))
18 18
 			$this->setLabel($label);
19 19
 		$this->setField($field);
20 20
 	}
21 21
 
22
-	public function addPointingLabel($label,$pointing=Direction::NONE){
23
-		$labelO=new HtmlLabel("",$label);
22
+	public function addPointingLabel($label, $pointing=Direction::NONE) {
23
+		$labelO=new HtmlLabel("", $label);
24 24
 		$labelO->setPointing($pointing);
25
-		$this->addContent($labelO,$pointing==="below" || $pointing==="right");
25
+		$this->addContent($labelO, $pointing==="below" || $pointing==="right");
26 26
 		return $labelO;
27 27
 	}
28 28
 
29
-	public function setLabel($label){
29
+	public function setLabel($label) {
30 30
 		$labelO=$label;
31
-		if(\is_string($label)){
32
-			$labelO=new HtmlSemDoubleElement("","label","");
31
+		if (\is_string($label)) {
32
+			$labelO=new HtmlSemDoubleElement("", "label", "");
33 33
 			$labelO->setContent($label);
34
-			$labelO->setProperty("for", \str_replace("field-", "",$this->identifier));
34
+			$labelO->setProperty("for", \str_replace("field-", "", $this->identifier));
35 35
 		}
36 36
 		$this->content["label"]=$labelO;
37 37
 	}
38 38
 
39
-	public function setField($field){
39
+	public function setField($field) {
40 40
 		$this->content["field"]=$field;
41 41
 	}
42 42
 
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 	 * Returns the label or null
45 45
 	 * @return mixed
46 46
 	 */
47
-	public function getLabel(){
48
-		if(\array_key_exists("label", $this->content))
47
+	public function getLabel() {
48
+		if (\array_key_exists("label", $this->content))
49 49
 			return $this->content["label"];
50 50
 	}
51 51
 
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 	 * Return the field
54 54
 	 * @return mixed
55 55
 	 */
56
-	public function getField(){
56
+	public function getField() {
57 57
 		return $this->content["field"];
58 58
 	}
59 59
 
60 60
 	/**
61 61
 	 * puts the label before or behind
62 62
 	 */
63
-	public function swapLabel(){
63
+	public function swapLabel() {
64 64
 		$label=$this->getLabel();
65 65
 		unset($this->content["label"]);
66 66
 		$this->content["label"]=$label;
@@ -71,31 +71,31 @@  discard block
 block discarded – undo
71 71
 	 * @param int $width
72 72
 	 * @return \Ajax\semantic\html\collections\form\HtmlFormField
73 73
 	 */
74
-	public function setWidth($width){
75
-		if(\is_int($width)){
74
+	public function setWidth($width) {
75
+		if (\is_int($width)) {
76 76
 			$width=Wide::getConstants()["W".$width];
77 77
 		}
78 78
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
79
-		if(isset($this->_container)){
79
+		if (isset($this->_container)) {
80 80
 			$this->_container->setEqualWidth(false);
81 81
 		}
82
-		return $this->addToPropertyCtrl("class", "wide",array("wide"));
82
+		return $this->addToPropertyCtrl("class", "wide", array("wide"));
83 83
 	}
84 84
 
85 85
 	/**
86 86
 	 * Field displays an error state
87 87
 	 * @return \Ajax\semantic\html\collections\form\HtmlFormField
88 88
 	 */
89
-	public function setError(){
89
+	public function setError() {
90 90
 		return $this->addToProperty("class", "error");
91 91
 	}
92 92
 
93
-	public function setInline(){
93
+	public function setInline() {
94 94
 		return $this->addToProperty("class", "inline");
95 95
 	}
96 96
 
97
-	public function jsState($state){
98
-		return $this->jsDoJquery("addClass",$state);
97
+	public function jsState($state) {
98
+		return $this->jsDoJquery("addClass", $state);
99 99
 	}
100 100
 
101 101
 	public function setContainer($_container) {
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 		return $this;
104 104
 	}
105 105
 
106
-	public function setReadonly(){
106
+	public function setReadonly() {
107 107
 		$this->getField()->setProperty("readonly", "");
108 108
 	}
109 109
 
Please login to merge, or discard this patch.