@@ -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; |
@@ -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(); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @param string $attachTo |
| 43 | 43 | * @param string|array $params |
| 44 | - * @return $this |
|
| 44 | + * @return common\components\SimpleComponent |
|
| 45 | 45 | */ |
| 46 | 46 | public function generic($attachTo=NULL, $params=NULL) { |
| 47 | 47 | return $this->addComponent(new GenericComponent($this->js), $attachTo, $params); |
@@ -50,16 +50,22 @@ discard block |
||
| 50 | 50 | * |
| 51 | 51 | * @param string $attachTo |
| 52 | 52 | * @param string|array $params |
| 53 | - * @return $this |
|
| 53 | + * @return common\components\SimpleComponent |
|
| 54 | 54 | */ |
| 55 | 55 | public function popup($attachTo=NULL, $params=NULL) { |
| 56 | 56 | return $this->addComponent(new Popup($this->js), $attachTo, $params); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param string $attachTo |
|
| 61 | + */ |
|
| 59 | 62 | public function dropdown($attachTo=NULL, $params=NULL) { |
| 60 | 63 | return $this->addComponent(new Dropdown($this->js), $attachTo, $params); |
| 61 | 64 | } |
| 62 | 65 | |
| 66 | + /** |
|
| 67 | + * @param string $attachTo |
|
| 68 | + */ |
|
| 63 | 69 | public function accordion($attachTo=NULL, $params=NULL) { |
| 64 | 70 | return $this->addComponent(new Accordion($this->js), $attachTo, $params); |
| 65 | 71 | } |
@@ -220,7 +226,7 @@ discard block |
||
| 220 | 226 | |
| 221 | 227 | /** |
| 222 | 228 | * @param string $identifier |
| 223 | - * @param number $niveau |
|
| 229 | + * @param integer $niveau |
|
| 224 | 230 | * @param mixed $content |
| 225 | 231 | * @param string $type |
| 226 | 232 | */ |
@@ -239,7 +245,6 @@ discard block |
||
| 239 | 245 | /** |
| 240 | 246 | * Return a new Seamntic Html Breadcrumb |
| 241 | 247 | * @param string $identifier |
| 242 | - * @param array $elements |
|
| 243 | 248 | * @param boolean $autoActive sets the last element's class to <b>active</b> if true. default : true |
| 244 | 249 | * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()} |
| 245 | 250 | * @return HtmlBreadcrumb |
@@ -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 | } |