@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * @author jc |
15 | 15 | * @version 1.001 |
16 | 16 | */ |
17 | -class HtmlBreadcrumb extends HtmlSemNavElement{ |
|
17 | +class HtmlBreadcrumb extends HtmlSemNavElement { |
|
18 | 18 | /** |
19 | 19 | * @var integer the start index for href generation |
20 | 20 | */ |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | * @param boolean $autoActive sets the last element's class to <b>active</b> if true |
41 | 41 | * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()} |
42 | 42 | */ |
43 | - public function __construct( $identifier,$items=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){ |
|
44 | - parent::__construct( $identifier, "div", "ui breadcrumb"); |
|
43 | + public function __construct($identifier, $items=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) { |
|
44 | + parent::__construct($identifier, "div", "ui breadcrumb"); |
|
45 | 45 | $this->startIndex=$startIndex; |
46 | 46 | $this->autoActive=$autoActive; |
47 | 47 | $this->_contentSeparator="<div class='divider'> / </div>"; |
48 | - $this->_hrefFunction=function ($e){return $e->getContent();}; |
|
49 | - if(isset($hrefFunction)){ |
|
48 | + $this->_hrefFunction=function($e) {return $e->getContent(); }; |
|
49 | + if (isset($hrefFunction)) { |
|
50 | 50 | $this->_hrefFunction=$hrefFunction; |
51 | 51 | } |
52 | 52 | $this->addItems($items); |
@@ -59,23 +59,23 @@ discard block |
||
59 | 59 | * @param string $attr the html attribute used to build the elements url |
60 | 60 | * @return HtmlBreadcrumbs |
61 | 61 | */ |
62 | - public function autoGetOnClick($targetSelector){ |
|
63 | - return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
|
62 | + public function autoGetOnClick($targetSelector) { |
|
63 | + return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr)); |
|
64 | 64 | } |
65 | 65 | |
66 | - public function contentAsString(){ |
|
67 | - if($this->autoActive){ |
|
66 | + public function contentAsString() { |
|
67 | + if ($this->autoActive) { |
|
68 | 68 | $this->setActive(); |
69 | 69 | } |
70 | 70 | return parent::contentAsString(); |
71 | 71 | } |
72 | 72 | |
73 | - public function setActive($index=null){ |
|
74 | - if(!isset($index)){ |
|
73 | + public function setActive($index=null) { |
|
74 | + if (!isset($index)) { |
|
75 | 75 | $index=sizeof($this->content)-1; |
76 | 76 | } |
77 | 77 | $activeItem=$this->content[$index]; |
78 | - $activeItem->addToProperty("class","active"); |
|
78 | + $activeItem->addToProperty("class", "active"); |
|
79 | 79 | $activeItem->setTagName("div"); |
80 | 80 | } |
81 | 81 | |
@@ -84,15 +84,15 @@ discard block |
||
84 | 84 | * @param Dispatcher $dispatcher the request dispatcher |
85 | 85 | * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
86 | 86 | */ |
87 | - public function fromDispatcher($dispatcher,$startIndex=0){ |
|
87 | + public function fromDispatcher($dispatcher, $startIndex=0) { |
|
88 | 88 | $this->startIndex=$startIndex; |
89 | 89 | $params=$dispatcher->getParams(); |
90 | 90 | $action=$dispatcher->getActionName(); |
91 | 91 | $items=array($dispatcher->getControllerName()); |
92 | - if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
|
92 | + if (\sizeof($params)>0 || \strtolower($action)!="index") { |
|
93 | 93 | $items[]=$action; |
94 | - foreach ($params as $p){ |
|
95 | - if(\is_object($p)===false) |
|
94 | + foreach ($params as $p) { |
|
95 | + if (\is_object($p)===false) |
|
96 | 96 | $items[]=$p; |
97 | 97 | } |
98 | 98 | } |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | * @param string $separator |
106 | 106 | * @return string |
107 | 107 | */ |
108 | - public function getHref($index=null,$separator="/"){ |
|
109 | - if(!isset($index)){ |
|
108 | + public function getHref($index=null, $separator="/") { |
|
109 | + if (!isset($index)) { |
|
110 | 110 | $index=sizeof($this->content); |
111 | 111 | } |
112 | - if($this->absolutePaths===true){ |
|
112 | + if ($this->absolutePaths===true) { |
|
113 | 113 | return $this->_hrefFunction($this->content[$index]); |
114 | - }else{ |
|
115 | - return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1)); |
|
114 | + }else { |
|
115 | + return $this->root.implode($separator, array_slice(array_map(function($e) {return $this->_hrefFunction($e); }, $this->content), $this->startIndex, $index+1)); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
123 | 123 | */ |
124 | 124 | public function setHrefFunction($_hrefFunction) { |
125 | - $this->_hrefFunction = $_hrefFunction; |
|
125 | + $this->_hrefFunction=$_hrefFunction; |
|
126 | 126 | return $this; |
127 | 127 | } |
128 | 128 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | public function setAutoActive($autoActive) { |
135 | - $this->autoActive = $autoActive; |
|
135 | + $this->autoActive=$autoActive; |
|
136 | 136 | return $this; |
137 | 137 | } |
138 | 138 | |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | * @see \Ajax\bootstrap\html\BaseHtml::compile() |
142 | 142 | */ |
143 | 143 | public function compile(JsUtils $js=NULL, View $view=NULL) { |
144 | - if($this->autoActive){ |
|
144 | + if ($this->autoActive) { |
|
145 | 145 | $this->setActive(); |
146 | 146 | } |
147 | 147 | $count=$this->count(); |
148 | - for($i=1;$i<$count;$i++){ |
|
148 | + for ($i=1; $i<$count; $i++) { |
|
149 | 149 | $this->content[$i]->wrap($this->getContentDivider($i-1)); |
150 | 150 | } |
151 | 151 | return parent::compile($js, $view); |
@@ -156,16 +156,16 @@ discard block |
||
156 | 156 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
157 | 157 | */ |
158 | 158 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
159 | - foreach ($this->content as $element){ |
|
160 | - $element->on($event,$jsCode,$stopPropagation,$preventDefault); |
|
159 | + foreach ($this->content as $element) { |
|
160 | + $element->on($event, $jsCode, $stopPropagation, $preventDefault); |
|
161 | 161 | } |
162 | 162 | return $this; |
163 | 163 | } |
164 | 164 | |
165 | 165 | |
166 | 166 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
167 | - foreach ($this->content as $element){ |
|
168 | - if($element->getProperty($this->attr)!=NULL) |
|
167 | + foreach ($this->content as $element) { |
|
168 | + if ($element->getProperty($this->attr)!=NULL) |
|
169 | 169 | $element->_ajaxOn($operation, $event, $url, $responseElement, $parameters); |
170 | 170 | } |
171 | 171 | return $this; |
@@ -177,35 +177,35 @@ discard block |
||
177 | 177 | */ |
178 | 178 | protected function createItem($value) { |
179 | 179 | $count=$this->count(); |
180 | - $itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count,"a","section"); |
|
181 | - if(\is_array($value)) |
|
180 | + $itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "a", "section"); |
|
181 | + if (\is_array($value)) |
|
182 | 182 | $itemO->fromArray($value); |
183 | - else{ |
|
183 | + else { |
|
184 | 184 | $itemO->setContent($value); |
185 | 185 | $itemO->setProperty($this->attr, $this->getHref($count)); |
186 | 186 | } |
187 | 187 | return $itemO; |
188 | 188 | } |
189 | 189 | |
190 | - public function addIcon($icon,$index){ |
|
190 | + public function addIcon($icon, $index) { |
|
191 | 191 | $item=$this->getItem($index); |
192 | - if(isset($item)){ |
|
192 | + if (isset($item)) { |
|
193 | 193 | $icon=new HtmlIcon("icon-".$this->identifier, $icon); |
194 | 194 | $item->wrapContent($icon); |
195 | 195 | } |
196 | 196 | } |
197 | 197 | |
198 | - public function addItem($item){ |
|
198 | + public function addItem($item) { |
|
199 | 199 | $itemO=parent::addItem($item); |
200 | 200 | $this->addToPropertyCtrl("class", "section", array("section")); |
201 | 201 | return $itemO; |
202 | 202 | } |
203 | 203 | |
204 | - public function asLinks(){ |
|
204 | + public function asLinks() { |
|
205 | 205 | $this->contentAs("a"); |
206 | 206 | } |
207 | 207 | |
208 | - public function asTexts(){ |
|
208 | + public function asTexts() { |
|
209 | 209 | $this->contentAs("div"); |
210 | 210 | } |
211 | 211 |
@@ -92,8 +92,9 @@ discard block |
||
92 | 92 | if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
93 | 93 | $items[]=$action; |
94 | 94 | foreach ($params as $p){ |
95 | - if(\is_object($p)===false) |
|
96 | - $items[]=$p; |
|
95 | + if(\is_object($p)===false) { |
|
96 | + $items[]=$p; |
|
97 | + } |
|
97 | 98 | } |
98 | 99 | } |
99 | 100 | return $this->addItems($items); |
@@ -111,7 +112,7 @@ discard block |
||
111 | 112 | } |
112 | 113 | if($this->absolutePaths===true){ |
113 | 114 | return $this->_hrefFunction($this->content[$index]); |
114 | - }else{ |
|
115 | + } else{ |
|
115 | 116 | return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1)); |
116 | 117 | } |
117 | 118 | } |
@@ -165,8 +166,9 @@ discard block |
||
165 | 166 | |
166 | 167 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
167 | 168 | foreach ($this->content as $element){ |
168 | - if($element->getProperty($this->attr)!=NULL) |
|
169 | - $element->_ajaxOn($operation, $event, $url, $responseElement, $parameters); |
|
169 | + if($element->getProperty($this->attr)!=NULL) { |
|
170 | + $element->_ajaxOn($operation, $event, $url, $responseElement, $parameters); |
|
171 | + } |
|
170 | 172 | } |
171 | 173 | return $this; |
172 | 174 | } |
@@ -178,9 +180,9 @@ discard block |
||
178 | 180 | protected function createItem($value) { |
179 | 181 | $count=$this->count(); |
180 | 182 | $itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count,"a","section"); |
181 | - if(\is_array($value)) |
|
182 | - $itemO->fromArray($value); |
|
183 | - else{ |
|
183 | + if(\is_array($value)) { |
|
184 | + $itemO->fromArray($value); |
|
185 | + } else{ |
|
184 | 186 | $itemO->setContent($value); |
185 | 187 | $itemO->setProperty($this->attr, $this->getHref($count)); |
186 | 188 | } |
@@ -57,8 +57,7 @@ discard block |
||
57 | 57 | * Associate an ajax get to the breadcrumb elements, displayed in $targetSelector |
58 | 58 | * $attr member is used to build each element url |
59 | 59 | * @param string $targetSelector the target of the get |
60 | - * @param string $attr the html attribute used to build the elements url |
|
61 | - * @return HtmlBreadcrumbs |
|
60 | + * @return HtmlBreadcrumb |
|
62 | 61 | */ |
63 | 62 | public function autoGetOnClick($targetSelector){ |
64 | 63 | return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
@@ -83,7 +82,7 @@ discard block |
||
83 | 82 | /** |
84 | 83 | * Add new elements in breadcrumbs corresponding to request dispatcher : controllerName, actionName, parameters |
85 | 84 | * @param Dispatcher $dispatcher the request dispatcher |
86 | - * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
|
85 | + * @return HtmlBreadcrumb |
|
87 | 86 | */ |
88 | 87 | public function fromDispatcher($dispatcher,$startIndex=0){ |
89 | 88 | $this->startIndex=$startIndex; |
@@ -120,7 +119,7 @@ discard block |
||
120 | 119 | /** |
121 | 120 | * sets the function who generates the href elements. default : function($element){return $element->getContent()} |
122 | 121 | * @param function $_hrefFunction |
123 | - * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
|
122 | + * @return HtmlBreadcrumb |
|
124 | 123 | */ |
125 | 124 | public function setHrefFunction($_hrefFunction) { |
126 | 125 | $this->_hrefFunction = $_hrefFunction; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
17 | 17 | $this->addContent($iconO,false); |
18 | 18 | $this->_hasIcon=true; |
19 | - }else{ |
|
19 | + } else{ |
|
20 | 20 | $iconO=$this->getIcon(); |
21 | 21 | $iconO->setIcon($icon); |
22 | 22 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
@@ -27,8 +27,9 @@ discard block |
||
27 | 27 | public function getIcon(){ |
28 | 28 | if(\is_array($this->content)){ |
29 | 29 | foreach ($this->content as $item){ |
30 | - if($item instanceof HtmlIcon) |
|
31 | - return $item; |
|
30 | + if($item instanceof HtmlIcon) { |
|
31 | + return $item; |
|
32 | + } |
|
32 | 33 | } |
33 | 34 | } |
34 | 35 | } |
@@ -7,9 +7,16 @@ |
||
7 | 7 | trait IconTrait { |
8 | 8 | private $_hasIcon=false; |
9 | 9 | |
10 | + /** |
|
11 | + * @param string $name |
|
12 | + * @param string $value |
|
13 | + */ |
|
10 | 14 | protected abstract function addToPropertyCtrl($name, $value, $typeCtrl); |
11 | 15 | public abstract function addContent($content,$before=false); |
12 | 16 | |
17 | + /** |
|
18 | + * @param boolean $direction |
|
19 | + */ |
|
13 | 20 | public function addIcon($icon,$direction=Direction::LEFT){ |
14 | 21 | if($this->_hasIcon===false){ |
15 | 22 | $iconO=$icon; |
@@ -8,18 +8,18 @@ discard block |
||
8 | 8 | private $_hasIcon=false; |
9 | 9 | |
10 | 10 | protected abstract function addToPropertyCtrl($name, $value, $typeCtrl); |
11 | - public abstract function addContent($content,$before=false); |
|
11 | + public abstract function addContent($content, $before=false); |
|
12 | 12 | |
13 | - public function addIcon($icon,$direction=Direction::LEFT){ |
|
14 | - if($this->_hasIcon===false){ |
|
13 | + public function addIcon($icon, $direction=Direction::LEFT) { |
|
14 | + if ($this->_hasIcon===false) { |
|
15 | 15 | $iconO=$icon; |
16 | - if(\is_string($icon)){ |
|
16 | + if (\is_string($icon)) { |
|
17 | 17 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
18 | 18 | } |
19 | 19 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
20 | - $this->addContent($iconO,false); |
|
20 | + $this->addContent($iconO, false); |
|
21 | 21 | $this->_hasIcon=true; |
22 | - }else{ |
|
22 | + }else { |
|
23 | 23 | $iconO=$this->getIcon(); |
24 | 24 | $iconO->setIcon($icon); |
25 | 25 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | return $iconO; |
28 | 28 | } |
29 | 29 | |
30 | - public function getIcon(){ |
|
31 | - if(\is_array($this->content)){ |
|
32 | - foreach ($this->content as $item){ |
|
33 | - if($item instanceof HtmlIcon) |
|
30 | + public function getIcon() { |
|
31 | + if (\is_array($this->content)) { |
|
32 | + foreach ($this->content as $item) { |
|
33 | + if ($item instanceof HtmlIcon) |
|
34 | 34 | return $item; |
35 | 35 | } |
36 | 36 | } |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | abstract class Emphasis extends BaseEnum { |
8 | - const PRIMARY="primary",SECONDARY="secondary",TERTIARY="tertiary"; |
|
8 | + const PRIMARY="primary", SECONDARY="secondary", TERTIARY="tertiary"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | protected $_contentSeparator=""; |
23 | 23 | |
24 | 24 | |
25 | - public function __construct($identifier,$tagName,$baseClass){ |
|
26 | - parent::__construct($identifier,$tagName,$baseClass); |
|
25 | + public function __construct($identifier, $tagName, $baseClass) { |
|
26 | + parent::__construct($identifier, $tagName, $baseClass); |
|
27 | 27 | $this->root=""; |
28 | 28 | $this->attr="data-ajax"; |
29 | 29 | } |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | * @param string $attr the html attribute used to build the elements url |
36 | 36 | * @return HtmlNavElement |
37 | 37 | */ |
38 | - public function autoGetOnClick($targetSelector){ |
|
39 | - return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
|
38 | + public function autoGetOnClick($targetSelector) { |
|
39 | + return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr)); |
|
40 | 40 | } |
41 | 41 | |
42 | - public function contentAsString(){ |
|
42 | + public function contentAsString() { |
|
43 | 43 | return JArray::implode($this->_contentSeparator, $this->content); |
44 | 44 | } |
45 | 45 | |
@@ -47,15 +47,15 @@ discard block |
||
47 | 47 | * Generate the jquery script to set the elements to the HtmlNavElement |
48 | 48 | * @param JsUtils $jsUtils |
49 | 49 | */ |
50 | - public function jsSetContent(JsUtils $jsUtils){ |
|
51 | - $jsUtils->html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true); |
|
50 | + public function jsSetContent(JsUtils $jsUtils) { |
|
51 | + $jsUtils->html("#".$this->identifier, str_replace("\"", "'", $this->contentAsString()), true); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public function getRoot() { |
55 | 55 | return $this->root; |
56 | 56 | } |
57 | 57 | public function setRoot($root) { |
58 | - $this->root = $root; |
|
58 | + $this->root=$root; |
|
59 | 59 | return $this; |
60 | 60 | } |
61 | 61 | public function getAttr() { |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | * @return HtmlNavElement |
69 | 69 | */ |
70 | 70 | public function setAttr($attr) { |
71 | - $this->attr = $attr; |
|
71 | + $this->attr=$attr; |
|
72 | 72 | return $this; |
73 | 73 | } |
74 | 74 | |
75 | 75 | public function __call($method, $args) { |
76 | - if(isset($this->$method) && is_callable($this->$method)) { |
|
76 | + if (isset($this->$method) && is_callable($this->$method)) { |
|
77 | 77 | return call_user_func_array( |
78 | 78 | $this->$method, |
79 | 79 | $args |
@@ -81,32 +81,32 @@ discard block |
||
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | - public abstract function fromDispatcher($dispatcher,$startIndex=0); |
|
84 | + public abstract function fromDispatcher($dispatcher, $startIndex=0); |
|
85 | 85 | |
86 | 86 | |
87 | - public function setContentDivider($divider,$index=NULL) { |
|
87 | + public function setContentDivider($divider, $index=NULL) { |
|
88 | 88 | $divider="<div class='divider'> {$divider} </div>"; |
89 | 89 | return $this->setDivider($divider, $index); |
90 | 90 | } |
91 | 91 | |
92 | - public function setIconContentDivider($iconContentDivider,$index=NULL) { |
|
92 | + public function setIconContentDivider($iconContentDivider, $index=NULL) { |
|
93 | 93 | $contentDivider="<i class='".$iconContentDivider." icon divider'></i>"; |
94 | 94 | return $this->setDivider($contentDivider, $index); |
95 | 95 | } |
96 | 96 | |
97 | - protected function setDivider($divider,$index){ |
|
98 | - if(isset($index)){ |
|
99 | - if(\is_array($this->_contentSeparator)===false) |
|
100 | - $this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator); |
|
97 | + protected function setDivider($divider, $index) { |
|
98 | + if (isset($index)) { |
|
99 | + if (\is_array($this->_contentSeparator)===false) |
|
100 | + $this->_contentSeparator=array_fill(0, $this->count()-1, $this->_contentSeparator); |
|
101 | 101 | $this->_contentSeparator[$index]=$divider; |
102 | - }else{ |
|
102 | + }else { |
|
103 | 103 | $this->_contentSeparator=$divider; |
104 | 104 | } |
105 | 105 | return $this; |
106 | 106 | } |
107 | 107 | |
108 | - protected function getContentDivider($index){ |
|
109 | - if(\is_array($this->_contentSeparator)===true){ |
|
108 | + protected function getContentDivider($index) { |
|
109 | + if (\is_array($this->_contentSeparator)===true) { |
|
110 | 110 | return @$this->_contentSeparator[$index]; |
111 | 111 | } |
112 | 112 | return $this->_contentSeparator; |
@@ -96,10 +96,11 @@ |
||
96 | 96 | |
97 | 97 | protected function setDivider($divider,$index){ |
98 | 98 | if(isset($index)){ |
99 | - if(\is_array($this->_contentSeparator)===false) |
|
100 | - $this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator); |
|
99 | + if(\is_array($this->_contentSeparator)===false) { |
|
100 | + $this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator); |
|
101 | + } |
|
101 | 102 | $this->_contentSeparator[$index]=$divider; |
102 | - }else{ |
|
103 | + } else{ |
|
103 | 104 | $this->_contentSeparator=$divider; |
104 | 105 | } |
105 | 106 | return $this; |
@@ -22,6 +22,11 @@ discard block |
||
22 | 22 | protected $_contentSeparator=""; |
23 | 23 | |
24 | 24 | |
25 | + /** |
|
26 | + * @param string $identifier |
|
27 | + * @param string $tagName |
|
28 | + * @param string $baseClass |
|
29 | + */ |
|
25 | 30 | public function __construct($identifier,$tagName,$baseClass){ |
26 | 31 | parent::__construct($identifier,$tagName,$baseClass); |
27 | 32 | $this->root=""; |
@@ -31,7 +36,7 @@ discard block |
||
31 | 36 | /** |
32 | 37 | * Associate an ajax get to the elements, displayed in $targetSelector |
33 | 38 | * @param string $targetSelector the target of the get |
34 | - * @return HtmlNavElement |
|
39 | + * @return HtmlSemNavElement |
|
35 | 40 | */ |
36 | 41 | public function autoGetOnClick($targetSelector){ |
37 | 42 | return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
@@ -63,7 +68,7 @@ discard block |
||
63 | 68 | /** |
64 | 69 | * Define the html attribute for each element url in ajax |
65 | 70 | * @param string $attr html attribute |
66 | - * @return HtmlNavElement |
|
71 | + * @return HtmlSemNavElement |
|
67 | 72 | */ |
68 | 73 | public function setAttr($attr) { |
69 | 74 | $this->attr = $attr; |
@@ -103,6 +108,9 @@ discard block |
||
103 | 108 | return $this; |
104 | 109 | } |
105 | 110 | |
111 | + /** |
|
112 | + * @param integer $index |
|
113 | + */ |
|
106 | 114 | protected function getContentDivider($index){ |
107 | 115 | if(\is_array($this->_contentSeparator)===true){ |
108 | 116 | return @$this->_contentSeparator[$index]; |
@@ -13,17 +13,17 @@ |
||
13 | 13 | * @param boolean $labeled |
14 | 14 | * @return \Ajax\semantic\html\elements\HtmlIcon |
15 | 15 | */ |
16 | - public function addIcon($icon,$before=true,$labeled=false){ |
|
16 | + public function addIcon($icon, $before=true, $labeled=false) { |
|
17 | 17 | $iconO=$icon; |
18 | - if(\is_string($icon)){ |
|
18 | + if (\is_string($icon)) { |
|
19 | 19 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
20 | 20 | } |
21 | - if($labeled!==false){ |
|
22 | - $direction=($before===true)?Direction::LEFT:Direction::RIGHT; |
|
21 | + if ($labeled!==false) { |
|
22 | + $direction=($before===true) ? Direction::LEFT : Direction::RIGHT; |
|
23 | 23 | $this->addToProperty("class", $direction." labeled icon"); |
24 | 24 | $this->tagName="div"; |
25 | 25 | } |
26 | - $this->addContent($iconO,$before); |
|
26 | + $this->addContent($iconO, $before); |
|
27 | 27 | return $iconO; |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | * @param string $action one of "select","auto","activate","combo","nothing","hide" |
18 | 18 | * @return \Ajax\semantic\components\Dropdown |
19 | 19 | */ |
20 | - public function setAction($action){ |
|
21 | - return $this->setParamCtrl("action", $action,array("select","auto","activate","combo","nothing","hide")); |
|
20 | + public function setAction($action) { |
|
21 | + return $this->setParamCtrl("action", $action, array("select", "auto", "activate", "combo", "nothing", "hide")); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | * @param string $event Event used to trigger dropdown (Hover, Click, Custom Event) |
27 | 27 | * @return \Ajax\semantic\components\Dropdown |
28 | 28 | */ |
29 | - public function setOn($event){ |
|
29 | + public function setOn($event) { |
|
30 | 30 | return $this->setParam("on", $event); |
31 | 31 | } |
32 | 32 | |
33 | - public function setFullTextSearch($value){ |
|
33 | + public function setFullTextSearch($value) { |
|
34 | 34 | return $this->setParam("fullTextSearch", $value); |
35 | 35 | } |
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | -return array ( |
|
3 | - "JQuery" => array ( |
|
4 | - "MaxCDN" => array ( |
|
2 | +return array( |
|
3 | + "JQuery" => array( |
|
4 | + "MaxCDN" => array( |
|
5 | 5 | "url" => "http://code.jquery.com/jquery-%version%.min.js", |
6 | - "versions" => array ( |
|
6 | + "versions" => array( |
|
7 | 7 | "2.2.3", |
8 | 8 | "2.2.1", |
9 | 9 | "2.1.4", |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | "1.11.2" |
12 | 12 | ) |
13 | 13 | ), |
14 | - "Google" => array ( |
|
14 | + "Google" => array( |
|
15 | 15 | "url" => "https://ajax.googleapis.com/ajax/libs/jquery/%version%/jquery.min.js", |
16 | - "versions" => array ( |
|
16 | + "versions" => array( |
|
17 | 17 | "2.2.2", |
18 | 18 | "2.2.1", |
19 | 19 | "2.2.0", |
@@ -25,17 +25,17 @@ discard block |
||
25 | 25 | ) |
26 | 26 | ) |
27 | 27 | ), |
28 | - "JQueryUI" => array ( |
|
29 | - "MaxCDN" => array ( |
|
28 | + "JQueryUI" => array( |
|
29 | + "MaxCDN" => array( |
|
30 | 30 | "core" => "http://code.jquery.com/ui/%version%/jquery-ui.min.js", |
31 | 31 | "css" => "http://code.jquery.com/ui/%version%/themes/%theme%/jquery-ui.css", |
32 | - "versions" => array ( |
|
32 | + "versions" => array( |
|
33 | 33 | "1.11.4", |
34 | 34 | "1.11.3", |
35 | 35 | "1.11.2", |
36 | 36 | "1.10.4" |
37 | 37 | ), |
38 | - "themes" => array ( |
|
38 | + "themes" => array( |
|
39 | 39 | "black-tie", |
40 | 40 | "blitzer", |
41 | 41 | "cupertino", |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | "vader" |
63 | 63 | ) |
64 | 64 | ), |
65 | - "Google" => array ( |
|
65 | + "Google" => array( |
|
66 | 66 | "core" => "https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/jquery-ui.min.js", |
67 | 67 | "css" => "https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/themes/%theme%/jquery-ui.css", |
68 | - "versions" => array ( |
|
68 | + "versions" => array( |
|
69 | 69 | "1.11.4", |
70 | 70 | "1.11.3", |
71 | 71 | "1.11.2", |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | "1.10.4", |
75 | 75 | "1.10.0" |
76 | 76 | ), |
77 | - "themes" => array ( |
|
77 | + "themes" => array( |
|
78 | 78 | "black-tie", |
79 | 79 | "blitzer", |
80 | 80 | "cupertino", |
@@ -102,25 +102,25 @@ discard block |
||
102 | 102 | ) |
103 | 103 | ) |
104 | 104 | ), |
105 | - "Bootstrap" => array ( |
|
106 | - "MaxCDN" => array ( |
|
105 | + "Bootstrap" => array( |
|
106 | + "MaxCDN" => array( |
|
107 | 107 | "core" => "http://maxcdn.bootstrapcdn.com/bootstrap/%version%/js/bootstrap.min.js", |
108 | 108 | "css" => "http://maxcdn.bootstrapcdn.com/bootstrap/%version%/css/bootstrap.min.css", |
109 | - "versions" => array ( |
|
109 | + "versions" => array( |
|
110 | 110 | "3.3.6", |
111 | 111 | "3.3.5" |
112 | 112 | ), |
113 | - "themes" => array () |
|
113 | + "themes" => array() |
|
114 | 114 | ) |
115 | 115 | ), |
116 | - "Semantic" => array ( |
|
117 | - "cdnjs" => array ( |
|
116 | + "Semantic" => array( |
|
117 | + "cdnjs" => array( |
|
118 | 118 | "core" => "https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/%version%/semantic.min.js", |
119 | 119 | "css" => "https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/%version%/semantic.min.js", |
120 | - "versions" => array ( |
|
120 | + "versions" => array( |
|
121 | 121 | "2.1.8" |
122 | 122 | ), |
123 | - "themes" => array () |
|
123 | + "themes" => array() |
|
124 | 124 | ) |
125 | 125 | ) |
126 | 126 | ); |
127 | 127 | \ No newline at end of file |
@@ -9,7 +9,7 @@ |
||
9 | 9 | protected $localCss; |
10 | 10 | protected $framework; |
11 | 11 | |
12 | - public function __construct($framework,$version, $provider="MaxCDN") { |
|
12 | + public function __construct($framework, $version, $provider="MaxCDN") { |
|
13 | 13 | parent::__construct($version, $provider); |
14 | 14 | $this->framework=$framework; |
15 | 15 | $this->data=$this->data [$framework]; |
@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base\constants; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Social extends BaseEnum { |
5 | - const FACEBOOK="facebook", TWITTER="twitter",GOOGLEPLUS="google plus",VK="vk",LINKEDIN="linkedin",INSTAGRAM="instagram",YOUTUBE="youtube"; |
|
5 | + const FACEBOOK="facebook", TWITTER="twitter", GOOGLEPLUS="google plus", VK="vk", LINKEDIN="linkedin", INSTAGRAM="instagram", YOUTUBE="youtube"; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |