Completed
Push — master ( db82f0...0ba4b1 )
by Jean-Christophe
03:22
created
Ajax/semantic/html/elements/HtmlInput.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
 use Ajax\service\JString;
6 6
 use Ajax\semantic\html\base\HtmlSemDoubleElement;
7 7
 
8
-class HtmlInput extends HtmlSemDoubleElement{
8
+class HtmlInput extends HtmlSemDoubleElement {
9 9
 
10
-	public function __construct($identifier,$value="",$type="text",$placeholder=""){
11
-		parent::__construct("div-".$identifier,"div","ui input");
12
-		$this->content=new \Ajax\common\html\html5\HtmlInput($identifier,$type);
10
+	public function __construct($identifier, $value="", $type="text", $placeholder="") {
11
+		parent::__construct("div-".$identifier, "div", "ui input");
12
+		$this->content=new \Ajax\common\html\html5\HtmlInput($identifier, $type);
13 13
 		$this->content->setProperty("value", $value);
14
-		if(JString::isNotNull($placeholder))
14
+		if (JString::isNotNull($placeholder))
15 15
 			$this->content->setProperty("placeholder", $placeholder);
16 16
 	}
17 17
 }
18 18
\ 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
@@ -11,7 +11,8 @@
 block discarded – undo
11 11
 		parent::__construct("div-".$identifier,"div","ui input");
12 12
 		$this->content=new \Ajax\common\html\html5\HtmlInput($identifier,$type);
13 13
 		$this->content->setProperty("value", $value);
14
-		if(JString::isNotNull($placeholder))
15
-			$this->content->setProperty("placeholder", $placeholder);
14
+		if(JString::isNotNull($placeholder)) {
15
+					$this->content->setProperty("placeholder", $placeholder);
16
+		}
16 17
 	}
17 18
 }
18 19
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlButtonGroups.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -11,35 +11,35 @@  discard block
 block discarded – undo
11 11
  */
