@@ -24,38 +24,38 @@ discard block |
||
24 | 24 | $this->setContent($content); |
25 | 25 | } |
26 | 26 | |
27 | - public function addHeader($header){ |
|
27 | + public function addHeader($header) { |
|
28 | 28 | $headerO=$header; |
29 | - if(\is_string($header)){ |
|
30 | - $headerO=new HtmlSemDoubleElement("header-".$this->identifier,"div"); |
|
29 | + if (\is_string($header)) { |
|
30 | + $headerO=new HtmlSemDoubleElement("header-".$this->identifier, "div"); |
|
31 | 31 | $headerO->setClass("header"); |
32 | 32 | $headerO->setContent($header); |
33 | 33 | } |
34 | - return $this->addContent($headerO,true); |
|
34 | + return $this->addContent($headerO, true); |
|
35 | 35 | } |
36 | 36 | |
37 | - public function addList($elements,$ordered=false){ |
|
38 | - $list=new HtmlList("list-".$this->identifier,$elements); |
|
37 | + public function addList($elements, $ordered=false) { |
|
38 | + $list=new HtmlList("list-".$this->identifier, $elements); |
|
39 | 39 | $list->setOrdered($ordered); |
40 | 40 | $list->setClass("ui list"); |
41 | 41 | $this->addContent($list); |
42 | 42 | } |
43 | 43 | |
44 | - public function setIcon($icon){ |
|
44 | + public function setIcon($icon) { |
|
45 | 45 | $this->addToProperty("class", "icon"); |
46 | - $this->wrapContent("<div class='content'>","</div>"); |
|
46 | + $this->wrapContent("<div class='content'>", "</div>"); |
|
47 | 47 | $this->icon=new HtmlIcon("icon-".$this->identifier, $icon); |
48 | 48 | return $this; |
49 | 49 | } |
50 | 50 | |
51 | - public function addLoader($loaderIcon="notched circle"){ |
|
51 | + public function addLoader($loaderIcon="notched circle") { |
|
52 | 52 | $this->setIcon($loaderIcon); |
53 | 53 | $this->icon->addToIcon("loading"); |
54 | 54 | return $this; |
55 | 55 | } |
56 | 56 | |
57 | - public function setDismissable($dismiss=true){ |
|
58 | - if($dismiss===true) |
|
57 | + public function setDismissable($dismiss=true) { |
|
58 | + if ($dismiss===true) |
|
59 | 59 | $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
60 | 60 | else |
61 | 61 | $this->close=NULL; |
@@ -66,28 +66,28 @@ discard block |
||
66 | 66 | * {@inheritDoc} |
67 | 67 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
68 | 68 | */ |
69 | - public function run(JsUtils $js){ |
|
69 | + public function run(JsUtils $js) { |
|
70 | 70 | parent::run($js); |
71 | - if(isset($this->close)){ |
|
71 | + if (isset($this->close)) { |
|
72 | 72 | $js->execOn("click", "#".$this->identifier." .close", "$(this).closest('.message').transition('fade')"); |
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | - public function setState($visible=true){ |
|
77 | - $visible=($visible===true)?"visible":"hidden"; |
|
78 | - return $this->addToPropertyCtrl("class", $visible, array("visible","hidden")); |
|
76 | + public function setState($visible=true) { |
|
77 | + $visible=($visible===true) ? "visible" : "hidden"; |
|
78 | + return $this->addToPropertyCtrl("class", $visible, array("visible", "hidden")); |
|
79 | 79 | } |
80 | 80 | |
81 | - public function setVariation($value="floating"){ |
|
82 | - return $this->addToPropertyCtrl("class", $value, array("floating","compact")); |
|
81 | + public function setVariation($value="floating") { |
|
82 | + return $this->addToPropertyCtrl("class", $value, array("floating", "compact")); |
|
83 | 83 | } |
84 | 84 | |
85 | - public function setStyle($style){ |
|
85 | + public function setStyle($style) { |
|
86 | 86 | return $this->addToPropertyCtrl("class", $style, Style::getConstants()); |
87 | 87 | } |
88 | 88 | |
89 | - public function setAttached(HtmlDoubleElement $toElement=NULL){ |
|
90 | - if(isset($toElement)){ |
|
89 | + public function setAttached(HtmlDoubleElement $toElement=NULL) { |
|
90 | + if (isset($toElement)) { |
|
91 | 91 | $toElement->addToProperty("class", "attached"); |
92 | 92 | } |
93 | 93 | return $this->addToProperty("class", "attached"); |
@@ -13,8 +13,8 @@ |
||
13 | 13 | parent::__construct($identifier, "ul"); |
14 | 14 | $this->addItems($items); |
15 | 15 | } |
16 | - public function setOrdered($ordered=true){ |
|
17 | - $this->tagName=($ordered===true)?"ol":"ul"; |
|
16 | + public function setOrdered($ordered=true) { |
|
17 | + $this->tagName=($ordered===true) ? "ol" : "ul"; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | class SegmentType extends BaseEnum { |
8 | - const RAISED="raised",STACKED="stacked",PILED="piled",NORMAL=""; |
|
8 | + const RAISED="raised", STACKED="stacked", PILED="piled", NORMAL=""; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -5,18 +5,18 @@ discard block |
||
5 | 5 | use Ajax\common\html\html5\HtmlCollection; |
6 | 6 | use Ajax\semantic\html\base\SegmentType; |
7 | 7 | |
8 | -class HtmlSegmentGroups extends HtmlCollection{ |
|
8 | +class HtmlSegmentGroups extends HtmlCollection { |
|
9 | 9 | |
10 | 10 | |
11 | - public function __construct( $identifier, $items=array()){ |
|
12 | - parent::__construct( $identifier, "div"); |
|
11 | + public function __construct($identifier, $items=array()) { |
|
12 | + parent::__construct($identifier, "div"); |
|
13 | 13 | $this->setClass("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,17 +24,17 @@ discard block |
||
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="vertical"){ |
|
32 | - return $this->addToPropertyCtrl("class", $sens, array("vertical","horizontal")); |
|
31 | + public function setSens($sens="vertical") { |
|
32 | + return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal")); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | - public static function group($identifier,$items=array(),$type="",$sens="vertical"){ |
|
37 | - $group=new HtmlSegmentGroups($identifier,$items); |
|
36 | + public static function group($identifier, $items=array(), $type="", $sens="vertical") { |
|
37 | + $group=new HtmlSegmentGroups($identifier, $items); |
|
38 | 38 | $group->setSens($sens); |
39 | 39 | return $group->setType($type); |
40 | 40 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * {@inheritDoc} |
21 | 21 | * @see \Ajax\common\html\HtmlSingleElement::setSize() |
22 | 22 | */ |
23 | - public function setSize($size){ |
|
23 | + public function setSize($size) { |
|
24 | 24 | return $this->addToPropertyCtrl("class", $size, Size::getConstants()); |
25 | 25 | } |
26 | 26 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * show it is currently unable to be interacted with |
29 | 29 | * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement |
30 | 30 | */ |
31 | - public function setDisabled(){ |
|
31 | + public function setDisabled() { |
|
32 | 32 | return $this->addToProperty("class", "disabled"); |
33 | 33 | } |
34 | 34 | |
@@ -36,35 +36,35 @@ discard block |
||
36 | 36 | * @param string $color |
37 | 37 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
38 | 38 | */ |
39 | - public function setColor($color){ |
|
40 | - return $this->addToPropertyCtrl("class", $color,Color::getConstants()); |
|
39 | + public function setColor($color) { |
|
40 | + return $this->addToPropertyCtrl("class", $color, Color::getConstants()); |
|
41 | 41 | } |
42 | 42 | |
43 | - public function setPopupAttributes($variation=NULL,$popupEvent=NULL){ |
|
44 | - if(isset($this->_popup)) |
|
45 | - $this->_popup->setAttributes($variation,$popupEvent); |
|
43 | + public function setPopupAttributes($variation=NULL, $popupEvent=NULL) { |
|
44 | + if (isset($this->_popup)) |
|
45 | + $this->_popup->setAttributes($variation, $popupEvent); |
|
46 | 46 | } |
47 | 47 | |
48 | - public function addPopup($title="",$content="",$variation=NULL,$params=array()){ |
|
49 | - $this->_popup=new InternalPopup($this,$title,$content,$variation,$params); |
|
48 | + public function addPopup($title="", $content="", $variation=NULL, $params=array()) { |
|
49 | + $this->_popup=new InternalPopup($this, $title, $content, $variation, $params); |
|
50 | 50 | return $this; |
51 | 51 | } |
52 | 52 | |
53 | - public function addPopupHtml($html="",$variation=NULL,$params=array()){ |
|
53 | + public function addPopupHtml($html="", $variation=NULL, $params=array()) { |
|
54 | 54 | $this->_popup=new InternalPopup($this); |
55 | 55 | $this->_popup->setHtml($html); |
56 | - $this->_popup->setAttributes($variation,$params); |
|
56 | + $this->_popup->setAttributes($variation, $params); |
|
57 | 57 | return $this; |
58 | 58 | } |
59 | 59 | |
60 | - public function setFluid(){ |
|
60 | + public function setFluid() { |
|
61 | 61 | $this->addToProperty("class", "fluid"); |
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | 65 | * can be formatted to appear on dark backgrounds |
66 | 66 | */ |
67 | - public function setInverted(){ |
|
67 | + public function setInverted() { |
|
68 | 68 | $this->addToProperty("class", "inverted"); |
69 | 69 | } |
70 | 70 | |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | * @param boolean $labeled |
76 | 76 | * @return \Ajax\semantic\html\elements\HtmlIcon |
77 | 77 | */ |
78 | - public function addIcon($icon,$before=true,$labeled=false){ |
|
78 | + public function addIcon($icon, $before=true, $labeled=false) { |
|
79 | 79 | $iconO=$icon; |
80 | - if(\is_string($icon)){ |
|
80 | + if (\is_string($icon)) { |
|
81 | 81 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
82 | 82 | } |
83 | - if($labeled!==false){ |
|
83 | + if ($labeled!==false) { |
|
84 | 84 | $this->addToProperty("class", "labeled icon"); |
85 | 85 | $this->tagName="div"; |
86 | 86 | } |
87 | - $this->addContent($iconO,$before); |
|
87 | + $this->addContent($iconO, $before); |
|
88 | 88 | return $iconO; |
89 | 89 | } |
90 | 90 | |
@@ -92,18 +92,18 @@ discard block |
||
92 | 92 | * show a loading indicator |
93 | 93 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
94 | 94 | */ |
95 | - public function asLoader(){ |
|
95 | + public function asLoader() { |
|
96 | 96 | return $this->addToProperty("class", "loading"); |
97 | 97 | } |
98 | 98 | |
99 | - public function compile(JsUtils $js=NULL, View $view=NULL){ |
|
100 | - if(isset($this->_popup)) |
|
99 | + public function compile(JsUtils $js=NULL, View $view=NULL) { |
|
100 | + if (isset($this->_popup)) |
|
101 | 101 | $this->_popup->compile(); |
102 | - return parent::compile($js,$view); |
|
102 | + return parent::compile($js, $view); |
|
103 | 103 | } |
104 | - public function run(JsUtils $js){ |
|
104 | + public function run(JsUtils $js) { |
|
105 | 105 | parent::run($js); |
106 | - if(isset($this->_popup)){ |
|
106 | + if (isset($this->_popup)) { |
|
107 | 107 | $this->_popup->run($js); |
108 | 108 | //$this->addEventsOnRun($js); |
109 | 109 | //return $this->_bsComponent; |
@@ -47,20 +47,20 @@ discard block |
||
47 | 47 | * @return \Ajax\semantic\html\HtmlButton default : "" |
48 | 48 | */ |
49 | 49 | public function setStyle($cssStyle) { |
50 | - return $this->addToProperty("class",$cssStyle); |
|
50 | + return $this->addToProperty("class", $cssStyle); |
|
51 | 51 | } |
52 | 52 | |
53 | - public function setFocusable(){ |
|
53 | + public function setFocusable() { |
|
54 | 54 | $this->setProperty("tabindex", "0"); |
55 | 55 | } |
56 | 56 | |
57 | - public function setAnimated($content,$animation=""){ |
|
57 | + public function setAnimated($content, $animation="") { |
|
58 | 58 | $this->setTagName("div"); |
59 | 59 | $this->addToProperty("class", "animated ".$animation); |
60 | - $visible=new HtmlSemDoubleElement("visible-".$this->identifier,"div"); |
|
60 | + $visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div"); |
|
61 | 61 | $visible->setClass("visible content"); |
62 | 62 | $visible->setContent($this->content); |
63 | - $hidden=new HtmlSemDoubleElement("hidden-".$this->identifier,"div"); |
|
63 | + $hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div"); |
|
64 | 64 | $hidden->setClass("hidden content"); |
65 | 65 | $hidden->setContent($content); |
66 | 66 | $this->content=$visible.$hidden; |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | * @param string|HtmlIcon $icon |
71 | 71 | * @return \Ajax\semantic\html\elements\HtmlButton |
72 | 72 | */ |
73 | - public function asIcon($icon){ |
|
73 | + public function asIcon($icon) { |
|
74 | 74 | $iconO=$icon; |
75 | - if(\is_string($icon)){ |
|
75 | + if (\is_string($icon)) { |
|
76 | 76 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
77 | 77 | } |
78 | 78 | $this->addToProperty("class", "icon"); |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | * @param string $before |
87 | 87 | * @return \Ajax\semantic\html\elements\HtmlLabel |
88 | 88 | */ |
89 | - public function addLabel($caption,$before=false){ |
|
89 | + public function addLabel($caption, $before=false) { |
|
90 | 90 | $this->tagName="div"; |
91 | 91 | $this->addToProperty("class", "labeled"); |
92 | - $this->content=new HtmlButton("button-".$this->identifier,$this->content); |
|
92 | + $this->content=new HtmlButton("button-".$this->identifier, $this->content); |
|
93 | 93 | $this->content->setTagName("div"); |
94 | - $label=new HtmlLabel("label-".$this->identifier,$caption,"a"); |
|
94 | + $label=new HtmlLabel("label-".$this->identifier, $caption, "a"); |
|
95 | 95 | $label->setBasic(); |
96 | - $this->addContent($label,$before); |
|
96 | + $this->addContent($label, $before); |
|
97 | 97 | return $label; |
98 | 98 | } |
99 | 99 | /* |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function fromArray($array) { |
104 | 104 | $array=parent::fromArray($array); |
105 | - foreach ( $array as $key => $value ) { |
|
105 | + foreach ($array as $key => $value) { |
|
106 | 106 | $this->setProperty($key, $value); |
107 | 107 | } |
108 | 108 | return $array; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * show it is currently the active user selection |
113 | 113 | * @return \Ajax\semantic\html\elements\HtmlButton |
114 | 114 | */ |
115 | - public function setActive(){ |
|
115 | + public function setActive() { |
|
116 | 116 | return $this->addToProperty("class", "active"); |
117 | 117 | } |
118 | 118 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * hint towards a positive consequence |
121 | 121 | * @return \Ajax\semantic\html\elements\HtmlButton |
122 | 122 | */ |
123 | - public function setPositive(){ |
|
123 | + public function setPositive() { |
|
124 | 124 | return $this->addToProperty("class", "positive"); |
125 | 125 | } |
126 | 126 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * hint towards a negative consequence |
129 | 129 | * @return \Ajax\semantic\html\elements\HtmlButton |
130 | 130 | */ |
131 | - public function setNegative(){ |
|
131 | + public function setNegative() { |
|
132 | 132 | return $this->addToProperty("class", "negative"); |
133 | 133 | } |
134 | 134 | |
@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | * formatted to toggle on/off |
137 | 137 | * @return \Ajax\semantic\html\elements\HtmlButton |
138 | 138 | */ |
139 | - public function setToggle(){ |
|
139 | + public function setToggle() { |
|
140 | 140 | return $this->addToProperty("class", "toggle"); |
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
144 | 144 | * @return \Ajax\semantic\html\elements\HtmlButton |
145 | 145 | */ |
146 | - public function setCircular(){ |
|
146 | + public function setCircular() { |
|
147 | 147 | return $this->addToProperty("class", "circular"); |
148 | 148 | } |
149 | 149 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * button is less pronounced |
152 | 152 | * @return \Ajax\semantic\html\elements\HtmlButton |
153 | 153 | */ |
154 | - public function setBasic(){ |
|
154 | + public function setBasic() { |
|
155 | 155 | return $this->addToProperty("class", "basic"); |
156 | 156 | } |
157 | 157 | } |
158 | 158 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | return $this->setParam("onShow", "%function(){".$jsCode."}%"); |
31 | 31 | } |
32 | 32 | |
33 | - public function setExclusive($value){ |
|
33 | + public function setExclusive($value) { |
|
34 | 34 | return $this->setParam("exclusive", $value); |
35 | 35 | } |
36 | 36 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * @param string $popup the css selector of the popup |
40 | 40 | * @return \Ajax\semantic\components\Popup |
41 | 41 | */ |
42 | - public function setPopup($popup){ |
|
42 | + public function setPopup($popup) { |
|
43 | 43 | return $this->setParam("popup", $popup); |
44 | 44 | } |
45 | 45 | //TODO other events implementation |
@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Wide extends BaseEnum { |
5 | - const W1="one", W2="two", W3="three", W4="four",W5="five", W6="six", W7="seven", W8="eight",W9="nine",W10="ten",W11="eleven",W12="twelve",W13="thirteen",W14="fourteen",W15="fifteen",W16="sixteen"; |
|
5 | + const W1="one", W2="two", W3="three", W4="four", W5="five", W6="six", W7="seven", W8="eight", W9="nine", W10="ten", W11="eleven", W12="twelve", W13="thirteen", W14="fourteen", W15="fifteen", W16="sixteen"; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | protected $attr; |
20 | 20 | |
21 | 21 | |
22 | - public function __construct($identifier,$tagName){ |
|
23 | - parent::__construct($identifier,$tagName); |
|
22 | + public function __construct($identifier, $tagName) { |
|
23 | + parent::__construct($identifier, $tagName); |
|
24 | 24 | $this->root=""; |
25 | 25 | $this->attr="data-ajax"; |
26 | 26 | } |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | * @param string $attr the html attribute used to build the elements url |
33 | 33 | * @return HtmlNavElement |
34 | 34 | */ |
35 | - public function autoGetOnClick($targetSelector){ |
|
36 | - return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
|
35 | + public function autoGetOnClick($targetSelector) { |
|
36 | + return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr)); |
|
37 | 37 | } |
38 | 38 | |
39 | - public function contentAsString(){ |
|
39 | + public function contentAsString() { |
|
40 | 40 | return implode("", $this->content); |
41 | 41 | } |
42 | 42 | |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | * Generate the jquery script to set the elements to the HtmlNavElement |
45 | 45 | * @param JsUtils $jsUtils |
46 | 46 | */ |
47 | - public function jsSetContent(JsUtils $jsUtils){ |
|
48 | - $jsUtils->html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true); |
|
47 | + public function jsSetContent(JsUtils $jsUtils) { |
|
48 | + $jsUtils->html("#".$this->identifier, str_replace("\"", "'", $this->contentAsString()), true); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | public function getRoot() { |
52 | 52 | return $this->root; |
53 | 53 | } |
54 | 54 | public function setRoot($root) { |
55 | - $this->root = $root; |
|
55 | + $this->root=$root; |
|
56 | 56 | return $this; |
57 | 57 | } |
58 | 58 | public function getAttr() { |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | * @return HtmlNavElement |
66 | 66 | */ |
67 | 67 | public function setAttr($attr) { |
68 | - $this->attr = $attr; |
|
68 | + $this->attr=$attr; |
|
69 | 69 | return $this; |
70 | 70 | } |
71 | 71 | |
72 | 72 | public function __call($method, $args) { |
73 | - if(isset($this->$method) && is_callable($this->$method)) { |
|
73 | + if (isset($this->$method) && is_callable($this->$method)) { |
|
74 | 74 | return call_user_func_array( |
75 | 75 | $this->$method, |
76 | 76 | $args |
@@ -78,6 +78,6 @@ discard block |
||
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
81 | - public abstract function fromDispatcher($dispatcher,$startIndex=0); |
|
81 | + public abstract function fromDispatcher($dispatcher, $startIndex=0); |
|
82 | 82 | |
83 | 83 | } |
84 | 84 | \ No newline at end of file |