Completed
Push — master ( 3cf661...c0f044 )
by Jean-Christophe
03:28
created
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.
Ajax/semantic/html/elements/HtmlSegment.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
  * @version 1.001
18 18
  */
19 19
 class HtmlSegment extends HtmlSemDoubleElement {
20
-	use AttachedTrait,TextAlignmentTrait;
20
+	use AttachedTrait, TextAlignmentTrait;
21 21
 	public function __construct($identifier, $content="") {
22
-		parent::__construct($identifier, "div","ui segment");
23
-		$this->_variations=\array_merge($this->_variations,[Variation::PADDED,Variation::COMPACT]);
24
-		$this->_states=\array_merge($this->_states,[State::LOADING]);
22
+		parent::__construct($identifier, "div", "ui segment");
23
+		$this->_variations=\array_merge($this->_variations, [Variation::PADDED, Variation::COMPACT]);
24
+		$this->_states=\array_merge($this->_states, [State::LOADING]);
25 25
 		$this->content=$content;
26 26
 	}
27 27
 
@@ -30,36 +30,36 @@  discard block
 block discarded – undo
30 30
 	 * @param string $type one of "raised","stacked","piled" default : ""
31 31
 	 * @return \Ajax\semantic\html\elements\HtmlSegment
32 32
 	 */
33
-	public function setType($type){
33
+	public function setType($type) {
34 34
 		return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants());
35 35
 	}
36 36
 
37
-	public function setSens($sens="vertical"){
38
-		return $this->addToPropertyCtrl("class", $sens, array("vertical","horizontal"));
37
+	public function setSens($sens="vertical") {
38
+		return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal"));
39 39
 	}
40 40
 
41 41
 
42
-	public function setEmphasis($value=Emphasis::SECONDARY){
42
+	public function setEmphasis($value=Emphasis::SECONDARY) {
43 43
 		return $this->addToPropertyCtrl("class", $value, Emphasis::getConstants());
44 44
 	}
45 45
 
46
-	public function setCircular(){
46
+	public function setCircular() {
47 47
 		return $this->addToProperty("class", "circular");
48 48
 	}
49 49
 
50
-	public function clear(){
50
+	public function clear() {
51 51
 		return $this->addToProperty("class", "clearing");
52 52
 	}
53 53
 
54
-	public function setFloating($value="left"){
55
-		return $this->addToPropertyCtrl("class", "floated ".$value,array("floated right","floated left"));
54
+	public function setFloating($value="left") {
55
+		return $this->addToPropertyCtrl("class", "floated ".$value, array("floated right", "floated left"));
56 56
 	}
57 57
 
58
-	public function setCompact(){
58
+	public function setCompact() {
59 59
 		return $this->addToProperty("class", "compact");
60 60
 	}
61 61
 
62
-	public function setBasic(){
62
+	public function setBasic() {
63 63
 		return $this->setProperty("class", "ui basic segment");
64 64
 	}
65 65
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlGridCol.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
  * @author jc
13 13
  * @version 1.001
14 14
  */
15
-class HtmlGridCol extends HtmlSemDoubleElement{
15
+class HtmlGridCol extends HtmlSemDoubleElement {
16 16
 	use TextAlignmentTrait;
17
-	public function __construct($identifier,$width){
18
-		parent::__construct($identifier,"div");
17
+	public function __construct($identifier, $width) {
18
+		parent::__construct($identifier, "div");
19 19
 		$this->setClass("column");
20
-		if(isset($width))
20
+		if (isset($width))
21 21
 			$this->setWidth($width);
22 22
 	}
23 23
 
@@ -26,12 +26,12 @@  discard block
 block discarded – undo
26 26
 	 * @param int $width
27 27
 	 * @return \Ajax\semantic\html\content\HtmlGridCol
28 28
 	 */
29
-	public function setWidth($width){
30
-		if(\is_int($width)){
29
+	public function setWidth($width) {
30
+		if (\is_int($width)) {
31 31
 			$width=Wide::getConstants()["W".$width];
32 32
 		}
33 33
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
34
-		return $this->addToPropertyCtrl("class", "wide",array("wide"));
34
+		return $this->addToPropertyCtrl("class", "wide", array("wide"));
35 35
 	}
36 36
 
37 37
 	/**
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
 	 * @param string $value left or right
40 40
 	 * @return \Ajax\semantic\html\content\HtmlGridCol
41 41
 	 */
42
-	public function setFloated($value="left"){
42
+	public function setFloated($value="left") {
43 43
 		return $this->addToProperty("class", $value." floated");
44 44
 	}
45 45
 
46 46
 
47
-	public function setValue($value){
47
+	public function setValue($value) {
48 48
 		$this->content=$value;
49 49
 	}
50 50
 }
51 51
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlGridRow.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -16,23 +16,23 @@  discard block
 block discarded – undo
16 16
  * @author jc
17 17
  * @version 1.001
18 18
  */
19
-class HtmlGridRow extends HtmlSemCollection{
19
+class HtmlGridRow extends HtmlSemCollection {
20 20
 	use TextAlignmentTrait;
21 21
 
22 22
 	private $_colSize;
23 23
 	private $_implicite=false;
24
-	public function __construct( $identifier,$numCols=NULL,$colSizing=false,$implicite=false){
25
-		parent::__construct( $identifier,"div","row");
24
+	public function __construct($identifier, $numCols=NULL, $colSizing=false, $implicite=false) {
25
+		parent::__construct($identifier, "div", "row");
26 26
 		$this->_implicite=$implicite;
27 27
 		$width=null;
28
-		if(isset($numCols)){
29
-			$numCols=min(16,$numCols);
30
-			$numCols=max(1,$numCols);
31
-			if($colSizing)
32
-				$width=(int)(16/$numCols);
28
+		if (isset($numCols)) {
29
+			$numCols=min(16, $numCols);
30
+			$numCols=max(1, $numCols);
31
+			if ($colSizing)
32
+				$width=(int) (16 / $numCols);
33 33
 			else
34
-				$this->_colSize=16/$numCols;
35
-			for ($i=0;$i<$numCols;$i++){
34
+				$this->_colSize=16 / $numCols;
35
+			for ($i=0; $i<$numCols; $i++) {
36 36
 				$this->addItem($width);
37 37
 			}
38 38
 		}
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 	 * @param int $width
44 44
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
45 45
 	 */
46
-	public function setWidth($width){
47
-		if(\is_int($width)){
46
+	public function setWidth($width) {
47
+		if (\is_int($width)) {
48 48
 			$width=Wide::getConstants()["W".$width];
49 49
 		}
50 50
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
51
-		return $this->addToPropertyCtrl("class", "column",array("column"));
51
+		return $this->addToPropertyCtrl("class", "column", array("column"));
52 52
 	}
53 53
 
54 54
 	/**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * @param int $index
57 57
 	 * @return \Ajax\semantic\html\collections\HtmlGridCol
58 58
 	 */
59
-	public function getCol($index){
59
+	public function getCol($index) {
60 60
 		return $this->getItem($index);
61 61
 	}
62 62
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 * stretch the row contents to take up the entire column height
65 65
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
66 66
 	 */
67
-	public function setStretched(){
67
+	public function setStretched() {
68 68
 		return $this->addToProperty("class", "stretched");
69 69
 	}
70 70
 
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
 	 * @param string $color
73 73
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
74 74
 	 */
75
-	public function setColor($color){
76
-		return $this->addToPropertyCtrl("class", $color,Color::getConstants());
75
+	public function setColor($color) {
76
+		return $this->addToPropertyCtrl("class", $color, Color::getConstants());
77 77
 	}
78 78
 
79
-	public function setValues($values,$force=false){
79
+	public function setValues($values, $force=false) {
80 80
 		$count=$this->count();
81
-		if($force===true){
82
-			for($i=$count;$i<\sizeof($values);$i++){
83
-				$this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1),null));
81
+		if ($force===true) {
82
+			for ($i=$count; $i<\sizeof($values); $i++) {
83
+				$this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1), null));
84 84
 			}
85 85
 		}
86
-		$count=\min(array($this->count(),\sizeof($values)));
87
-		for($i=0;$i<$count;$i++){
86
+		$count=\min(array($this->count(), \sizeof($values)));
87
+		for ($i=0; $i<$count; $i++) {
88 88
 			$this->content[$i]->setValue($values[$i]);
89 89
 		}
90 90
 	}
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
 	 * {@inheritDoc}
94 94
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
95 95
 	 */
96
-	protected function createItem($value){
97
-		$col=new HtmlGridCol($this->identifier."-col-".($this->count()+1),$value);
96
+	protected function createItem($value) {
97
+		$col=new HtmlGridCol($this->identifier."-col-".($this->count()+1), $value);
98 98
 		return $col;
99 99
 	}
100 100
 
101
-	public function compile(JsUtils $js=NULL,View $view=NULL){
102
-		if($this->_implicite===true){
101
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
102
+		if ($this->_implicite===true) {
103 103
 			$this->_template="%wrapContentBefore%%content%%wrapContentAfter%";
104 104
 		}
105
-		return parent::compile($js,$view);
105
+		return parent::compile($js, $view);
106 106
 	}
107 107
 }
108 108
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabel.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 
11 11
 class HtmlLabel extends HtmlSemDoubleElement {
12 12
 	use LabeledIconTrait;
13
-	public function __construct($identifier,$caption="",$tagName="div") {
14
-		parent::__construct($identifier,$tagName,"ui label");
13
+	public function __construct($identifier, $caption="", $tagName="div") {
14
+		parent::__construct($identifier, $tagName, "ui label");
15 15
 		$this->content=$caption;
16 16
 	}
17 17
 
@@ -19,33 +19,33 @@  discard block
 block discarded – undo
19 19
 	 * @param string $side
20 20
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
21 21
 	 */
22
-	public function setPointing($value=Direction::NONE){
23
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
22
+	public function setPointing($value=Direction::NONE) {
23
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
24 24
 	}
25 25
 
26 26
 	/**
27 27
 	 * @param string $side
28 28
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
29 29
 	 */
30
-	public function toCorner($side="left"){
31
-		return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner"));
30
+	public function toCorner($side="left") {
31
+		return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner"));
32 32
 	}
33 33
 
34 34
 	/**
35 35
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
36 36
 	 */
37
-	public function asTag(){
37
+	public function asTag() {
38 38
 		return $this->addToProperty("class", "tag");
39 39
 	}
40 40
 
41 41
 	/**
42 42
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
43 43
 	 */
44
-	public function asLink(){
44
+	public function asLink() {
45 45
 		return $this->setTagName("a");
46 46
 	}
47 47
 
48
-	public function setBasic(){
48
+	public function setBasic() {
49 49
 		return $this->addToProperty("class", "basic");
50 50
 	}
51 51
 
@@ -56,17 +56,17 @@  discard block
 block discarded – undo
56 56
 	 * @param string $before
57 57
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
58 58
 	 */
59
-	public function addImage($src,$alt="",$before=true){
59
+	public function addImage($src, $alt="", $before=true) {
60 60
 		$this->addToProperty("class", "image");
61
-		return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before);
61
+		return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before);
62 62
 	}
63 63
 
64 64
 	/**
65 65
 	 * @param string $detail
66 66
 	 * @return \Ajax\common\html\HtmlDoubleElement
67 67
 	 */
68
-	public function addDetail($detail){
69
-		$div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName);
68
+	public function addDetail($detail) {
69
+		$div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName);
70 70
 		$div->setClass("detail");
71 71
 		$div->setContent($detail);
72 72
 		$this->addContent($div);
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/State.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 State extends BaseEnum {
8
-	const ACTIVE="active",DISABLED="disabled",ERROR="error",FOCUS="focus",LOADING="loading";
8
+	const ACTIVE="active", DISABLED="disabled", ERROR="error", FOCUS="focus", LOADING="loading";
9 9
 }
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlListItem.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 class HtmlListItem extends HtmlSemDoubleElement {
9 9
 	protected $image;
10
-	public function __construct($identifier,$content) {
10
+	public function __construct($identifier, $content) {
11 11
 		parent::__construct($identifier, "div", "item");
12 12
 		$this->_template='<%tagName% id="%identifier%" %properties%>%image%%content%</%tagName%>';
13 13
 		$this->content=$content;
14 14
 	}
15
-	public function addIcon($icon){
15
+	public function addIcon($icon) {
16 16
 		$content=$this->content;
17
-		$this->content=new HtmlSemDoubleElement("content-".$this->identifier,"div","content");
17
+		$this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
18 18
 		$this->content->setContent($content);
19
-		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon),true);
19
+		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon), true);
20 20
 	}
21 21
 }
22 22
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/Variation.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 Variation extends BaseEnum {
8
-	const ANIMATED="animated",AVATAR="avatar",COMPACT="compact",FLUID="fluid",INVERTED="inverted",PADDED="padded",TRANSPARENT="transparent";
8
+	const ANIMATED="animated", AVATAR="avatar", COMPACT="compact", FLUID="fluid", INVERTED="inverted", PADDED="padded", TRANSPARENT="transparent";
9 9
 }
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlList.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,22 +5,22 @@
 block discarded – undo
5 5
 use Ajax\semantic\html\base\HtmlSemCollection;
6 6
 use Ajax\semantic\html\content\HtmlListItem;
7 7
 
8
-class HtmlList extends HtmlSemCollection{
8
+class HtmlList extends HtmlSemCollection {
9 9
 
10 10
 
11
-	public function __construct( $identifier, $items=array()){
12
-		parent::__construct( $identifier, "div", "ui list");
11
+	public function __construct($identifier, $items=array()) {
12
+		parent::__construct($identifier, "div", "ui list");
13 13
 		$this->addItems($items);
14 14
 	}
15 15
 
16 16
 
17
-	protected function createItem($value){
17
+	protected function createItem($value) {
18 18
 		$count=$this->count();
19
-		if(\is_array($value)){
19
+		if (\is_array($value)) {
20 20
 			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]);
21 21
 			$item->addIcon($value[1]);
22 22
 		}else
23
-			$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
23
+			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value);
24 24
 		return $item;
25 25
 	}
26 26
 
Please login to merge, or discard this patch.