12 12
 class HtmlButtonGroups extends HtmlSemDoubleElement {
13 13
 
14
-	public function __construct($identifier, $elements=array(),$asIcons=false) {
15
-		parent::__construct($identifier, "div","ui buttons");
14
+	public function __construct($identifier, $elements=array(), $asIcons=false) {
15
+		parent::__construct($identifier, "div", "ui buttons");
16 16
 		$this->content=array();
17
-		if($asIcons===true)
17
+		if ($asIcons===true)
18 18
 			$this->asIcons();
19
-		$this->addElements($elements,$asIcons);
19
+		$this->addElements($elements, $asIcons);
20 20
 	}
21
-	public function addElement($element,$asIcon=false){
21
+	public function addElement($element, $asIcon=false) {
22 22
 		$elementO=$element;
23
-		if(\is_string($element)){
24
-			if($asIcon){
23
+		if (\is_string($element)) {
24
+			if ($asIcon) {
25 25
 				$elementO=new HtmlButton("button-".\sizeof($this->content));
26 26
 				$elementO->asIcon($element);
27 27
 			}else
28
-				$elementO=new HtmlButton("button-".\sizeof($this->content),$element);
28
+				$elementO=new HtmlButton("button-".\sizeof($this->content), $element);
29 29
 		}
30 30
 		$this->addContent($elementO);
31 31
 	}
32 32
 
33 33
 
34
-	public function addElements($elements,$asIcons=false) {
35
-		foreach ( $elements as $element ) {
36
-			$this->addElement($element,$asIcons);
34
+	public function addElements($elements, $asIcons=false) {
35
+		foreach ($elements as $element) {
36
+			$this->addElement($element, $asIcons);
37 37
 		}
38 38
 		return $this;
39 39
 	}
40 40
 
41
-	public function insertOr($aferIndex=0,$or="OR"){
42
-		$orElement=new HtmlSemDoubleElement("or-".$this->identifier,"div","or");
41
+	public function insertOr($aferIndex=0, $or="OR") {
42
+		$orElement=new HtmlSemDoubleElement("or-".$this->identifier, "div", "or");
43 43
 		$orElement->setProperty("data-text", $or);
44 44
 		array_splice($this->content, $aferIndex+1, 0, array($orElement));
45 45
 		return $this;
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
 		$this->addElements($array);
53 53
 	}
54 54
 
55
-	public function asIcons(){
55
+	public function asIcons() {
56 56
 		return $this->addToProperty("class", "icons");
57 57
 	}
58 58
 
59
-	public function setVertical(){
59
+	public function setVertical() {
60 60
 		return $this->addToProperty("class", "vertical");
61 61
 	}
62 62
 
63
-	public function setLabeled(){
63
+	public function setLabeled() {
64 64
 		return $this->addToProperty("class", "labeled icon");
65 65
 	}
66 66
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::on()
89 89
 	 */
90 90
 	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
91
-		foreach ( $this->content as $element ) {
91
+		foreach ($this->content as $element) {
92 92
 			$element->on($event, $jsCode, $stopPropagation, $preventDefault);
93 93
 		}
94 94
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlImage.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@
 block discarded – undo
14 14
 		$this->setClass($this->_baseClass);
15 15
 	}
16 16
 
17
-	public function setCircular(){
17
+	public function setCircular() {
18 18
 		return $this->addToProperty("class", "circular");
19 19
 	}
20 20
 
21
-	public function asAvatar($caption=NULL){
22
-		if(isset($caption))
23
-			$this->wrap("",$caption);
21
+	public function asAvatar($caption=NULL) {
22
+		if (isset($caption))
23
+			$this->wrap("", $caption);
24 24
 		return $this->addToProperty("class", "avatar");
25 25
 	}
26 26
 }
27 27
\ 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
@@ -19,8 +19,9 @@
 block discarded – undo
19 19
 	}
20 20
 
21 21
 	public function asAvatar($caption=NULL){
22
-		if(isset($caption))
23
-			$this->wrap("",$caption);
22
+		if(isset($caption)) {
23
+					$this->wrap("",$caption);
24
+		}
24 25
 		return $this->addToProperty("class", "avatar");
25 26
 	}
26 27
 }
27 28
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlSegmentGroups.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\base\HtmlSemCollection;
7 7
 use Ajax\semantic\html\base\constants\Sens;
8 8
 
9
-class HtmlSegmentGroups extends HtmlSemCollection{
9
+class HtmlSegmentGroups extends HtmlSemCollection {
10 10
 
11 11
 
12
-	public function __construct( $identifier, $items=array()){
13
-		parent::__construct( $identifier, "div","ui segments");
12
+	public function __construct($identifier, $items=array()) {
13
+		parent::__construct($identifier, "div", "ui segments");
14 14
 		$this->addItems($items);
15 15
 	}
16 16
 
17 17
 
18
-	protected function createItem($value){
19
-		return new HtmlSegment("segment-".$this->count(),$value);
18
+	protected function createItem($value) {
19
+		return new HtmlSegment("segment-".$this->count(), $value);
20 20
 	}
21 21
 
22 22
 	/**
@@ -24,16 +24,16 @@  discard block
 block discarded – undo
24 24
 	 * @param string $type one of "raised","stacked","piled" default : ""
25 25
 	 * @return \Ajax\semantic\html\elements\HtmlSegmentGroups
26 26
 	 */
27
-	public function setType($type){
27
+	public function setType($type) {
28 28
 		return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants());
29 29
 	}
30 30
 
31
-	public function setSens($sens=Sens::VERTICAL){
31
+	public function setSens($sens=Sens::VERTICAL) {
32 32
 		return $this->addToPropertyCtrl("class", $sens, Sens::getConstants());
33 33
 	}
34 34
 
35
-	public static function group($identifier,$items=array(),$type="",$sens=Sens::VERTICAL){
36
-		$group=new HtmlSegmentGroups($identifier,$items);
35
+	public static function group($identifier, $items=array(), $type="", $sens=Sens::VERTICAL) {
36
+		$group=new HtmlSegmentGroups($identifier, $items);
37 37
 		$group->setSens($sens);
38 38
 		return $group->setType($type);
39 39
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlIconGroups.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,21 +11,21 @@
 block discarded – undo
11 11
  */
12 12
 class HtmlIconGroups extends HtmlSemDoubleElement {
13 13
 
14
-	public function __construct($identifier,$size="") {
15
-		parent::__construct($identifier, "i","icons");
14
+	public function __construct($identifier, $size="") {
15
+		parent::__construct($identifier, "i", "icons");
16 16
 		$this->setSize($size);
17 17
 	}
18 18
 
19
-	public function add($icon,$size=""){
19
+	public function add($icon, $size="") {
20 20
 		$iconO=$icon;
21
-		if(\is_string($icon)){
21
+		if (\is_string($icon)) {
22 22
 			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
23 23
 			$iconO->setSize($size);
24 24
 		}
25 25
 		$this->addContent($iconO);
26 26
 	}
27 27
 
28
-	public function getIcon($index){
28
+	public function getIcon($index) {
29 29
 		return $this->content[$index];
30 30
 	}
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabel.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
 
10 10
 class HtmlLabel extends HtmlSemDoubleElement {
11 11
 
12
-	public function __construct($identifier,$caption="",$tagName="div") {
13
-		parent::__construct($identifier,$tagName,"ui label");
12
+	public function __construct($identifier, $caption="", $tagName="div") {
13
+		parent::__construct($identifier, $tagName, "ui label");
14 14
 		$this->content=$caption;
15 15
 	}
16 16
 
@@ -18,26 +18,26 @@  discard block
 block discarded – undo
18 18
 	 * @param string $side
19 19
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
20 20
 	 */
21
-	public function setPointing($value=Direction::NONE){
22
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
21
+	public function setPointing($value=Direction::NONE) {
22
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
23 23
 	}
24 24
 
25 25
 	/**
26 26
 	 * @param string $side
27 27
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
28 28
 	 */
29
-	public function toCorner($side="left"){
30
-		return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner"));
29
+	public function toCorner($side="left") {
30
+		return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner"));
31 31
 	}
32 32
 
33 33
 	/**
34 34
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
35 35
 	 */
36
-	public function asTag(){
36
+	public function asTag() {
37 37
 		return $this->addToProperty("class", "tag");
38 38
 	}
39 39
 
40
-	public function setBasic(){
40
+	public function setBasic() {
41 41
 		return $this->addToProperty("class", "basic");
42 42
 	}
43 43
 
@@ -48,17 +48,17 @@  discard block
 block discarded – undo
48 48
 	 * @param string $before
49 49
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
50 50
 	 */
51
-	public function addImage($src,$alt="",$before=true){
51
+	public function addImage($src, $alt="", $before=true) {
52 52
 		$this->addToProperty("class", "image");
53
-		return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before);
53
+		return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before);
54 54
 	}
55 55
 
56 56
 	/**
57 57
 	 * @param string $detail
58 58
 	 * @return \Ajax\common\html\HtmlDoubleElement
59 59
 	 */
60
-	public function addDetail($detail){
61
-		$div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName);
60
+	public function addDetail($detail) {
61
+		$div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName);
62 62
 		$div->setClass("detail");
63 63
 		$div->setContent($detail);
64 64
 		$this->addContent($div);
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlContainer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,17 +12,17 @@
 block discarded – undo
12 12
 class HtmlContainer extends HtmlSemDoubleElement {
13 13
 
14 14
 	public function __construct($identifier, $content="") {
15
-		parent::__construct($identifier, "div","ui container");
15
+		parent::__construct($identifier, "div", "ui container");
16 16
 		$this->content=$content;
17 17
 	}
18 18
 
19
-	public function setAlignement($value="justified"){
20
-		if($value!=="justified")
19
+	public function setAlignement($value="justified") {
20
+		if ($value!=="justified")
21 21
 			$value.=" aligned";
22 22
 		return $this->addToProperty("class", $value);
23 23
 	}
24 24
 
25
-	public function setTextContainer(){
25
+	public function setTextContainer() {
26 26
 		return $this->addToProperty("class", "text");
27 27
 	}
28 28
 }
29 29
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlHeader.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@  discard block
 block discarded – undo
8 8
 
9 9
 class HtmlHeader extends HtmlSemDoubleElement {
10 10
 	protected $image;
11
-	public function __construct($identifier, $niveau=1,$content=NULL,$type="page") {
12
-		parent::__construct($identifier, "div","ui header");
11
+	public function __construct($identifier, $niveau=1, $content=NULL, $type="page") {
12
+		parent::__construct($identifier, "div", "ui header");
13 13
 		$this->_template="<%tagName% %properties%>%image%%content%</%tagName%>";
14
-		if(isset($type)){
15
-			if($type=="page"){
14
+		if (isset($type)) {
15
+			if ($type=="page") {
16 16
 				$this->asPageHeader($niveau);
17 17
 			}else
18 18
 				$this->asContentHeader($niveau);
@@ -20,39 +20,39 @@  discard block
 block discarded – undo
20 20
 		$this->content=$content;
21 21
 	}
22 22
 
23
-	public function asPageHeader($niveau){
23
+	public function asPageHeader($niveau) {
24 24
 		$this->tagName="h".$niveau;
25 25
 	}
26 26
 
27
-	public function asContentHeader($niveau){
27
+	public function asContentHeader($niveau) {
28 28
 		$this->tagName="div";
29
-		if(\is_int($niveau)){
29
+		if (\is_int($niveau)) {
30 30
 			$niveau=Size::getConstantValues()[$niveau];
31 31
 		}
32 32
 		$this->setSize($niveau);
33 33
 	}
34 34
 
35
-	public function asIcon($icon,$title,$subHeader=NULL){
35
+	public function asIcon($icon, $title, $subHeader=NULL) {
36 36
 		$this->addToProperty("class", "icon");
37 37
 		$this->image=new HtmlIcon("icon-".$this->identifier, $icon);
38
-		return $this->asTitle($title,$subHeader);
38
+		return $this->asTitle($title, $subHeader);
39 39
 	}
40 40
 
41
-	public function asImage($src,$title,$subHeader=NULL){
42
-		$this->image=new HtmlImage("img-".$this->identifier, $src,$title);
43
-		return $this->asTitle($title,$subHeader);
41
+	public function asImage($src, $title, $subHeader=NULL) {
42
+		$this->image=new HtmlImage("img-".$this->identifier, $src, $title);
43
+		return $this->asTitle($title, $subHeader);
44 44
 	}
45 45
 
46
-	public function asTitle($title,$subHeader=NULL){
47
-		if(!\is_object($title)){
48
-			$this->content=new HtmlDoubleElement("content-".$this->identifier,"div");
46
+	public function asTitle($title, $subHeader=NULL) {
47
+		if (!\is_object($title)) {
48
+			$this->content=new HtmlDoubleElement("content-".$this->identifier, "div");
49 49
 			$this->content->setContent($title);
50
-		}else{
50
+		}else {
51 51
 			$this->content=$title;
52 52
 		}
53 53
 		$this->content->setClass("content");
54
-		if(isset($subHeader)){
55
-			$sub=new HtmlDoubleElement("subheader-".$this->identifier,"div");
54
+		if (isset($subHeader)) {
55
+			$sub=new HtmlDoubleElement("subheader-".$this->identifier, "div");
56 56
 			$sub->setClass("sub header");
57 57
 			$sub->setContent($subHeader);
58 58
 			$this->content->addContent($sub);
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlDivider.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
  */
12 12
 class HtmlDivider extends HtmlDoubleElement {
13 13
 
14
-	public function __construct($identifier, $content="",$tagName="div") {
15
-		parent::__construct($identifier, $tagName,"ui divider");
14
+	public function __construct($identifier, $content="", $tagName="div") {
15
+		parent::__construct($identifier, $tagName, "ui divider");
16 16
 		$this->content=$content;
17 17
 	}
18 18
 
@@ -20,23 +20,23 @@  discard block
 block discarded – undo
20 20
 	 * vertical divider
21 21
 	 * @return \Ajax\semantic\html\elements\HtmlDivider
22 22
 	 */
23
-	public function setVertical(){
24
-		return $this->addToPropertyUnique("class", "vertical", array("vertical","horizontal"));
23
+	public function setVertical() {
24
+		return $this->addToPropertyUnique("class", "vertical", array("vertical", "horizontal"));
25 25
 	}
26 26
 
27 27
 	/**
28 28
 	 * horizontal divider
29 29
 	 * @return \Ajax\semantic\html\elements\HtmlDivider
30 30
 	 */
31
-	public function setHorizontal(){
32
-		return $this->addToPropertyUnique("class", "horizontal", array("vertical","horizontal"));
31
+	public function setHorizontal() {
32
+		return $this->addToPropertyUnique("class", "horizontal", array("vertical", "horizontal"));
33 33
 	}
34 34
 
35 35
 	/**
36 36
 	 * hide the divider
37 37
 	 * @return \Ajax\semantic\html\elements\HtmlDivider
38 38
 	 */
39
-	public function setHidden(){
39
+	public function setHidden() {
40 40
 		return $this->addToProperty("class", "hidden");
41 41
 	}
42 42
 
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
 	 * fitted, without any space above or below it
45 45
 	 * @return \Ajax\semantic\html\elements\HtmlDivider
46 46
 	 */
47
-	public function setFitted(){
47
+	public function setFitted() {
48 48
 		return $this->addToProperty("class", "fitted");
49 49
 	}
50 50
 
51 51
 	/**
52 52
 	 * @return \Ajax\semantic\html\elements\HtmlDivider
53 53
 	 */
54
-	public function asHeader(){
54
+	public function asHeader() {
55 55
 		return $this->addToProperty("class", "header");
56 56
 	}
57 57
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 * inverts the divider colors
60 60
 	 * @return \Ajax\semantic\html\elements\HtmlDivider
61 61
 	 */
62
-	public function setInverted(){
62
+	public function setInverted() {
63 63
 		return $this->addToProperty("class", "inverted");
64 64
 	}
65 65
 }
66 66
\ No newline at end of file
Please login to merge, or discard this patch.