@@ -13,6 +13,9 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class HtmlIconGroups extends HtmlSemCollection { |
| 15 | 15 | |
| 16 | + /** |
|
| 17 | + * @param string $identifier |
|
| 18 | + */ |
|
| 16 | 19 | public function __construct($identifier, $icons=array(), $size="") { |
| 17 | 20 | parent::__construct($identifier, "i", "icons"); |
| 18 | 21 | $this->addItems($icons); |
@@ -16,14 +16,29 @@ |
||
| 16 | 16 | protected $_states=[ ]; |
| 17 | 17 | protected $_baseClass; |
| 18 | 18 | |
| 19 | + /** |
|
| 20 | + * @param string $name |
|
| 21 | + */ |
|
| 19 | 22 | protected abstract function setPropertyCtrl($name, $value, $typeCtrl); |
| 20 | 23 | |
| 24 | + /** |
|
| 25 | + * @param string $name |
|
| 26 | + */ |
|
| 21 | 27 | protected abstract function addToPropertyCtrl($name, $value, $typeCtrl); |
| 22 | 28 | |
| 29 | + /** |
|
| 30 | + * @param string $name |
|
| 31 | + */ |
|
| 23 | 32 | protected abstract function addToPropertyCtrlCheck($name, $value, $typeCtrl); |
| 24 | 33 | |
| 34 | + /** |
|
| 35 | + * @param string $name |
|
| 36 | + */ |
|
| 25 | 37 | public abstract function addToProperty($name, $value, $separator=" "); |
| 26 | 38 | |
| 39 | + /** |
|
| 40 | + * @param string $name |
|
| 41 | + */ |
|
| 27 | 42 | public abstract function setProperty($name, $value); |
| 28 | 43 | |
| 29 | 44 | public function addVariation($variation) { |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * @param string $placeholder |
| 27 | 27 | * @param string $icon |
| 28 | - * @return \Ajax\semantic\html\content\HtmlDropdownItem|\Ajax\semantic\html\content\HtmlMenuItem |
|
| 28 | + * @return MenuItemTrait |
|
| 29 | 29 | */ |
| 30 | 30 | public function asSearchInput($placeholder=NULL,$icon=NULL){ |
| 31 | 31 | $this->setClass("ui icon search input"); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | - * @return \Ajax\semantic\html\content\HtmlDropdownItem|\Ajax\semantic\html\content\HtmlMenuItem |
|
| 42 | + * @return MenuItemTrait |
|
| 43 | 43 | */ |
| 44 | 44 | public function asDivider(){ |
| 45 | 45 | $this->content=NULL; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * @param string $caption |
| 53 | 53 | * @param string $icon |
| 54 | - * @return \Ajax\semantic\html\content\HtmlDropdownItem|\Ajax\semantic\html\content\HtmlMenuItem |
|
| 54 | + * @return MenuItemTrait |
|
| 55 | 55 | */ |
| 56 | 56 | public function asHeader($caption=NULL,$icon=NULL){ |
| 57 | 57 | $this->setClass("header"); |
@@ -12,6 +12,10 @@ discard block |
||
| 12 | 12 | protected $variation; |
| 13 | 13 | protected $params; |
| 14 | 14 | protected $semElement; |
| 15 | + |
|
| 16 | + /** |
|
| 17 | + * @param HtmlSemDoubleElement $semElement |
|
| 18 | + */ |
|
| 15 | 19 | public function __construct($semElement,$title="",$content="",$variation=NULL,$params=array()){ |
| 16 | 20 | $this->semElement=$semElement; |
| 17 | 21 | $this->title=$title; |
@@ -19,6 +23,9 @@ discard block |
||
| 19 | 23 | $this->setAttributes($variation,$params); |
| 20 | 24 | } |
| 21 | 25 | |
| 26 | + /** |
|
| 27 | + * @param string $html |
|
| 28 | + */ |
|
| 22 | 29 | public function setHtml($html) { |
| 23 | 30 | $this->html= $html; |
| 24 | 31 | return $this; |
@@ -22,6 +22,9 @@ discard block |
||
| 22 | 22 | protected $input; |
| 23 | 23 | protected $value; |
| 24 | 24 | |
| 25 | + /** |
|
| 26 | + * @param string $identifier |
|
| 27 | + */ |
|
| 25 | 28 | public function __construct($identifier, $value="", $items=array()) { |
| 26 | 29 | parent::__construct($identifier, "div"); |
| 27 | 30 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php'; |
@@ -49,7 +52,7 @@ discard block |
||
| 49 | 52 | /** |
| 50 | 53 | * Insert an item at a position |
| 51 | 54 | * @param mixed $item |
| 52 | - * @param number $position |
|
| 55 | + * @param integer $position |
|
| 53 | 56 | * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown |
| 54 | 57 | */ |
| 55 | 58 | public function insertItem($item,$position=0){ |
@@ -240,6 +243,9 @@ discard block |
||
| 240 | 243 | return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing")); |
| 241 | 244 | } |
| 242 | 245 | |
| 246 | + /** |
|
| 247 | + * @param string $value |
|
| 248 | + */ |
|
| 243 | 249 | public function setValue($value){ |
| 244 | 250 | $this->value=$value; |
| 245 | 251 | return $this; |
@@ -274,6 +280,9 @@ discard block |
||
| 274 | 280 | return $this->addToPropertyCtrl("class", "compact", array("compact")); |
| 275 | 281 | } |
| 276 | 282 | |
| 283 | + /** |
|
| 284 | + * @param string $action |
|
| 285 | + */ |
|
| 277 | 286 | public function setAction($action){ |
| 278 | 287 | $this->_params["action"]=$action; |
| 279 | 288 | } |
@@ -27,6 +27,9 @@ discard block |
||
| 27 | 27 | return $result; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | + /** |
|
| 31 | + * @param string $key |
|
| 32 | + */ |
|
| 30 | 33 | private function addElementInContent($key, $element) { |
| 31 | 34 | if (\array_key_exists($key, $this->content) === false) { |
| 32 | 35 | $this->content[$key]=array (); |
@@ -35,6 +38,9 @@ discard block |
||
| 35 | 38 | return $element; |
| 36 | 39 | } |
| 37 | 40 | |
| 41 | + /** |
|
| 42 | + * @param string $part |
|
| 43 | + */ |
|
| 38 | 44 | private function getPart($part, $index=NULL) { |
| 39 | 45 | if (\array_key_exists($part, $this->content)) { |
| 40 | 46 | if (isset($index)) |
@@ -59,6 +65,10 @@ discard block |
||
| 59 | 65 | return $this->addElementInContent("content", $image); |
| 60 | 66 | } |
| 61 | 67 | |
| 68 | + /** |
|
| 69 | + * @param HtmlImage $visibleContent |
|
| 70 | + * @param HtmlImage $hiddenContent |
|
| 71 | + */ |
|
| 62 | 72 | public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL) { |
| 63 | 73 | $reveal=$visibleContent; |
| 64 | 74 | if (!$visibleContent instanceof HtmlReveal) { |
@@ -13,6 +13,9 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class HtmlIconGroups extends HtmlSemCollection { |
| 15 | 15 | |
| 16 | + /** |
|
| 17 | + * @param string $identifier |
|
| 18 | + */ |
|
| 16 | 19 | public function __construct($identifier, $icons=array(), $size="") { |
| 17 | 20 | parent::__construct($identifier, "i", "icons"); |
| 18 | 21 | $this->addItems($icons); |
@@ -6,6 +6,9 @@ |
||
| 6 | 6 | |
| 7 | 7 | trait CheckboxTrait { |
| 8 | 8 | |
| 9 | + /** |
|
| 10 | + * @param string $name |
|
| 11 | + */ |
|
| 9 | 12 | public abstract function addToPropertyCtrl($name, $value, $typeCtrl); |
| 10 | 13 | |
| 11 | 14 | public function setType($checkboxType) { |
@@ -124,6 +124,10 @@ discard block |
||
| 124 | 124 | return $this; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | + /** |
|
| 128 | + * @param string $name |
|
| 129 | + * @param string[] $typeCtrl |
|
| 130 | + */ |
|
| 127 | 131 | protected function setMemberCtrl(&$name, $value, $typeCtrl) { |
| 128 | 132 | if ($this->ctrl($name, $value, $typeCtrl) === true) { |
| 129 | 133 | return $name=$value; |
@@ -139,22 +143,35 @@ discard block |
||
| 139 | 143 | return $this; |
| 140 | 144 | } |
| 141 | 145 | |
| 146 | + /** |
|
| 147 | + * @param string $name |
|
| 148 | + */ |
|
| 142 | 149 | protected function removePropertyValue($name, $value) { |
| 143 | 150 | $this->properties[$name]=\str_replace($value, "", $this->properties[$name]); |
| 144 | 151 | return $this; |
| 145 | 152 | } |
| 146 | 153 | |
| 154 | + /** |
|
| 155 | + * @param string $name |
|
| 156 | + */ |
|
| 147 | 157 | protected function removePropertyValues($name, $values) { |
| 148 | 158 | $this->removeOldValues($this->properties[$name], $values); |
| 149 | 159 | return $this; |
| 150 | 160 | } |
| 151 | 161 | |
| 162 | + /** |
|
| 163 | + * @param string $name |
|
| 164 | + */ |
|
| 152 | 165 | public function removeProperty($name) { |
| 153 | 166 | if (\array_key_exists($name, $this->properties)) |
| 154 | 167 | unset($this->properties[$name]); |
| 155 | 168 | return $this; |
| 156 | 169 | } |
| 157 | 170 | |
| 171 | + /** |
|
| 172 | + * @param string $name |
|
| 173 | + * @param string[] $typeCtrl |
|
| 174 | + */ |
|
| 158 | 175 | protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") { |
| 159 | 176 | if ($this->ctrl($name, $value, $typeCtrl) === true) { |
| 160 | 177 | if (is_array($typeCtrl)) { |
@@ -165,6 +182,9 @@ discard block |
||
| 165 | 182 | return $this; |
| 166 | 183 | } |
| 167 | 184 | |
| 185 | + /** |
|
| 186 | + * @param string $name |
|
| 187 | + */ |
|
| 168 | 188 | protected function addToMember(&$name, $value, $separator=" ") { |
| 169 | 189 | $name=str_ireplace($value, "", $name) . $separator . $value; |
| 170 | 190 | return $this; |
@@ -179,6 +199,9 @@ discard block |
||
| 179 | 199 | return $this->addToProperty($name, $value); |
| 180 | 200 | } |
| 181 | 201 | |
| 202 | + /** |
|
| 203 | + * @param string $name |
|
| 204 | + */ |
|
| 182 | 205 | public function addToPropertyCtrl($name, $value, $typeCtrl) { |
| 183 | 206 | return $this->addToPropertyUnique($name, $value, $typeCtrl); |
| 184 | 207 | } |
@@ -242,6 +265,9 @@ discard block |
||
| 242 | 265 | return $array; |
| 243 | 266 | } |
| 244 | 267 | |
| 268 | + /** |
|
| 269 | + * @param \Closure $function |
|
| 270 | + */ |
|
| 245 | 271 | public function fromDatabaseObjects($objects, $function) { |
| 246 | 272 | if (isset($objects)) { |
| 247 | 273 | foreach ( $objects as $object ) { |
@@ -345,14 +371,23 @@ discard block |
||
| 345 | 371 | return $this; |
| 346 | 372 | } |
| 347 | 373 | |
| 374 | + /** |
|
| 375 | + * @param string $event |
|
| 376 | + */ |
|
| 348 | 377 | public function getOn($event, $url, $responseElement="", $parameters=array()) { |
| 349 | 378 | return $this->_ajaxOn("get", $event, $url, $responseElement, $parameters); |
| 350 | 379 | } |
| 351 | 380 | |
| 381 | + /** |
|
| 382 | + * @param string $url |
|
| 383 | + */ |
|
| 352 | 384 | public function getOnClick($url, $responseElement="", $parameters=array()) { |
| 353 | 385 | return $this->getOn("click", $url, $responseElement, $parameters); |
| 354 | 386 | } |
| 355 | 387 | |
| 388 | + /** |
|
| 389 | + * @param string $event |
|
| 390 | + */ |
|
| 356 | 391 | public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) { |
| 357 | 392 | $parameters["params"]=$params; |
| 358 | 393 | return $this->_ajaxOn("post", $event, $url, $responseElement, $parameters); |
@@ -362,6 +397,9 @@ discard block |
||
| 362 | 397 | return $this->postOn("click", $url, $params, $responseElement, $parameters); |
| 363 | 398 | } |
| 364 | 399 | |
| 400 | + /** |
|
| 401 | + * @param string $event |
|
| 402 | + */ |
|
| 365 | 403 | public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) { |
| 366 | 404 | $parameters["form"]=$form; |
| 367 | 405 | return $this->_ajaxOn("postForm", $event, $url, $responseElement, $parameters); |
@@ -389,6 +427,10 @@ discard block |
||
| 389 | 427 | return null; |
| 390 | 428 | } |
| 391 | 429 | |
| 430 | + /** |
|
| 431 | + * @param string $propertyName |
|
| 432 | + * @param string $value |
|
| 433 | + */ |
|
| 392 | 434 | protected function getElementByPropertyValue($propertyName,$value, $elements) { |
| 393 | 435 | if (is_array($elements)) { |
| 394 | 436 | $flag=false; |
@@ -429,6 +471,9 @@ discard block |
||
| 429 | 471 | return $value; |
| 430 | 472 | } |
| 431 | 473 | |
| 474 | + /** |
|
| 475 | + * @param string $jqueryCall |
|
| 476 | + */ |
|
| 432 | 477 | public function jsDoJquery($jqueryCall, $param="") { |
| 433 | 478 | return "$('#" . $this->identifier . "')." . $jqueryCall . "(" . $this->_prep_value($param) . ");"; |
| 434 | 479 | } |