@@ -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,6 +141,10 @@ discard block |
||
| 137 | 141 | return $this; |
| 138 | 142 | } |
| 139 | 143 | |
| 144 | + /** |
|
| 145 | + * @param string $name |
|
| 146 | + * @param string[] $typeCtrl |
|
| 147 | + */ |
|
| 140 | 148 | protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") { |
| 141 | 149 | if ($this->ctrl($name, $value, $typeCtrl)===true) { |
| 142 | 150 | if (is_array($typeCtrl)) { |
@@ -161,6 +169,9 @@ discard block |
||
| 161 | 169 | return $this->addToProperty($name, $value); |
| 162 | 170 | } |
| 163 | 171 | |
| 172 | + /** |
|
| 173 | + * @param string $name |
|
| 174 | + */ |
|
| 164 | 175 | public function addToPropertyCtrl($name, $value, $typeCtrl) { |
| 165 | 176 | // if($this->ctrl($name, $value, $typeCtrl)===true){ |
| 166 | 177 | return $this->addToPropertyUnique($name, $value, $typeCtrl); |
@@ -228,6 +239,9 @@ discard block |
||
| 228 | 239 | |
| 229 | 240 | } |
| 230 | 241 | |
| 242 | + /** |
|
| 243 | + * @param string $before |
|
| 244 | + */ |
|
| 231 | 245 | public function wrap($before, $after="") { |
| 232 | 246 | if(isset($before)){ |
| 233 | 247 | $this->wrapBefore.=$before; |
@@ -296,6 +310,9 @@ discard block |
||
| 296 | 310 | } |
| 297 | 311 | } |
| 298 | 312 | |
| 313 | + /** |
|
| 314 | + * @param string $operation |
|
| 315 | + */ |
|
| 299 | 316 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
| 300 | 317 | $params=array ( |
| 301 | 318 | "url" => $url, |
@@ -306,14 +323,23 @@ discard block |
||
| 306 | 323 | return $this; |
| 307 | 324 | } |
| 308 | 325 | |
| 326 | + /** |
|
| 327 | + * @param string $event |
|
| 328 | + */ |
|
| 309 | 329 | public function getOn($event, $url, $responseElement="", $parameters=array()) { |
| 310 | 330 | return $this->_ajaxOn("get", $event, $url, $responseElement, $parameters); |
| 311 | 331 | } |
| 312 | 332 | |
| 333 | + /** |
|
| 334 | + * @param string $url |
|
| 335 | + */ |
|
| 313 | 336 | public function getOnClick($url, $responseElement="", $parameters=array()) { |
| 314 | 337 | return $this->getOn("click", $url, $responseElement, $parameters); |
| 315 | 338 | } |
| 316 | 339 | |
| 340 | + /** |
|
| 341 | + * @param string $event |
|
| 342 | + */ |
|
| 317 | 343 | public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) { |
| 318 | 344 | $parameters ["params"]=$params; |
| 319 | 345 | return $this->_ajaxOn("post", $event, $url, $responseElement, $parameters); |
@@ -323,6 +349,9 @@ discard block |
||
| 323 | 349 | return $this->postOn("click", $url, $params, $responseElement, $parameters); |
| 324 | 350 | } |
| 325 | 351 | |
| 352 | + /** |
|
| 353 | + * @param string $event |
|
| 354 | + */ |
|
| 326 | 355 | public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) { |
| 327 | 356 | $parameters ["form"]=$form; |
| 328 | 357 | return $this->_ajaxOn("postForm", $event, $url, $responseElement, $parameters); |
@@ -372,6 +401,9 @@ discard block |
||
| 372 | 401 | return $value; |
| 373 | 402 | } |
| 374 | 403 | |
| 404 | + /** |
|
| 405 | + * @param string $jqueryCall |
|
| 406 | + */ |
|
| 375 | 407 | public function jsDoJquery($jqueryCall, $param=""){ |
| 376 | 408 | return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");"; |
| 377 | 409 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $itemO=$item; |
| 35 | 35 | if(\is_object($item)===false){ |
| 36 | 36 | $itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image); |
| 37 | - }elseif($itemO instanceof HtmlDropdownItem){ |
|
| 37 | + } elseif($itemO instanceof HtmlDropdownItem){ |
|
| 38 | 38 | $this->addToProperty("class", "vertical"); |
| 39 | 39 | } |
| 40 | 40 | $this->items[]=$itemO; |
@@ -42,8 +42,9 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function addInput($name){ |
| 45 | - if(!isset($name)) |
|
| 46 | - $name="input-".$this->identifier; |
|
| 45 | + if(!isset($name)) { |
|
| 46 | + $name="input-".$this->identifier; |
|
| 47 | + } |
|
| 47 | 48 | $this->setAction("activate"); |
| 48 | 49 | $this->input=new HtmlInput($name,"hidden"); |
| 49 | 50 | } |
@@ -53,7 +54,7 @@ discard block |
||
| 53 | 54 | foreach ($items as $k=>$v){ |
| 54 | 55 | $this->addItem($v)->setData($k); |
| 55 | 56 | } |
| 56 | - }else{ |
|
| 57 | + } else{ |
|
| 57 | 58 | foreach ($items as $item){ |
| 58 | 59 | $this->addItem($item); |
| 59 | 60 | } |
@@ -67,7 +68,7 @@ discard block |
||
| 67 | 68 | if($dropdown===false){ |
| 68 | 69 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php'; |
| 69 | 70 | $dropdown="menu"; |
| 70 | - }else{ |
|
| 71 | + } else{ |
|
| 71 | 72 | $dropdown="dropdown"; |
| 72 | 73 | $this->mClass="menu"; |
| 73 | 74 | } |
@@ -83,18 +84,22 @@ discard block |
||
| 83 | 84 | } |
| 84 | 85 | |
| 85 | 86 | public function asButton($floating=false){ |
| 86 | - if($floating) |
|
| 87 | - $this->addToProperty("class", "floating"); |
|
| 87 | + if($floating) { |
|
| 88 | + $this->addToProperty("class", "floating"); |
|
| 89 | + } |
|
| 88 | 90 | return $this->addToProperty("class", "button"); |
| 89 | 91 | } |
| 90 | 92 | |
| 91 | 93 | public function asSelect($name=NULL,$multiple=false,$selection=true){ |
| 92 | - if(isset($name)) |
|
| 93 | - $this->addInput($name); |
|
| 94 | - if($multiple) |
|
| 95 | - $this->addToProperty("class", "multiple"); |
|
| 96 | - if ($selection) |
|
| 97 | - $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
| 94 | + if(isset($name)) { |
|
| 95 | + $this->addInput($name); |
|
| 96 | + } |
|
| 97 | + if($multiple) { |
|
| 98 | + $this->addToProperty("class", "multiple"); |
|
| 99 | + } |
|
| 100 | + if ($selection) { |
|
| 101 | + $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
| 102 | + } |
|
| 98 | 103 | return $this; |
| 99 | 104 | } |
| 100 | 105 | |
@@ -104,8 +109,9 @@ discard block |
||
| 104 | 109 | } |
| 105 | 110 | |
| 106 | 111 | public function setSelect($name=NULL,$multiple=false){ |
| 107 | - if(!isset($name)) |
|
| 108 | - $name="select-".$this->identifier; |
|
| 112 | + if(!isset($name)) { |
|
| 113 | + $name="select-".$this->identifier; |
|
| 114 | + } |
|
| 109 | 115 | $this->input=null; |
| 110 | 116 | if($multiple){ |
| 111 | 117 | $this->setProperty("multiple", true); |
@@ -131,15 +137,16 @@ discard block |
||
| 131 | 137 | |
| 132 | 138 | public function setPointing($sens=""){ |
| 133 | 139 | $this->addToProperty("class", "pointing"); |
| 134 | - if(JString::isNotNull($sens)) |
|
| 135 | - $this->addToPropertyCtrl("class", $sens, array("left","right")); |
|
| 140 | + if(JString::isNotNull($sens)) { |
|
| 141 | + $this->addToPropertyCtrl("class", $sens, array("left","right")); |
|
| 142 | + } |
|
| 136 | 143 | return $this; |
| 137 | 144 | } |
| 138 | 145 | |
| 139 | 146 | public function setValue($value){ |
| 140 | 147 | if(isset($this->input)){ |
| 141 | 148 | $this->input->setProperty("value", $value); |
| 142 | - }else{ |
|
| 149 | + } else{ |
|
| 143 | 150 | $this->setProperty("value", $value); |
| 144 | 151 | } |
| 145 | 152 | return $this; |