@@ -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; |
@@ -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(); |
@@ -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)){ |
@@ -137,17 +141,28 @@ discard block |
||
137 | 141 | return $this; |
138 | 142 | } |
139 | 143 | |
144 | + /** |
|
145 | + * @param string $name |
|
146 | + * @param string $value |
|
147 | + */ |
|
140 | 148 | protected function removePropertyValue($name,$value){ |
141 | 149 | $this->properties[$name]=\str_replace($value, "", $this->properties[$name]); |
142 | 150 | return $this; |
143 | 151 | } |
144 | 152 | |
153 | + /** |
|
154 | + * @param string $name |
|
155 | + */ |
|
145 | 156 | protected function removeProperty($name){ |
146 | 157 | if(\array_key_exists($name, $this->properties)) |
147 | 158 | unset($this->properties[$name]); |
148 | 159 | return $this; |
149 | 160 | } |
150 | 161 | |
162 | + /** |
|
163 | + * @param string $name |
|
164 | + * @param string[] $typeCtrl |
|
165 | + */ |
|
151 | 166 | protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") { |
152 | 167 | if ($this->ctrl($name, $value, $typeCtrl)===true) { |
153 | 168 | if (is_array($typeCtrl)) { |
@@ -172,6 +187,9 @@ discard block |
||
172 | 187 | return $this->addToProperty($name, $value); |
173 | 188 | } |
174 | 189 | |
190 | + /** |
|
191 | + * @param string $name |
|
192 | + */ |
|
175 | 193 | public function addToPropertyCtrl($name, $value, $typeCtrl) { |
176 | 194 | // if($this->ctrl($name, $value, $typeCtrl)===true){ |
177 | 195 | return $this->addToPropertyUnique($name, $value, $typeCtrl); |
@@ -239,6 +257,9 @@ discard block |
||
239 | 257 | |
240 | 258 | } |
241 | 259 | |
260 | + /** |
|
261 | + * @param string $before |
|
262 | + */ |
|
242 | 263 | public function wrap($before, $after="") { |
243 | 264 | if(isset($before)){ |
244 | 265 | $this->wrapBefore.=$before; |
@@ -307,6 +328,9 @@ discard block |
||
307 | 328 | } |
308 | 329 | } |
309 | 330 | |
331 | + /** |
|
332 | + * @param string $operation |
|
333 | + */ |
|
310 | 334 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
311 | 335 | $params=array ( |
312 | 336 | "url" => $url, |
@@ -317,14 +341,23 @@ discard block |
||
317 | 341 | return $this; |
318 | 342 | } |
319 | 343 | |
344 | + /** |
|
345 | + * @param string $event |
|
346 | + */ |
|
320 | 347 | public function getOn($event, $url, $responseElement="", $parameters=array()) { |
321 | 348 | return $this->_ajaxOn("get", $event, $url, $responseElement, $parameters); |
322 | 349 | } |
323 | 350 | |
351 | + /** |
|
352 | + * @param string $url |
|
353 | + */ |
|
324 | 354 | public function getOnClick($url, $responseElement="", $parameters=array()) { |
325 | 355 | return $this->getOn("click", $url, $responseElement, $parameters); |
326 | 356 | } |
327 | 357 | |
358 | + /** |
|
359 | + * @param string $event |
|
360 | + */ |
|
328 | 361 | public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) { |
329 | 362 | $parameters ["params"]=$params; |
330 | 363 | return $this->_ajaxOn("post", $event, $url, $responseElement, $parameters); |
@@ -334,6 +367,9 @@ discard block |
||
334 | 367 | return $this->postOn("click", $url, $params, $responseElement, $parameters); |
335 | 368 | } |
336 | 369 | |
370 | + /** |
|
371 | + * @param string $event |
|
372 | + */ |
|
337 | 373 | public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) { |
338 | 374 | $parameters ["form"]=$form; |
339 | 375 | return $this->_ajaxOn("postForm", $event, $url, $responseElement, $parameters); |
@@ -383,6 +419,9 @@ discard block |
||
383 | 419 | return $value; |
384 | 420 | } |
385 | 421 | |
422 | + /** |
|
423 | + * @param string $jqueryCall |
|
424 | + */ |
|
386 | 425 | public function jsDoJquery($jqueryCall, $param=""){ |
387 | 426 | return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");"; |
388 | 427 | } |
@@ -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%"; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * Sets the menu type |
27 | 27 | * @param string $type one of text,item |
28 | - * @return \Ajax\semantic\html\collections\HtmlMenu |
|
28 | + * @return HtmlMenu |
|
29 | 29 | */ |
30 | 30 | public function setType($type=""){ |
31 | 31 | return $this->addToPropertyCtrl("class", $type, array("","item","text")); |