@@ -4,7 +4,6 @@ |
||
4 | 4 | use Ajax\semantic\html\base\constants\Side; |
5 | 5 | trait AttachedTrait { |
6 | 6 | /** |
7 | - * @param string $side |
|
8 | 7 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
9 | 8 | */ |
10 | 9 | public function setAttachment($value=Side::BOTH){ |
@@ -20,6 +20,9 @@ |
||
20 | 20 | protected $_tabsType="tabs"; |
21 | 21 | protected $stacked=""; |
22 | 22 | |
23 | + /** |
|
24 | + * @param string $identifier |
|
25 | + */ |
|
23 | 26 | public function __construct($identifier, $tagName="ul") { |
24 | 27 | parent::__construct($identifier, $tagName); |
25 | 28 | $this->_template="<%tagName% %properties%>%tabs%</%tagName%>%content%"; |
@@ -10,13 +10,16 @@ |
||
10 | 10 | |
11 | 11 | class HtmlLabel extends HtmlSemDoubleElement { |
12 | 12 | use LabeledIconTrait; |
13 | + |
|
14 | + /** |
|
15 | + * @param string $identifier |
|
16 | + */ |
|
13 | 17 | public function __construct($identifier,$caption="",$tagName="div") { |
14 | 18 | parent::__construct($identifier,$tagName,"ui label"); |
15 | 19 | $this->content=$caption; |
16 | 20 | } |
17 | 21 | |
18 | 22 | /** |
19 | - * @param string $side |
|
20 | 23 | * @return \Ajax\semantic\html\elements\HtmlLabel |
21 | 24 | */ |
22 | 25 | public function setPointing($value=Direction::NONE){ |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | * Associate an ajax get to the breadcrumb elements, displayed in $targetSelector |
56 | 56 | * $attr member is used to build each element url |
57 | 57 | * @param string $targetSelector the target of the get |
58 | - * @param string $attr the html attribute used to build the elements url |
|
59 | - * @return HtmlBreadcrumbs |
|
58 | + * @return HtmlBreadcrumb |
|
60 | 59 | */ |
61 | 60 | public function autoGetOnClick($targetSelector){ |
62 | 61 | return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
@@ -118,7 +117,7 @@ discard block |
||
118 | 117 | /** |
119 | 118 | * sets the function who generates the href elements. default : function($element){return $element->getContent()} |
120 | 119 | * @param function $_hrefFunction |
121 | - * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
|
120 | + * @return HtmlBreadcrumb |
|
122 | 121 | */ |
123 | 122 | public function setHrefFunction($_hrefFunction) { |
124 | 123 | $this->_hrefFunction = $_hrefFunction; |
@@ -108,6 +108,10 @@ discard block |
||
108 | 108 | return true; |
109 | 109 | } |
110 | 110 | |
111 | + /** |
|
112 | + * @param string $propertyName |
|
113 | + * @param string $value |
|
114 | + */ |
|
111 | 115 | protected function propertyContains($propertyName,$value){ |
112 | 116 | $values=$this->getProperty($propertyName); |
113 | 117 | if(isset($values)){ |
@@ -142,12 +146,19 @@ discard block |
||
142 | 146 | return $this; |
143 | 147 | } |
144 | 148 | |
149 | + /** |
|
150 | + * @param string $name |
|
151 | + */ |
|
145 | 152 | protected function removeProperty($name){ |
146 | 153 | if(\array_key_exists($name, $this->properties)) |
147 | 154 | unset($this->properties[$name]); |
148 | 155 | return $this; |
149 | 156 | } |
150 | 157 | |
158 | + /** |
|
159 | + * @param string $name |
|
160 | + * @param string[] $typeCtrl |
|
161 | + */ |
|
151 | 162 | protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") { |
152 | 163 | if ($this->ctrl($name, $value, $typeCtrl)===true) { |
153 | 164 | if (is_array($typeCtrl)) { |
@@ -172,6 +183,9 @@ discard block |
||
172 | 183 | return $this->addToProperty($name, $value); |
173 | 184 | } |
174 | 185 | |
186 | + /** |
|
187 | + * @param string $name |
|
188 | + */ |
|
175 | 189 | public function addToPropertyCtrl($name, $value, $typeCtrl) { |
176 | 190 | // if($this->ctrl($name, $value, $typeCtrl)===true){ |
177 | 191 | return $this->addToPropertyUnique($name, $value, $typeCtrl); |
@@ -239,6 +253,9 @@ discard block |
||
239 | 253 | |
240 | 254 | } |
241 | 255 | |
256 | + /** |
|
257 | + * @param string $before |
|
258 | + */ |
|
242 | 259 | public function wrap($before, $after="") { |
243 | 260 | if(isset($before)){ |
244 | 261 | $this->wrapBefore.=$before; |
@@ -307,6 +324,9 @@ discard block |
||
307 | 324 | } |
308 | 325 | } |
309 | 326 | |
327 | + /** |
|
328 | + * @param string $operation |
|
329 | + */ |
|
310 | 330 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
311 | 331 | $params=array ( |
312 | 332 | "url" => $url, |
@@ -317,14 +337,23 @@ discard block |
||
317 | 337 | return $this; |
318 | 338 | } |
319 | 339 | |
340 | + /** |
|
341 | + * @param string $event |
|
342 | + */ |
|
320 | 343 | public function getOn($event, $url, $responseElement="", $parameters=array()) { |
321 | 344 | return $this->_ajaxOn("get", $event, $url, $responseElement, $parameters); |
322 | 345 | } |
323 | 346 | |
347 | + /** |
|
348 | + * @param string $url |
|
349 | + */ |
|
324 | 350 | public function getOnClick($url, $responseElement="", $parameters=array()) { |
325 | 351 | return $this->getOn("click", $url, $responseElement, $parameters); |
326 | 352 | } |
327 | 353 | |
354 | + /** |
|
355 | + * @param string $event |
|
356 | + */ |
|
328 | 357 | public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) { |
329 | 358 | $parameters ["params"]=$params; |
330 | 359 | return $this->_ajaxOn("post", $event, $url, $responseElement, $parameters); |
@@ -334,6 +363,9 @@ discard block |
||
334 | 363 | return $this->postOn("click", $url, $params, $responseElement, $parameters); |
335 | 364 | } |
336 | 365 | |
366 | + /** |
|
367 | + * @param string $event |
|
368 | + */ |
|
337 | 369 | public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) { |
338 | 370 | $parameters ["form"]=$form; |
339 | 371 | return $this->_ajaxOn("postForm", $event, $url, $responseElement, $parameters); |
@@ -383,6 +415,9 @@ discard block |
||
383 | 415 | return $value; |
384 | 416 | } |
385 | 417 | |
418 | + /** |
|
419 | + * @param string $jqueryCall |
|
420 | + */ |
|
386 | 421 | public function jsDoJquery($jqueryCall, $param=""){ |
387 | 422 | return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");"; |
388 | 423 | } |
@@ -87,6 +87,9 @@ discard block |
||
87 | 87 | $this->addItem($function($object)); |
88 | 88 | } |
89 | 89 | |
90 | + /** |
|
91 | + * @param \Closure $callBack |
|
92 | + */ |
|
90 | 93 | public function apply($callBack){ |
91 | 94 | foreach ($this->content as $item){ |
92 | 95 | $callBack($item); |
@@ -121,6 +124,9 @@ discard block |
||
121 | 124 | return $this->_bsComponent; |
122 | 125 | } |
123 | 126 | |
127 | + /** |
|
128 | + * @param string $tagName |
|
129 | + */ |
|
124 | 130 | protected function contentAs($tagName){ |
125 | 131 | foreach ($this->content as $item){ |
126 | 132 | $item->setTagName($tagName); |
@@ -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=""; |
@@ -32,8 +37,7 @@ discard block |
||
32 | 37 | * Associate an ajax get to the elements, displayed in $targetSelector |
33 | 38 | * $attr member is used to build each element url |
34 | 39 | * @param string $targetSelector the target of the get |
35 | - * @param string $attr the html attribute used to build the elements url |
|
36 | - * @return HtmlNavElement |
|
40 | + * @return HtmlSemNavElement |
|
37 | 41 | */ |
38 | 42 | public function autoGetOnClick($targetSelector){ |
39 | 43 | return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
@@ -65,7 +69,7 @@ discard block |
||
65 | 69 | /** |
66 | 70 | * Define the html attribute for each element url in ajax |
67 | 71 | * @param string $attr html attribute |
68 | - * @return HtmlNavElement |
|
72 | + * @return HtmlSemNavElement |
|
69 | 73 | */ |
70 | 74 | public function setAttr($attr) { |
71 | 75 | $this->attr = $attr; |
@@ -105,6 +109,9 @@ discard block |
||
105 | 109 | return $this; |
106 | 110 | } |
107 | 111 | |
112 | + /** |
|
113 | + * @param integer $index |
|
114 | + */ |
|
108 | 115 | protected function getContentDivider($index){ |
109 | 116 | if(\is_array($this->_contentSeparator)===true){ |
110 | 117 | return @$this->_contentSeparator[$index]; |
@@ -7,6 +7,9 @@ |
||
7 | 7 | trait IconTrait { |
8 | 8 | private $_hasIcon=false; |
9 | 9 | |
10 | + /** |
|
11 | + * @param boolean $direction |
|
12 | + */ |
|
10 | 13 | public function addIcon($icon,$direction=Direction::LEFT){ |
11 | 14 | if($this->_hasIcon===false){ |
12 | 15 | $iconO=$icon; |
@@ -11,6 +11,10 @@ discard block |
||
11 | 11 | |
12 | 12 | class HtmlDropdownItem extends HtmlSemDoubleElement { |
13 | 13 | use IconTrait; |
14 | + |
|
15 | + /** |
|
16 | + * @param string $identifier |
|
17 | + */ |
|
14 | 18 | public function __construct($identifier, $content="",$value=NULL,$image=NULL) { |
15 | 19 | parent::__construct($identifier, "a"); |
16 | 20 | $this->setClass("item"); |
@@ -61,6 +65,9 @@ discard block |
||
61 | 65 | return $this; |
62 | 66 | } |
63 | 67 | |
68 | + /** |
|
69 | + * @param string $content |
|
70 | + */ |
|
64 | 71 | public function setContent($content){ |
65 | 72 | if($content==="-"){ |
66 | 73 | $this->asDivider(); |