@@ -25,47 +25,47 @@ |
||
25 | 25 | * @param string $type one of "raised","stacked","piled" default : "" |
26 | 26 | * @return \Ajax\semantic\html\elements\HtmlSegment |
27 | 27 | */ |
28 | - public function setType($type){ |
|
28 | + public function setType($type) { |
|
29 | 29 | return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); |
30 | 30 | } |
31 | 31 | |
32 | - public function setSens($sens="vertical"){ |
|
33 | - return $this->addToPropertyCtrl("class", $sens, array("vertical","horizontal")); |
|
32 | + public function setSens($sens="vertical") { |
|
33 | + return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal")); |
|
34 | 34 | } |
35 | 35 | |
36 | - public function setInverted(){ |
|
36 | + public function setInverted() { |
|
37 | 37 | return $this->addToProperty("class", "inverted"); |
38 | 38 | } |
39 | 39 | |
40 | - public function setAttached(){ |
|
40 | + public function setAttached() { |
|
41 | 41 | return $this->addToProperty("class", "attached"); |
42 | 42 | } |
43 | 43 | |
44 | - public function setEmphasis($value="secondary"){ |
|
45 | - return $this->addToPropertyCtrl("class", $value, array("secondary","tertiary","")); |
|
44 | + public function setEmphasis($value="secondary") { |
|
45 | + return $this->addToPropertyCtrl("class", $value, array("secondary", "tertiary", "")); |
|
46 | 46 | } |
47 | 47 | |
48 | - public function setCircular(){ |
|
48 | + public function setCircular() { |
|
49 | 49 | return $this->addToProperty("class", "circular"); |
50 | 50 | } |
51 | 51 | |
52 | - public function clear(){ |
|
52 | + public function clear() { |
|
53 | 53 | return $this->addToProperty("class", "clearing"); |
54 | 54 | } |
55 | 55 | |
56 | - public function setFloating($value="left"){ |
|
57 | - return $this->addToPropertyCtrl("class", "floated ".$value,array("floated right","floated left")); |
|
56 | + public function setFloating($value="left") { |
|
57 | + return $this->addToPropertyCtrl("class", "floated ".$value, array("floated right", "floated left")); |
|
58 | 58 | } |
59 | 59 | |
60 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
61 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
60 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
61 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
62 | 62 | } |
63 | 63 | |
64 | - public function setCompact(){ |
|
64 | + public function setCompact() { |
|
65 | 65 | return $this->addToProperty("class", "compact"); |
66 | 66 | } |
67 | 67 | |
68 | - public function setBasic(){ |
|
68 | + public function setBasic() { |
|
69 | 69 | return $this->setProperty("class", "ui basic segment"); |
70 | 70 | } |
71 | 71 |
@@ -13,22 +13,22 @@ discard block |
||
13 | 13 | * @author jc |
14 | 14 | * @version 1.001 |
15 | 15 | */ |
16 | -class HtmlGrid extends HtmlCollection{ |
|
16 | +class HtmlGrid extends HtmlCollection { |
|
17 | 17 | |
18 | 18 | private $_createCols; |
19 | 19 | private $_colSizing=true; |
20 | - public function __construct( $identifier,$numRows=1,$numCols=NULL,$createCols=true){ |
|
21 | - parent::__construct( $identifier, "div"); |
|
20 | + public function __construct($identifier, $numRows=1, $numCols=NULL, $createCols=true) { |
|
21 | + parent::__construct($identifier, "div"); |
|
22 | 22 | $this->_createCols=$createCols; |
23 | - if(isset($numCols)){ |
|
24 | - if($this->_createCols){ |
|
23 | + if (isset($numCols)) { |
|
24 | + if ($this->_createCols) { |
|
25 | 25 | $this->_colSizing=false; |
26 | 26 | } |
27 | 27 | $cols=Wide::getConstants()["W".$numCols]; |
28 | 28 | $this->setClass($cols." column"); |
29 | 29 | } |
30 | - $this->addToProperty("class","ui grid"); |
|
31 | - $this->setNumRows($numRows,$numCols); |
|
30 | + $this->addToProperty("class", "ui grid"); |
|
31 | + $this->setNumRows($numRows, $numCols); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | * @param int $numCols |
38 | 38 | * @return \Ajax\semantic\html\collections\HtmlGrid |
39 | 39 | */ |
40 | - public function setNumRows($numRows,$numCols=NULL){ |
|
40 | + public function setNumRows($numRows, $numCols=NULL) { |
|
41 | 41 | $count=$this->count(); |
42 | - for($i=$count;$i<$numRows;$i++){ |
|
42 | + for ($i=$count; $i<$numRows; $i++) { |
|
43 | 43 | $this->addItem($numCols); |
44 | 44 | } |
45 | 45 | return $this; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @param int $index |
51 | 51 | * @return \Ajax\semantic\html\collections\HtmlGridRow |
52 | 52 | */ |
53 | - public function getRow($index){ |
|
53 | + public function getRow($index) { |
|
54 | 54 | return $this->getItem($index); |
55 | 55 | } |
56 | 56 | |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | * @param int $col |
60 | 60 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
61 | 61 | */ |
62 | - public function getCell($row,$col){ |
|
62 | + public function getCell($row, $col) { |
|
63 | 63 | $row=$this->getItem($row); |
64 | - if(isset($row)){ |
|
64 | + if (isset($row)) { |
|
65 | 65 | $col=$row->getItem($col); |
66 | 66 | } |
67 | 67 | return $col; |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | * @param boolean $vertically |
73 | 73 | * @return \Ajax\semantic\html\collections\HtmlGrid |
74 | 74 | */ |
75 | - public function setDivided($vertically=false){ |
|
76 | - $value=($vertically===true)?"vertically divided":"divided"; |
|
75 | + public function setDivided($vertically=false) { |
|
76 | + $value=($vertically===true) ? "vertically divided" : "divided"; |
|
77 | 77 | return $this->addToProperty("class", $value); |
78 | 78 | } |
79 | 79 | |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | * @param boolean $internal true for internal cells |
83 | 83 | * @return \Ajax\semantic\html\collections\HtmlGrid |
84 | 84 | */ |
85 | - public function setCelled($internal=false){ |
|
86 | - $value=($internal===true)?"internal celled":"celled"; |
|
85 | + public function setCelled($internal=false) { |
|
86 | + $value=($internal===true) ? "internal celled" : "celled"; |
|
87 | 87 | return $this->addToProperty("class", $value); |
88 | 88 | } |
89 | 89 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * automatically resize all elements to split the available width evenly |
92 | 92 | * @return \Ajax\semantic\html\collections\HtmlGrid |
93 | 93 | */ |
94 | - public function setEqualWidth(){ |
|
94 | + public function setEqualWidth() { |
|
95 | 95 | return $this->addToProperty("class", "equal width"); |
96 | 96 | } |
97 | 97 | |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | * @param string $value |
101 | 101 | * @return \Ajax\semantic\html\collections\HtmlGrid |
102 | 102 | */ |
103 | - public function setPadded($value=NULL){ |
|
104 | - if(isset($value)) |
|
105 | - $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
103 | + public function setPadded($value=NULL) { |
|
104 | + if (isset($value)) |
|
105 | + $this->addToPropertyCtrl("class", $value, array("vertically", "horizontally")); |
|
106 | 106 | return $this->addToProperty("class", "padded"); |
107 | 107 | } |
108 | 108 | |
@@ -110,23 +110,23 @@ discard block |
||
110 | 110 | * @param boolean $very |
111 | 111 | * @return \Ajax\semantic\html\collections\HtmlGrid |
112 | 112 | */ |
113 | - public function setRelaxed($very=false){ |
|
114 | - $value=($very===true)?"very relaxed":"relaxed"; |
|
113 | + public function setRelaxed($very=false) { |
|
114 | + $value=($very===true) ? "very relaxed" : "relaxed"; |
|
115 | 115 | return $this->addToProperty("class", $value); |
116 | 116 | } |
117 | 117 | |
118 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
119 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
118 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
119 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
123 | 123 | * {@inheritDoc} |
124 | 124 | * @see \Ajax\common\html\HtmlCollection::createItem() |
125 | 125 | */ |
126 | - protected function createItem($value){ |
|
127 | - if($this->_createCols===false) |
|
126 | + protected function createItem($value) { |
|
127 | + if ($this->_createCols===false) |
|
128 | 128 | $value=null; |
129 | - $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing); |
|
129 | + $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1), $value, $this->_colSizing); |
|
130 | 130 | return $item; |
131 | 131 | } |
132 | 132 |
@@ -101,8 +101,9 @@ discard block |
||
101 | 101 | * @return \Ajax\semantic\html\collections\HtmlGrid |
102 | 102 | */ |
103 | 103 | public function setPadded($value=NULL){ |
104 | - if(isset($value)) |
|
105 | - $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
104 | + if(isset($value)) { |
|
105 | + $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
106 | + } |
|
106 | 107 | return $this->addToProperty("class", "padded"); |
107 | 108 | } |
108 | 109 | |
@@ -124,8 +125,9 @@ discard block |
||
124 | 125 | * @see \Ajax\common\html\HtmlCollection::createItem() |
125 | 126 | */ |
126 | 127 | protected function createItem($value){ |
127 | - if($this->_createCols===false) |
|
128 | - $value=null; |
|
128 | + if($this->_createCols===false) { |
|
129 | + $value=null; |
|
130 | + } |
|
129 | 131 | $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing); |
130 | 132 | return $item; |
131 | 133 | } |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | * @author jc |
13 | 13 | * @version 1.001 |
14 | 14 | */ |
15 | -class HtmlGridCol extends HtmlSemDoubleElement{ |
|
16 | - public function __construct($identifier,$width){ |
|
17 | - parent::__construct($identifier,"div"); |
|
15 | +class HtmlGridCol extends HtmlSemDoubleElement { |
|
16 | + public function __construct($identifier, $width) { |
|
17 | + parent::__construct($identifier, "div"); |
|
18 | 18 | $this->setClass("column"); |
19 | - if(isset($width)) |
|
19 | + if (isset($width)) |
|
20 | 20 | $this->setWidth($width); |
21 | 21 | } |
22 | 22 | |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | * @param int $width |
26 | 26 | * @return \Ajax\semantic\html\content\HtmlGridCol |
27 | 27 | */ |
28 | - public function setWidth($width){ |
|
29 | - if(\is_int($width)){ |
|
28 | + public function setWidth($width) { |
|
29 | + if (\is_int($width)) { |
|
30 | 30 | $width=Wide::getConstants()["W".$width]; |
31 | 31 | } |
32 | 32 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
33 | - return $this->addToPropertyCtrl("class", "wide",array("wide")); |
|
33 | + return $this->addToPropertyCtrl("class", "wide", array("wide")); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | * @param string $value left or right |
39 | 39 | * @return \Ajax\semantic\html\content\HtmlGridCol |
40 | 40 | */ |
41 | - public function setFloated($value="left"){ |
|
41 | + public function setFloated($value="left") { |
|
42 | 42 | return $this->addToProperty("class", $value." floated"); |
43 | 43 | } |
44 | 44 | |
45 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
46 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
45 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
46 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -13,21 +13,21 @@ discard block |
||
13 | 13 | * @author jc |
14 | 14 | * @version 1.001 |
15 | 15 | */ |
16 | -class HtmlGridRow extends HtmlCollection{ |
|
16 | +class HtmlGridRow extends HtmlCollection { |
|
17 | 17 | |
18 | 18 | private $_colSize; |
19 | - public function __construct( $identifier,$numCols=NULL,$colSizing=false){ |
|
20 | - parent::__construct( $identifier,"div"); |
|
19 | + public function __construct($identifier, $numCols=NULL, $colSizing=false) { |
|
20 | + parent::__construct($identifier, "div"); |
|
21 | 21 | $this->setClass("row"); |
22 | 22 | $width=null; |
23 | - if(isset($numCols)){ |
|
24 | - $numCols=min(16,$numCols); |
|
25 | - $numCols=max(1,$numCols); |
|
26 | - if($colSizing) |
|
27 | - $width=(int)(16/$numCols); |
|
23 | + if (isset($numCols)) { |
|
24 | + $numCols=min(16, $numCols); |
|
25 | + $numCols=max(1, $numCols); |
|
26 | + if ($colSizing) |
|
27 | + $width=(int) (16 / $numCols); |
|
28 | 28 | else |
29 | - $this->_colSize=16/$numCols; |
|
30 | - for ($i=0;$i<$numCols;$i++){ |
|
29 | + $this->_colSize=16 / $numCols; |
|
30 | + for ($i=0; $i<$numCols; $i++) { |
|
31 | 31 | $this->addItem($width); |
32 | 32 | } |
33 | 33 | } |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | * @param int $width |
39 | 39 | * @return \Ajax\semantic\html\content\HtmlGridRow |
40 | 40 | */ |
41 | - public function setWidth($width){ |
|
42 | - if(\is_int($width)){ |
|
41 | + public function setWidth($width) { |
|
42 | + if (\is_int($width)) { |
|
43 | 43 | $width=Wide::getConstants()["W".$width]; |
44 | 44 | } |
45 | 45 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
46 | - return $this->addToPropertyCtrl("class", "column",array("column")); |
|
46 | + return $this->addToPropertyCtrl("class", "column", array("column")); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @param int $index |
52 | 52 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
53 | 53 | */ |
54 | - public function getCol($index){ |
|
54 | + public function getCol($index) { |
|
55 | 55 | return $this->getItem($index); |
56 | 56 | } |
57 | 57 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * stretch the row contents to take up the entire column height |
60 | 60 | * @return \Ajax\semantic\html\content\HtmlGridRow |
61 | 61 | */ |
62 | - public function setStretched(){ |
|
62 | + public function setStretched() { |
|
63 | 63 | return $this->addToProperty("class", "stretched"); |
64 | 64 | } |
65 | 65 | |
@@ -67,20 +67,20 @@ discard block |
||
67 | 67 | * @param string $color |
68 | 68 | * @return \Ajax\semantic\html\content\HtmlGridRow |
69 | 69 | */ |
70 | - public function setColor($color){ |
|
71 | - return $this->addToPropertyCtrl("class", $color,Color::getConstants()); |
|
70 | + public function setColor($color) { |
|
71 | + return $this->addToPropertyCtrl("class", $color, Color::getConstants()); |
|
72 | 72 | } |
73 | 73 | |
74 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
75 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
74 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
75 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | 79 | * {@inheritDoc} |
80 | 80 | * @see \Ajax\common\html\HtmlCollection::createItem() |
81 | 81 | */ |
82 | - protected function createItem($value){ |
|
83 | - $col=new HtmlGridCol($this->identifier."-col-".($this->count()+1),$value); |
|
82 | + protected function createItem($value) { |
|
83 | + $col=new HtmlGridCol($this->identifier."-col-".($this->count()+1), $value); |
|
84 | 84 | return $col; |
85 | 85 | } |
86 | 86 | } |
87 | 87 | \ No newline at end of file |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | class TextAlignment extends BaseEnum { |
8 | - const LEFT="left aligned",CENTER="center aligned",RIGHT="right aligned",JUSTIFIED="justified"; |
|
8 | + const LEFT="left aligned", CENTER="center aligned", RIGHT="right aligned", JUSTIFIED="justified"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |