@@ -12,15 +12,15 @@ discard block |
||
12 | 12 | * @author jc |
13 | 13 | * @version 1.001 |
14 | 14 | */ |
15 | -class HtmlLabeledIconMenu extends HtmlMenu{ |
|
15 | +class HtmlLabeledIconMenu extends HtmlMenu { |
|
16 | 16 | |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @param string $identifier |
20 | 20 | * @param array $items icons |
21 | 21 | */ |
22 | - public function __construct( $identifier, $items=array()){ |
|
23 | - parent::__construct( $identifier, $items); |
|
22 | + public function __construct($identifier, $items=array()) { |
|
23 | + parent::__construct($identifier, $items); |
|
24 | 24 | $this->addToProperty("class", "labeled icon"); |
25 | 25 | } |
26 | 26 | |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | protected function createItem($value) { |
32 | 32 | $text=""; |
33 | 33 | $v=$value; |
34 | - if(\is_array($value)){ |
|
34 | + if (\is_array($value)) { |
|
35 | 35 | $v=@$value[0]; |
36 | 36 | $text=@$value[1]; |
37 | 37 | } |
38 | 38 | $count=\sizeof($this->content); |
39 | 39 | $value=new HtmlIcon("icon-".$count, $v); |
40 | - $value->wrap("",$text); |
|
41 | - $itemO=new HtmlLink("item-".$count,"",$value); |
|
40 | + $value->wrap("", $text); |
|
41 | + $itemO=new HtmlLink("item-".$count, "", $value); |
|
42 | 42 | return $itemO->setClass("item"); |
43 | 43 | } |
44 | 44 | } |
45 | 45 | \ No newline at end of file |
@@ -14,24 +14,24 @@ discard block |
||
14 | 14 | * @author jc |
15 | 15 | * @version 1.001 |
16 | 16 | */ |
17 | -class HtmlGrid extends HtmlCollection{ |
|
17 | +class HtmlGrid extends HtmlCollection { |
|
18 | 18 | |
19 | 19 | private $_createCols; |
20 | 20 | private $_colSizing=true; |
21 | 21 | private $_implicitRows=false; |
22 | - public function __construct( $identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){ |
|
23 | - parent::__construct( $identifier, "div"); |
|
22 | + public function __construct($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) { |
|
23 | + parent::__construct($identifier, "div"); |
|
24 | 24 | $this->_implicitRows=$implicitRows; |
25 | 25 | $this->_createCols=$createCols; |
26 | - if(isset($numCols)){ |
|
26 | + if (isset($numCols)) { |
|
27 | 27 | //if($this->_createCols){ |
28 | 28 | $this->_colSizing=false; |
29 | 29 | //} |
30 | 30 | $cols=Wide::getConstants()["W".$numCols]; |
31 | 31 | $this->setClass($cols." column"); |
32 | 32 | } |
33 | - $this->addToProperty("class","ui grid"); |
|
34 | - $this->setNumRows($numRows,$numCols); |
|
33 | + $this->addToProperty("class", "ui grid"); |
|
34 | + $this->setNumRows($numRows, $numCols); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | * @param int $numCols |
41 | 41 | * @return \Ajax\semantic\html\collections\HtmlGrid |
42 | 42 | */ |
43 | - public function setNumRows($numRows,$numCols=NULL){ |
|
43 | + public function setNumRows($numRows, $numCols=NULL) { |
|
44 | 44 | $count=$this->count(); |
45 | - for($i=$count;$i<$numRows;$i++){ |
|
45 | + for ($i=$count; $i<$numRows; $i++) { |
|
46 | 46 | $this->addItem($numCols); |
47 | 47 | } |
48 | 48 | return $this; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param int $index |
54 | 54 | * @return \Ajax\semantic\html\collections\HtmlGridRow |
55 | 55 | */ |
56 | - public function getRow($index){ |
|
56 | + public function getRow($index) { |
|
57 | 57 | return $this->getItem($index); |
58 | 58 | } |
59 | 59 | |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | * @param int $col |
63 | 63 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
64 | 64 | */ |
65 | - public function getCell($row,$col){ |
|
65 | + public function getCell($row, $col) { |
|
66 | 66 | $row=$this->getItem($row); |
67 | - if(isset($row)){ |
|
67 | + if (isset($row)) { |
|
68 | 68 | $col=$row->getItem($col); |
69 | 69 | } |
70 | 70 | return $col; |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | * @param boolean $vertically |
76 | 76 | * @return \Ajax\semantic\html\collections\HtmlGrid |
77 | 77 | */ |
78 | - public function setDivided($vertically=false){ |
|
79 | - $value=($vertically===true)?"vertically divided":"divided"; |
|
78 | + public function setDivided($vertically=false) { |
|
79 | + $value=($vertically===true) ? "vertically divided" : "divided"; |
|
80 | 80 | return $this->addToProperty("class", $value); |
81 | 81 | } |
82 | 82 | |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | * @param boolean $internal true for internal cells |
86 | 86 | * @return \Ajax\semantic\html\collections\HtmlGrid |
87 | 87 | */ |
88 | - public function setCelled($internal=false){ |
|
89 | - $value=($internal===true)?"internal celled":"celled"; |
|
88 | + public function setCelled($internal=false) { |
|
89 | + $value=($internal===true) ? "internal celled" : "celled"; |
|
90 | 90 | return $this->addToProperty("class", $value); |
91 | 91 | } |
92 | 92 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * automatically resize all elements to split the available width evenly |
95 | 95 | * @return \Ajax\semantic\html\collections\HtmlGrid |
96 | 96 | */ |
97 | - public function setEqualWidth(){ |
|
97 | + public function setEqualWidth() { |
|
98 | 98 | return $this->addToProperty("class", "equal width"); |
99 | 99 | } |
100 | 100 | |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | * @param string $value |
104 | 104 | * @return \Ajax\semantic\html\collections\HtmlGrid |
105 | 105 | */ |
106 | - public function setPadded($value=NULL){ |
|
107 | - if(isset($value)) |
|
108 | - $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
106 | + public function setPadded($value=NULL) { |
|
107 | + if (isset($value)) |
|
108 | + $this->addToPropertyCtrl("class", $value, array("vertically", "horizontally")); |
|
109 | 109 | return $this->addToProperty("class", "padded"); |
110 | 110 | } |
111 | 111 | |
@@ -113,41 +113,41 @@ discard block |
||
113 | 113 | * @param boolean $very |
114 | 114 | * @return \Ajax\semantic\html\collections\HtmlGrid |
115 | 115 | */ |
116 | - public function setRelaxed($very=false){ |
|
117 | - $value=($very===true)?"very relaxed":"relaxed"; |
|
116 | + public function setRelaxed($very=false) { |
|
117 | + $value=($very===true) ? "very relaxed" : "relaxed"; |
|
118 | 118 | return $this->addToProperty("class", $value); |
119 | 119 | } |
120 | 120 | |
121 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
122 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
121 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
122 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
123 | 123 | } |
124 | 124 | |
125 | - public function setVerticalAlignment($value=VerticalAlignment::MIDDLE){ |
|
126 | - return $this->addToPropertyCtrl("class", $value,VerticalAlignment::getConstants()); |
|
125 | + public function setVerticalAlignment($value=VerticalAlignment::MIDDLE) { |
|
126 | + return $this->addToPropertyCtrl("class", $value, VerticalAlignment::getConstants()); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
130 | 130 | * {@inheritDoc} |
131 | 131 | * @see \Ajax\common\html\HtmlCollection::createItem() |
132 | 132 | */ |
133 | - protected function createItem($value){ |
|
134 | - if($this->_createCols===false) |
|
133 | + protected function createItem($value) { |
|
134 | + if ($this->_createCols===false) |
|
135 | 135 | $value=null; |
136 | - $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing,$this->_implicitRows); |
|
136 | + $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1), $value, $this->_colSizing, $this->_implicitRows); |
|
137 | 137 | return $item; |
138 | 138 | } |
139 | 139 | |
140 | - public function setValues($values){ |
|
140 | + public function setValues($values) { |
|
141 | 141 | $count=$this->count(); |
142 | - if($this->_createCols===false){ |
|
143 | - for($i=$count;$i<\sizeof($values);$i++){ |
|
142 | + if ($this->_createCols===false) { |
|
143 | + for ($i=$count; $i<\sizeof($values); $i++) { |
|
144 | 144 | $colSize=\sizeof($values[$i]); |
145 | - $this->addItem(new HtmlGridRow($this->identifier."-row-".($this->count()+1),$colSize,$this->_colSizing,$this->_implicitRows)); |
|
145 | + $this->addItem(new HtmlGridRow($this->identifier."-row-".($this->count()+1), $colSize, $this->_colSizing, $this->_implicitRows)); |
|
146 | 146 | } |
147 | 147 | } |
148 | - $count=\min(array($this->count(),\sizeof($values))); |
|
149 | - for($i=0;$i<$count;$i++){ |
|
150 | - $this->content[$i]->setValues($values[$i],$this->_createCols===false); |
|
148 | + $count=\min(array($this->count(), \sizeof($values))); |
|
149 | + for ($i=0; $i<$count; $i++) { |
|
150 | + $this->content[$i]->setValues($values[$i], $this->_createCols===false); |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | class HtmlPopup extends HtmlSemDoubleElement { |
11 | 11 | private $params; |
12 | 12 | private $_container; |
13 | - public function __construct(BaseHtml $container,$identifier, $content="") { |
|
13 | + public function __construct(BaseHtml $container, $identifier, $content="") { |
|
14 | 14 | parent::__construct($identifier, "div"); |
15 | 15 | $this->_container=$container; |
16 | 16 | $this->setClass("ui popup"); |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | $this->params=array("on"=>"click"); |
19 | 19 | } |
20 | 20 | |
21 | - public function setFlowing(){ |
|
21 | + public function setFlowing() { |
|
22 | 22 | return $this->addToProperty("class", "flowing"); |
23 | 23 | } |
24 | 24 | |
25 | - public function setBasic(){ |
|
25 | + public function setBasic() { |
|
26 | 26 | return $this->addToProperty("class", "basic"); |
27 | 27 | } |
28 | 28 | |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | * {@inheritDoc} |
31 | 31 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
32 | 32 | */ |
33 | - public function run(JsUtils $js){ |
|
33 | + public function run(JsUtils $js) { |
|
34 | 34 | $this->params["popup"]="#".$this->identifier; |
35 | - $js->semantic()->popup("#".$this->_container->getIdentifier(),$this->params); |
|
35 | + $js->semantic()->popup("#".$this->_container->getIdentifier(), $this->params); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | \ No newline at end of file |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | class HtmlDropdown extends HtmlSemDoubleElement { |
15 | 15 | protected $mClass="menu"; |
16 | 16 | protected $mTagName="div"; |
17 | - protected $items=array (); |
|
17 | + protected $items=array(); |
|
18 | 18 | protected $params=array("action"=>"select"); |
19 | 19 | protected $input; |
20 | 20 | |
@@ -22,40 +22,40 @@ discard block |
||
22 | 22 | parent::__construct($identifier, "div"); |
23 | 23 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php'; |
24 | 24 | $this->setProperty("class", "ui dropdown"); |
25 | - $content=new HtmlSemDoubleElement("","div"); |
|
25 | + $content=new HtmlSemDoubleElement("", "div"); |
|
26 | 26 | $content->setClass("text"); |
27 | 27 | $content->setContent($value); |
28 | - $content->wrap("",new HtmlIcon("", "dropdown")); |
|
28 | + $content->wrap("", new HtmlIcon("", "dropdown")); |
|
29 | 29 | $this->content=array($content); |
30 | 30 | $this->tagName="div"; |
31 | 31 | $this->addItems($items); |
32 | 32 | } |
33 | 33 | |
34 | - public function addItem($item,$value=NULL,$image=NULL){ |
|
34 | + public function addItem($item, $value=NULL, $image=NULL) { |
|
35 | 35 | $itemO=$item; |
36 | - if(\is_object($item)===false){ |
|
37 | - $itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image); |
|
38 | - }elseif($itemO instanceof HtmlDropdownItem){ |
|
36 | + if (\is_object($item)===false) { |
|
37 | + $itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items), $item, $value, $image); |
|
38 | + }elseif ($itemO instanceof HtmlDropdownItem) { |
|
39 | 39 | $this->addToProperty("class", "vertical"); |
40 | 40 | } |
41 | 41 | $this->items[]=$itemO; |
42 | 42 | return $itemO; |
43 | 43 | } |
44 | 44 | |
45 | - public function addInput($name){ |
|
46 | - if(!isset($name)) |
|
45 | + public function addInput($name) { |
|
46 | + if (!isset($name)) |
|
47 | 47 | $name="input-".$this->identifier; |
48 | 48 | $this->setAction("activate"); |
49 | - $this->input=new HtmlInput($name,"hidden"); |
|
49 | + $this->input=new HtmlInput($name, "hidden"); |
|
50 | 50 | } |
51 | 51 | |
52 | - public function addItems($items){ |
|
53 | - if(JArray::isAssociative($items)){ |
|
54 | - foreach ($items as $k=>$v){ |
|
52 | + public function addItems($items) { |
|
53 | + if (JArray::isAssociative($items)) { |
|
54 | + foreach ($items as $k=>$v) { |
|
55 | 55 | $this->addItem($v)->setData($k); |
56 | 56 | } |
57 | - }else{ |
|
58 | - foreach ($items as $item){ |
|
57 | + }else { |
|
58 | + foreach ($items as $item) { |
|
59 | 59 | $this->addItem($item); |
60 | 60 | } |
61 | 61 | } |
@@ -64,51 +64,51 @@ discard block |
||
64 | 64 | /** |
65 | 65 | * @param boolean $dropdown |
66 | 66 | */ |
67 | - public function asDropdown($dropdown){ |
|
68 | - if($dropdown===false){ |
|
67 | + public function asDropdown($dropdown) { |
|
68 | + if ($dropdown===false) { |
|
69 | 69 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php'; |
70 | 70 | $dropdown="menu"; |
71 | - }else{ |
|
71 | + }else { |
|
72 | 72 | $dropdown="dropdown"; |
73 | 73 | $this->mClass="menu"; |
74 | 74 | } |
75 | - return $this->addToPropertyCtrl("class", $dropdown,array("menu","dropdown")); |
|
75 | + return $this->addToPropertyCtrl("class", $dropdown, array("menu", "dropdown")); |
|
76 | 76 | } |
77 | 77 | |
78 | - public function setVertical(){ |
|
79 | - return $this->addToPropertyCtrl("class", "vertical",array("vertical")); |
|
78 | + public function setVertical() { |
|
79 | + return $this->addToPropertyCtrl("class", "vertical", array("vertical")); |
|
80 | 80 | } |
81 | 81 | |
82 | - public function setSimple(){ |
|
83 | - return $this->addToPropertyCtrl("class", "simple",array("simple")); |
|
82 | + public function setSimple() { |
|
83 | + return $this->addToPropertyCtrl("class", "simple", array("simple")); |
|
84 | 84 | } |
85 | 85 | |
86 | - public function asButton($floating=false){ |
|
87 | - if($floating) |
|
86 | + public function asButton($floating=false) { |
|
87 | + if ($floating) |
|
88 | 88 | $this->addToProperty("class", "floating"); |
89 | 89 | return $this->addToProperty("class", "button"); |
90 | 90 | } |
91 | 91 | |
92 | - public function asSelect($name=NULL,$multiple=false,$selection=true){ |
|
93 | - if(isset($name)) |
|
92 | + public function asSelect($name=NULL, $multiple=false, $selection=true) { |
|
93 | + if (isset($name)) |
|
94 | 94 | $this->addInput($name); |
95 | - if($multiple) |
|
95 | + if ($multiple) |
|
96 | 96 | $this->addToProperty("class", "multiple"); |
97 | 97 | if ($selection) |
98 | - $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
98 | + $this->addToPropertyCtrl("class", "selection", array("selection")); |
|
99 | 99 | return $this; |
100 | 100 | } |
101 | 101 | |
102 | - public function asSearch($name=NULL,$multiple=false,$selection=false){ |
|
103 | - $this->asSelect($name,$multiple,$selection); |
|
102 | + public function asSearch($name=NULL, $multiple=false, $selection=false) { |
|
103 | + $this->asSelect($name, $multiple, $selection); |
|
104 | 104 | return $this->addToProperty("class", "search"); |
105 | 105 | } |
106 | 106 | |
107 | - public function setSelect($name=NULL,$multiple=false){ |
|
108 | - if(!isset($name)) |
|
107 | + public function setSelect($name=NULL, $multiple=false) { |
|
108 | + if (!isset($name)) |
|
109 | 109 | $name="select-".$this->identifier; |
110 | 110 | $this->input=null; |
111 | - if($multiple){ |
|
111 | + if ($multiple) { |
|
112 | 112 | $this->setProperty("multiple", true); |
113 | 113 | $this->addToProperty("class", "multiple"); |
114 | 114 | } |
@@ -116,28 +116,28 @@ discard block |
||
116 | 116 | $this->tagName="select"; |
117 | 117 | $this->setProperty("name", $name); |
118 | 118 | $this->content=null; |
119 | - foreach ($this->items as $item){ |
|
119 | + foreach ($this->items as $item) { |
|
120 | 120 | $item->asOption(); |
121 | 121 | } |
122 | 122 | return $this; |
123 | 123 | } |
124 | 124 | |
125 | - public function asSubmenu($pointing=NULL){ |
|
125 | + public function asSubmenu($pointing=NULL) { |
|
126 | 126 | $this->setClass("ui dropdown link item"); |
127 | - if(isset($pointing)){ |
|
127 | + if (isset($pointing)) { |
|
128 | 128 | $this->setPointing($pointing); |
129 | 129 | } |
130 | 130 | return $this; |
131 | 131 | } |
132 | 132 | |
133 | - public function setPointing($value=Pointing::POINTING){ |
|
134 | - return $this->addToPropertyCtrl("class", $value,Pointing::getConstants()); |
|
133 | + public function setPointing($value=Pointing::POINTING) { |
|
134 | + return $this->addToPropertyCtrl("class", $value, Pointing::getConstants()); |
|
135 | 135 | } |
136 | 136 | |
137 | - public function setValue($value){ |
|
138 | - if(isset($this->input)){ |
|
137 | + public function setValue($value) { |
|
138 | + if (isset($this->input)) { |
|
139 | 139 | $this->input->setProperty("value", $value); |
140 | - }else{ |
|
140 | + }else { |
|
141 | 141 | $this->setProperty("value", $value); |
142 | 142 | } |
143 | 143 | return $this; |
@@ -148,14 +148,14 @@ discard block |
||
148 | 148 | * @see BaseHtml::run() |
149 | 149 | */ |
150 | 150 | public function run(JsUtils $js) { |
151 | - if($this->propertyContains("class", "simple")===false){ |
|
152 | - $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->params); |
|
151 | + if ($this->propertyContains("class", "simple")===false) { |
|
152 | + $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier, $this->params); |
|
153 | 153 | $this->addEventsOnRun($js); |
154 | 154 | return $this->_bsComponent; |
155 | 155 | } |
156 | 156 | } |
157 | 157 | |
158 | - public function setAction($action){ |
|
158 | + public function setAction($action) { |
|
159 | 159 | $this->params["action"]=$action; |
160 | 160 | } |
161 | 161 | } |
162 | 162 | \ No newline at end of file |
@@ -7,29 +7,29 @@ discard block |
||
7 | 7 | |
8 | 8 | abstract class HtmlCollection extends HtmlDoubleElement { |
9 | 9 | |
10 | - public function __construct($identifier,$tagName="div"){ |
|
11 | - parent::__construct($identifier,$tagName); |
|
10 | + public function __construct($identifier, $tagName="div") { |
|
11 | + parent::__construct($identifier, $tagName); |
|
12 | 12 | $this->content=array(); |
13 | 13 | } |
14 | 14 | |
15 | - public function addItems($items){ |
|
16 | - if(JArray::isAssociative($items)){ |
|
17 | - foreach ($items as $k=>$v){ |
|
18 | - $this->addItem([$k,$v]); |
|
15 | + public function addItems($items) { |
|
16 | + if (JArray::isAssociative($items)) { |
|
17 | + foreach ($items as $k=>$v) { |
|
18 | + $this->addItem([$k, $v]); |
|
19 | 19 | } |
20 | - }else{ |
|
21 | - foreach ($items as $item){ |
|
20 | + }else { |
|
21 | + foreach ($items as $item) { |
|
22 | 22 | $this->addItem($item); |
23 | 23 | } |
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
27 | - public function setItems($items){ |
|
27 | + public function setItems($items) { |
|
28 | 28 | $this->content=$items; |
29 | 29 | return $this; |
30 | 30 | } |
31 | 31 | |
32 | - public function getItems(){ |
|
32 | + public function getItems() { |
|
33 | 33 | return $this->content; |
34 | 34 | } |
35 | 35 | |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param HtmlDoubleElement|string $item |
39 | 39 | * @return \Ajax\common\html\HtmlDoubleElement |
40 | 40 | */ |
41 | - public function addItem($item){ |
|
41 | + public function addItem($item) { |
|
42 | 42 | $itemO=$item; |
43 | - if(\is_object($item)===false){ |
|
43 | + if (\is_object($item)===false) { |
|
44 | 44 | $itemO=$this->createItem($item); |
45 | 45 | } |
46 | 46 | $this->addContent($itemO); |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | return $this; |
67 | 67 | } |
68 | 68 | |
69 | - public function removeItem($index){ |
|
69 | + public function removeItem($index) { |
|
70 | 70 | return array_splice($this->content, $index, 1); |
71 | 71 | } |
72 | 72 | |
73 | - public function count(){ |
|
73 | + public function count() { |
|
74 | 74 | return \sizeof($this->content); |
75 | 75 | } |
76 | 76 | |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | $this->addItems($function($object)); |
82 | 82 | } |
83 | 83 | |
84 | - public function apply($callBack){ |
|
85 | - foreach ($this->content as $item){ |
|
84 | + public function apply($callBack) { |
|
85 | + foreach ($this->content as $item) { |
|
86 | 86 | $callBack($item); |
87 | 87 | } |
88 | 88 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | public static function getConstants() { |
15 | 15 | if (self::$constCacheArray==NULL) { |
16 | - self::$constCacheArray=[ ]; |
|
16 | + self::$constCacheArray=[]; |
|
17 | 17 | } |
18 | 18 | $calledClass=get_called_class(); |
19 | 19 | if (!array_key_exists($calledClass, self::$constCacheArray)) { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | return self::$constCacheArray [$calledClass]; |
24 | 24 | } |
25 | 25 | |
26 | - public static function getConstantValues(){ |
|
26 | + public static function getConstantValues() { |
|
27 | 27 | return \array_values(self::getConstants()); |
28 | 28 | } |
29 | 29 |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @param string $identifier |
62 | 62 | * @param string $icon |
63 | 63 | */ |
64 | - public function htmlIcon($identifier,$icon){ |
|
64 | + public function htmlIcon($identifier, $icon) { |
|
65 | 65 | return $this->addHtmlComponent(new HtmlIcon($identifier, $icon)); |
66 | 66 | } |
67 | 67 | |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | * @param string $size |
71 | 71 | * @param array $icons |
72 | 72 | */ |
73 | - public function htmlIconGroups($identifier,$size="",$icons=array()){ |
|
74 | - $group=new HtmlIconGroups($identifier,$size); |
|
75 | - if(JArray::isAssociative($icons)){ |
|
76 | - foreach ($icons as $icon=>$size){ |
|
77 | - $group->add($icon,$size); |
|
73 | + public function htmlIconGroups($identifier, $size="", $icons=array()) { |
|
74 | + $group=new HtmlIconGroups($identifier, $size); |
|
75 | + if (JArray::isAssociative($icons)) { |
|
76 | + foreach ($icons as $icon=>$size) { |
|
77 | + $group->add($icon, $size); |
|
78 | 78 | } |
79 | - }else{ |
|
80 | - foreach ($icons as $icon){ |
|
79 | + }else { |
|
80 | + foreach ($icons as $icon) { |
|
81 | 81 | $group->add($icon); |
82 | 82 | } |
83 | 83 | } |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | * @param array $elements |
90 | 90 | * @param boolean $asIcons |
91 | 91 | */ |
92 | - public function htmlButtonGroups($identifier,$elements=array(),$asIcons=false){ |
|
93 | - return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements,$asIcons)); |
|
92 | + public function htmlButtonGroups($identifier, $elements=array(), $asIcons=false) { |
|
93 | + return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements, $asIcons)); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @param string $identifier |
99 | 99 | * @param string $content |
100 | 100 | */ |
101 | - public function htmlContainer($identifier,$content=""){ |
|
101 | + public function htmlContainer($identifier, $content="") { |
|
102 | 102 | return $this->addHtmlComponent(new HtmlContainer($identifier, $content)); |
103 | 103 | } |
104 | 104 | |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | * @param string $identifier |
107 | 107 | * @param string $content |
108 | 108 | */ |
109 | - public function htmlDivider($identifier,$content="",$tagName="div"){ |
|
110 | - return $this->addHtmlComponent(new HtmlDivider($identifier, $content,$tagName)); |
|
109 | + public function htmlDivider($identifier, $content="", $tagName="div") { |
|
110 | + return $this->addHtmlComponent(new HtmlDivider($identifier, $content, $tagName)); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -115,32 +115,32 @@ discard block |
||
115 | 115 | * @param string $content |
116 | 116 | * @param string $tagName |
117 | 117 | */ |
118 | - public function htmlLabel($identifier,$content="",$tagName="div"){ |
|
119 | - return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$tagName)); |
|
118 | + public function htmlLabel($identifier, $content="", $tagName="div") { |
|
119 | + return $this->addHtmlComponent(new HtmlLabel($identifier, $content, $tagName)); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
123 | 123 | * @param string $identifier |
124 | 124 | * @param array $items |
125 | 125 | */ |
126 | - public function htmlMenu($identifier,$items=array()){ |
|
127 | - return $this->addHtmlComponent(new HtmlMenu($identifier,$items)); |
|
126 | + public function htmlMenu($identifier, $items=array()) { |
|
127 | + return $this->addHtmlComponent(new HtmlMenu($identifier, $items)); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /**Adds an icon menu |
131 | 131 | * @param string $identifier |
132 | 132 | * @param array $items icons |
133 | 133 | */ |
134 | - public function htmlIconMenu($identifier,$items=array()){ |
|
135 | - return $this->addHtmlComponent(new HtmlIconMenu($identifier,$items)); |
|
134 | + public function htmlIconMenu($identifier, $items=array()) { |
|
135 | + return $this->addHtmlComponent(new HtmlIconMenu($identifier, $items)); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /**Adds an labeled icon menu |
139 | 139 | * @param string $identifier |
140 | 140 | * @param array $items icons |
141 | 141 | */ |
142 | - public function htmlLabeledIconMenu($identifier,$items=array()){ |
|
143 | - return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier,$items)); |
|
142 | + public function htmlLabeledIconMenu($identifier, $items=array()) { |
|
143 | + return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier, $items)); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | * @param string $value |
149 | 149 | * @param array $items |
150 | 150 | */ |
151 | - public function htmlDropdown($identifier, $value="", $items=array()){ |
|
152 | - return $this->addHtmlComponent(new HtmlDropdown($identifier,$value,$items)); |
|
151 | + public function htmlDropdown($identifier, $value="", $items=array()) { |
|
152 | + return $this->addHtmlComponent(new HtmlDropdown($identifier, $value, $items)); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | * @param string $identifier |
158 | 158 | * @param string $content |
159 | 159 | */ |
160 | - public function htmlMessage($identifier, $content=""){ |
|
161 | - return $this->addHtmlComponent(new HtmlMessage($identifier,$content)); |
|
160 | + public function htmlMessage($identifier, $content="") { |
|
161 | + return $this->addHtmlComponent(new HtmlMessage($identifier, $content)); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | * @param string $identifier |
167 | 167 | * @param string $content |
168 | 168 | */ |
169 | - public function htmlSegment($identifier, $content=""){ |
|
170 | - return $this->addHtmlComponent(new HtmlSegment($identifier,$content)); |
|
169 | + public function htmlSegment($identifier, $content="") { |
|
170 | + return $this->addHtmlComponent(new HtmlSegment($identifier, $content)); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -175,16 +175,16 @@ discard block |
||
175 | 175 | * @param string $identifier |
176 | 176 | * @param array $items the segments |
177 | 177 | */ |
178 | - public function htmlSegmentGroups($identifier, $items=array()){ |
|
179 | - return $this->addHtmlComponent(new HtmlSegmentGroups($identifier,$items)); |
|
178 | + public function htmlSegmentGroups($identifier, $items=array()) { |
|
179 | + return $this->addHtmlComponent(new HtmlSegmentGroups($identifier, $items)); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
183 | 183 | * @param string $identifier |
184 | 184 | * @param mixed $content |
185 | 185 | */ |
186 | - public function htmlPopup(BaseHtml $container,$identifier,$content){ |
|
187 | - return $this->addHtmlComponent(new HtmlPopup($container,$identifier,$content)); |
|
186 | + public function htmlPopup(BaseHtml $container, $identifier, $content) { |
|
187 | + return $this->addHtmlComponent(new HtmlPopup($container, $identifier, $content)); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -194,11 +194,11 @@ discard block |
||
194 | 194 | * @param boolean $createCols |
195 | 195 | * @param boolean $implicitRows |
196 | 196 | */ |
197 | - public function htmlGrid($identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){ |
|
198 | - return $this->addHtmlComponent(new HtmlGrid($identifier,$numRows,$numCols,$createCols,$implicitRows)); |
|
197 | + public function htmlGrid($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) { |
|
198 | + return $this->addHtmlComponent(new HtmlGrid($identifier, $numRows, $numCols, $createCols, $implicitRows)); |
|
199 | 199 | } |
200 | 200 | |
201 | - public function htmlHeader($identifier,$niveau=1,$content=NULL,$type="page"){ |
|
202 | - return $this->addHtmlComponent(new HtmlHeader($identifier,$niveau,$content,$type)); |
|
201 | + public function htmlHeader($identifier, $niveau=1, $content=NULL, $type="page") { |
|
202 | + return $this->addHtmlComponent(new HtmlHeader($identifier, $niveau, $content, $type)); |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | \ No newline at end of file |
@@ -11,7 +11,7 @@ |
||
11 | 11 | $this->setClass("ui image"); |
12 | 12 | } |
13 | 13 | |
14 | - public function setCircular(){ |
|
14 | + public function setCircular() { |
|
15 | 15 | return $this->addToProperty("class", "circular"); |
16 | 16 | } |
17 | 17 | } |
18 | 18 | \ No newline at end of file |
@@ -8,12 +8,12 @@ discard block |
||
8 | 8 | |
9 | 9 | class HtmlHeader extends HtmlSemDoubleElement { |
10 | 10 | protected $image; |
11 | - public function __construct($identifier, $niveau=1,$content=NULL,$type="page") { |
|
11 | + public function __construct($identifier, $niveau=1, $content=NULL, $type="page") { |
|
12 | 12 | parent::__construct($identifier, "div"); |
13 | 13 | $this->_template="<%tagName% %properties%>%image%%content%</%tagName%>"; |
14 | 14 | $this->setClass("ui header"); |
15 | - if(isset($type)){ |
|
16 | - if($type=="page"){ |
|
15 | + if (isset($type)) { |
|
16 | + if ($type=="page") { |
|
17 | 17 | $this->asPageHeader($niveau); |
18 | 18 | }else |
19 | 19 | $this->asContentHeader($niveau); |
@@ -21,39 +21,39 @@ discard block |
||
21 | 21 | $this->content=$content; |
22 | 22 | } |
23 | 23 | |
24 | - public function asPageHeader($niveau){ |
|
24 | + public function asPageHeader($niveau) { |
|
25 | 25 | $this->tagName="h".$niveau; |
26 | 26 | } |
27 | 27 | |
28 | - public function asContentHeader($niveau){ |
|
28 | + public function asContentHeader($niveau) { |
|
29 | 29 | $this->tagName="div"; |
30 | - if(\is_int($niveau)){ |
|
30 | + if (\is_int($niveau)) { |
|
31 | 31 | $niveau=Size::getConstantValues()[$niveau]; |
32 | 32 | } |
33 | 33 | $this->setSize($niveau); |
34 | 34 | } |
35 | 35 | |
36 | - public function asIcon($icon,$title,$subHeader=NULL){ |
|
36 | + public function asIcon($icon, $title, $subHeader=NULL) { |
|
37 | 37 | $this->addToProperty("class", "icon"); |
38 | 38 | $this->image=new HtmlIcon("icon-".$this->identifier, $icon); |
39 | - return $this->asTitle($title,$subHeader); |
|
39 | + return $this->asTitle($title, $subHeader); |
|
40 | 40 | } |
41 | 41 | |
42 | - public function asImage($src,$title,$subHeader=NULL){ |
|
43 | - $this->image=new HtmlImage("img-".$this->identifier, $src,$title); |
|
44 | - return $this->asTitle($title,$subHeader); |
|
42 | + public function asImage($src, $title, $subHeader=NULL) { |
|
43 | + $this->image=new HtmlImage("img-".$this->identifier, $src, $title); |
|
44 | + return $this->asTitle($title, $subHeader); |
|
45 | 45 | } |
46 | 46 | |
47 | - public function asTitle($title,$subHeader=NULL){ |
|
48 | - if(!\is_object($title)){ |
|
49 | - $this->content=new HtmlDoubleElement("content-".$this->identifier,"div"); |
|
47 | + public function asTitle($title, $subHeader=NULL) { |
|
48 | + if (!\is_object($title)) { |
|
49 | + $this->content=new HtmlDoubleElement("content-".$this->identifier, "div"); |
|
50 | 50 | $this->content->setContent($title); |
51 | - }else{ |
|
51 | + }else { |
|
52 | 52 | $this->content=$title; |
53 | 53 | } |
54 | 54 | $this->content->setClass("content"); |
55 | - if(isset($subHeader)){ |
|
56 | - $sub=new HtmlDoubleElement("subheader-".$this->identifier,"div"); |
|
55 | + if (isset($subHeader)) { |
|
56 | + $sub=new HtmlDoubleElement("subheader-".$this->identifier, "div"); |
|
57 | 57 | $sub->setClass("sub header"); |
58 | 58 | $sub->setContent($subHeader); |
59 | 59 | $this->content->addContent($sub); |