@@ -41,12 +41,12 @@ discard block |
||
| 41 | 41 | * @return HtmlMenu |
| 42 | 42 | */ |
| 43 | 43 | public function setType($type="") { |
| 44 | - return $this->addToPropertyCtrl("class", $type, array ("","item","text" )); |
|
| 44 | + return $this->addToPropertyCtrl("class", $type, array("", "item", "text")); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function setActiveItem($index) { |
| 48 | 48 | $item=$this->getItem($index); |
| 49 | - if ($item !== null) { |
|
| 49 | + if ($item!==null) { |
|
| 50 | 50 | $item->addToProperty("class", "active"); |
| 51 | 51 | } |
| 52 | 52 | return $this; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | private function getItemToInsert($item) { |
| 56 | 56 | if ($item instanceof HtmlInput || $item instanceof HtmlImg || $item instanceof HtmlIcon || $item instanceof HtmlButtonGroups || $item instanceof HtmlButton || $item instanceof HtmlLabel) { |
| 57 | - $itemO=new HtmlMenuItem("item-" . $this->identifier . "-" . \sizeof($this->content) , $item); |
|
| 57 | + $itemO=new HtmlMenuItem("item-".$this->identifier."-".\sizeof($this->content), $item); |
|
| 58 | 58 | $itemO->addClass("no-active"); |
| 59 | 59 | $item=$itemO; |
| 60 | 60 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | private function afterInsert($item) { |
| 65 | 65 | if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) |
| 66 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
| 66 | + $item->addToPropertyCtrl("class", "item", array("item")); |
|
| 67 | 67 | else { |
| 68 | 68 | $this->setSecondary(); |
| 69 | 69 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | public function addItem($item) { |
| 80 | 80 | $number=$item; |
| 81 | 81 | $item=parent::addItem($this->getItemToInsert($item)); |
| 82 | - if(\is_int($number)) |
|
| 82 | + if (\is_int($number)) |
|
| 83 | 83 | $item->setProperty("data-page", $number); |
| 84 | 84 | return $this->afterInsert($item); |
| 85 | 85 | } |
@@ -97,15 +97,15 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | public function generateMenuAsItem($menu, $header=null) { |
| 99 | 99 | $count=$this->count(); |
| 100 | - $item=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "div"); |
|
| 100 | + $item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div"); |
|
| 101 | 101 | if (isset($header)) { |
| 102 | - $headerItem=new HtmlSemDoubleElement("item-header-" . $this->identifier . "-" . $count, "div", "header"); |
|
| 102 | + $headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header"); |
|
| 103 | 103 | $headerItem->setContent($header); |
| 104 | 104 | $item->addContent($headerItem); |
| 105 | 105 | $this->_itemHeader=$headerItem; |
| 106 | 106 | } |
| 107 | - if(\is_array($menu)){ |
|
| 108 | - $menu=new HtmlMenu("menu-" . $this->identifier . "-" . $count,$menu); |
|
| 107 | + if (\is_array($menu)) { |
|
| 108 | + $menu=new HtmlMenu("menu-".$this->identifier."-".$count, $menu); |
|
| 109 | 109 | } |
| 110 | 110 | $menu->setClass("menu"); |
| 111 | 111 | $item->addContent($menu); |
@@ -117,11 +117,11 @@ discard block |
||
| 117 | 117 | * @param String|HtmlDoubleElement $caption |
| 118 | 118 | * @return \Ajax\common\html\HtmlDoubleElement |
| 119 | 119 | */ |
| 120 | - public function addHeader($caption){ |
|
| 121 | - if(!($caption instanceof HtmlDoubleElement)){ |
|
| 122 | - $header=new HtmlDoubleElement('','div'); |
|
| 120 | + public function addHeader($caption) { |
|
| 121 | + if (!($caption instanceof HtmlDoubleElement)) { |
|
| 122 | + $header=new HtmlDoubleElement('', 'div'); |
|
| 123 | 123 | $header->setContent($caption); |
| 124 | - }else{ |
|
| 124 | + } else { |
|
| 125 | 125 | $header=$caption; |
| 126 | 126 | } |
| 127 | 127 | $header->addClass('item header'); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $value=new HtmlSemDoubleElement($identifier, "a", "browse item", $value); |
| 138 | 138 | $value->addContent(new HtmlIcon("", "dropdown")); |
| 139 | 139 | $value=$this->addItem($value); |
| 140 | - $popup=new HtmlPopup($value, "popup-" . $this->identifier . "-" . $this->count(), $content); |
|
| 140 | + $popup=new HtmlPopup($value, "popup-".$this->identifier."-".$this->count(), $content); |
|
| 141 | 141 | $popup->setFlowing()->setPosition("bottom left")->setOn("click"); |
| 142 | 142 | $this->wrap("", $popup); |
| 143 | 143 | return $popup; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | public function addDropdownAsItem($value, $items=NULL) { |
| 147 | 147 | $dd=$value; |
| 148 | 148 | if (\is_string($value)) { |
| 149 | - $dd=new HtmlDropdown("dropdown-" . $this->identifier . "-" . $this->count(), $value, $items); |
|
| 149 | + $dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(), $value, $items); |
|
| 150 | 150 | } |
| 151 | 151 | $this->addItem($dd); |
| 152 | 152 | return $dd; |
@@ -159,14 +159,14 @@ discard block |
||
| 159 | 159 | * @see HtmlCollection::createItem() |
| 160 | 160 | */ |
| 161 | 161 | protected function createItem($value) { |
| 162 | - $itemO=new HtmlMenuItem($this->identifier."-item-" . \sizeof($this->content),""); |
|
| 162 | + $itemO=new HtmlMenuItem($this->identifier."-item-".\sizeof($this->content), ""); |
|
| 163 | 163 | $itemO->setTagName("a"); |
| 164 | 164 | $itemO->setContent($value); |
| 165 | 165 | return $itemO; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | public function setSecondary($value=true) { |
| 169 | - if($value) |
|
| 169 | + if ($value) |
|
| 170 | 170 | $this->addToProperty("class", "secondary"); |
| 171 | 171 | else |
| 172 | 172 | $this->removePropertyValue("class", "secondary"); |
@@ -174,28 +174,28 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | public function setVertical() { |
| 177 | - return $this->addToPropertyCtrl("class", "vertical", array ("vertical" )); |
|
| 177 | + return $this->addToPropertyCtrl("class", "vertical", array("vertical")); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | public function setPosition($value="right") { |
| 181 | - return $this->addToPropertyCtrl("class", $value, array ("right","left" )); |
|
| 181 | + return $this->addToPropertyCtrl("class", $value, array("right", "left")); |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | public function setPointing($value=Direction::NONE) { |
| 185 | - return $this->addToPropertyCtrl("class", $value . " pointing", Direction::getConstantValues("pointing")); |
|
| 185 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | public function asTab($vertical=false) { |
| 189 | - $this->apply(function (HtmlDoubleElement &$item) { |
|
| 189 | + $this->apply(function(HtmlDoubleElement &$item) { |
|
| 190 | 190 | $item->setTagName("a"); |
| 191 | 191 | }); |
| 192 | - if ($vertical === true) |
|
| 192 | + if ($vertical===true) |
|
| 193 | 193 | $this->setVertical(); |
| 194 | 194 | return $this->addToProperty("class", "tabular"); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | public function asPagination() { |
| 198 | - $this->apply(function (HtmlDoubleElement &$item) { |
|
| 198 | + $this->apply(function(HtmlDoubleElement &$item) { |
|
| 199 | 199 | $item->setTagName("a"); |
| 200 | 200 | }); |
| 201 | 201 | return $this->addToProperty("class", "pagination"); |
@@ -232,10 +232,10 @@ discard block |
||
| 232 | 232 | */ |
| 233 | 233 | public function setWidth($width) { |
| 234 | 234 | if (\is_int($width)) { |
| 235 | - $width=Wide::getConstants()["W" . $width]; |
|
| 235 | + $width=Wide::getConstants()["W".$width]; |
|
| 236 | 236 | } |
| 237 | 237 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
| 238 | - return $this->addToPropertyCtrl("class", "item", array ("item" )); |
|
| 238 | + return $this->addToPropertyCtrl("class", "item", array("item")); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | public function addImage($identifier, $src="", $alt="") { |
@@ -250,14 +250,14 @@ discard block |
||
| 250 | 250 | return $this->_itemHeader; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | - public function setHasContainer(){ |
|
| 254 | - return $this->wrapContent("<div class='ui container'>","</div>"); |
|
| 253 | + public function setHasContainer() { |
|
| 254 | + return $this->wrapContent("<div class='ui container'>", "</div>"); |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | - public function run(JsUtils $js){ |
|
| 258 | - if($this->identifier!=="" && !isset($this->_bsComponent)) |
|
| 259 | - $this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false); |
|
| 260 | - $result= parent::run($js); |
|
| 257 | + public function run(JsUtils $js) { |
|
| 258 | + if ($this->identifier!=="" && !isset($this->_bsComponent)) |
|
| 259 | + $this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}', false, false); |
|
| 260 | + $result=parent::run($js); |
|
| 261 | 261 | return $result->setItemSelector(">.item:not(.header)"); |
| 262 | 262 | } |
| 263 | 263 | } |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | private function afterInsert($item) { |
| 65 | - if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) |
|
| 66 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
| 67 | - else { |
|
| 65 | + if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) { |
|
| 66 | + $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
| 67 | + } else { |
|
| 68 | 68 | $this->setSecondary(); |
| 69 | 69 | } |
| 70 | 70 | return $item; |
@@ -79,8 +79,9 @@ discard block |
||
| 79 | 79 | public function addItem($item) { |
| 80 | 80 | $number=$item; |
| 81 | 81 | $item=parent::addItem($this->getItemToInsert($item)); |
| 82 | - if(\is_int($number)) |
|
| 83 | - $item->setProperty("data-page", $number); |
|
| 82 | + if(\is_int($number)) { |
|
| 83 | + $item->setProperty("data-page", $number); |
|
| 84 | + } |
|
| 84 | 85 | return $this->afterInsert($item); |
| 85 | 86 | } |
| 86 | 87 | |
@@ -121,7 +122,7 @@ discard block |
||
| 121 | 122 | if(!($caption instanceof HtmlDoubleElement)){ |
| 122 | 123 | $header=new HtmlDoubleElement('','div'); |
| 123 | 124 | $header->setContent($caption); |
| 124 | - }else{ |
|
| 125 | + } else{ |
|
| 125 | 126 | $header=$caption; |
| 126 | 127 | } |
| 127 | 128 | $header->addClass('item header'); |
@@ -166,10 +167,11 @@ discard block |
||
| 166 | 167 | } |
| 167 | 168 | |
| 168 | 169 | public function setSecondary($value=true) { |
| 169 | - if($value) |
|
| 170 | - $this->addToProperty("class", "secondary"); |
|
| 171 | - else |
|
| 172 | - $this->removePropertyValue("class", "secondary"); |
|
| 170 | + if($value) { |
|
| 171 | + $this->addToProperty("class", "secondary"); |
|
| 172 | + } else { |
|
| 173 | + $this->removePropertyValue("class", "secondary"); |
|
| 174 | + } |
|
| 173 | 175 | return $this; |
| 174 | 176 | } |
| 175 | 177 | |
@@ -189,8 +191,9 @@ discard block |
||
| 189 | 191 | $this->apply(function (HtmlDoubleElement &$item) { |
| 190 | 192 | $item->setTagName("a"); |
| 191 | 193 | }); |
| 192 | - if ($vertical === true) |
|
| 193 | - $this->setVertical(); |
|
| 194 | + if ($vertical === true) { |
|
| 195 | + $this->setVertical(); |
|
| 196 | + } |
|
| 194 | 197 | return $this->addToProperty("class", "tabular"); |
| 195 | 198 | } |
| 196 | 199 | |
@@ -219,10 +222,11 @@ discard block |
||
| 219 | 222 | */ |
| 220 | 223 | public function fromDatabaseObject($object, $function) { |
| 221 | 224 | $return=$function($object); |
| 222 | - if (\is_array($return)) |
|
| 223 | - $this->addItems($return); |
|
| 224 | - else |
|
| 225 | - $this->addItem($return); |
|
| 225 | + if (\is_array($return)) { |
|
| 226 | + $this->addItems($return); |
|
| 227 | + } else { |
|
| 228 | + $this->addItem($return); |
|
| 229 | + } |
|
| 226 | 230 | } |
| 227 | 231 | |
| 228 | 232 | /** |
@@ -255,8 +259,9 @@ discard block |
||
| 255 | 259 | } |
| 256 | 260 | |
| 257 | 261 | public function run(JsUtils $js){ |
| 258 | - if($this->identifier!=="" && !isset($this->_bsComponent)) |
|
| 259 | - $this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false); |
|
| 262 | + if($this->identifier!=="" && !isset($this->_bsComponent)) { |
|
| 263 | + $this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false); |
|
| 264 | + } |
|
| 260 | 265 | $result= parent::run($js); |
| 261 | 266 | return $result->setItemSelector(">.item:not(.header)"); |
| 262 | 267 | } |
@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | * @version 1.001 |
| 11 | 11 | */ |
| 12 | 12 | abstract class BaseComponent { |
| 13 | - public $jquery_code_for_compile=array (); |
|
| 14 | - protected $params=array (); |
|
| 13 | + public $jquery_code_for_compile=array(); |
|
| 14 | + protected $params=array(); |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | public function setParams($params) { |
| 71 | - foreach ( $params as $k => $v ) { |
|
| 71 | + foreach ($params as $k => $v) { |
|
| 72 | 72 | $method="set".ucfirst($k); |
| 73 | 73 | if (method_exists($this, $method)) |
| 74 | 74 | $this->$method($v); |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | return $this; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - public function addParams($params){ |
|
| 85 | - foreach ($params as $k=>$v){ |
|
| 84 | + public function addParams($params) { |
|
| 85 | + foreach ($params as $k=>$v) { |
|
| 86 | 86 | $this->setParam($k, $v); |
| 87 | 87 | } |
| 88 | 88 | return $this; |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | abstract public function getScript(); |
| 92 | 92 | |
| 93 | - public function setDebug($value){ |
|
| 93 | + public function setDebug($value) { |
|
| 94 | 94 | return $this->setParam("debug", $value); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - public function setVerbose($value){ |
|
| 97 | + public function setVerbose($value) { |
|
| 98 | 98 | return $this->setParam("verbose", $value); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -39,8 +39,9 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function getParam($key) { |
| 41 | 41 | $value=null; |
| 42 | - if (array_key_exists($key, $this->params)) |
|
| 43 | - $value=$this->params [$key]; |
|
| 42 | + if (array_key_exists($key, $this->params)) { |
|
| 43 | + $value=$this->params [$key]; |
|
| 44 | + } |
|
| 44 | 45 | return $value; |
| 45 | 46 | } |
| 46 | 47 | |
@@ -49,16 +50,18 @@ discard block |
||
| 49 | 50 | } |
| 50 | 51 | |
| 51 | 52 | public function compile(JsUtils $js=NULL) { |
| 52 | - if ($js==NULL) |
|
| 53 | - $js=$this->js; |
|
| 53 | + if ($js==NULL) { |
|
| 54 | + $js=$this->js; |
|
| 55 | + } |
|
| 54 | 56 | $script=$this->getScript(); |
| 55 | 57 | $js->addToCompile($script); |
| 56 | 58 | } |
| 57 | 59 | |
| 58 | 60 | protected function setParamCtrl($key, $value, $typeCtrl) { |
| 59 | 61 | if (\is_array($typeCtrl)) { |
| 60 | - if (array_search($value, $typeCtrl)===false) |
|
| 61 | - throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
| 62 | + if (array_search($value, $typeCtrl)===false) { |
|
| 63 | + throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
| 64 | + } |
|
| 62 | 65 | } else { |
| 63 | 66 | if (!$typeCtrl($value)) { |
| 64 | 67 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key); |
@@ -70,9 +73,9 @@ discard block |
||
| 70 | 73 | public function setParams($params) { |
| 71 | 74 | foreach ( $params as $k => $v ) { |
| 72 | 75 | $method="set".ucfirst($k); |
| 73 | - if (method_exists($this, $method)) |
|
| 74 | - $this->$method($v); |
|
| 75 | - else { |
|
| 76 | + if (method_exists($this, $method)) { |
|
| 77 | + $this->$method($v); |
|
| 78 | + } else { |
|
| 76 | 79 | $this->setParam($k, $v); |
| 77 | 80 | trigger_error("`{$k}` doesn't exists!", E_USER_NOTICE); |
| 78 | 81 | } |
@@ -18,11 +18,11 @@ |
||
| 18 | 18 | $this->uiName='modal'; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function showDimmer(){ |
|
| 21 | + public function showDimmer() { |
|
| 22 | 22 | return $this->addBehavior('hide dimmer'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public function setInverted(){ |
|
| 25 | + public function setInverted() { |
|
| 26 | 26 | $this->params['inverted']=true; |
| 27 | 27 | } |
| 28 | 28 | |
@@ -5,8 +5,8 @@ discard block |
||
| 5 | 5 | use Ajax\common\JsCode; |
| 6 | 6 | |
| 7 | 7 | class SimpleExtComponent extends SimpleComponent { |
| 8 | - protected $events=array (); |
|
| 9 | - protected $jsCodes=array (); |
|
| 8 | + protected $events=array(); |
|
| 9 | + protected $jsCodes=array(); |
|
| 10 | 10 | |
| 11 | 11 | public function addEvent($event, $jsCode) { |
| 12 | 12 | $this->events [$event]=$jsCode; |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | return $this->compileJQueryCode(); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - protected function compileJsCodes(){ |
|
| 23 | - foreach ( $this->jsCodes as $jsCode ) { |
|
| 24 | - $this->jquery_code_for_compile []=$jsCode->compile(array ( |
|
| 22 | + protected function compileJsCodes() { |
|
| 23 | + foreach ($this->jsCodes as $jsCode) { |
|
| 24 | + $this->jquery_code_for_compile []=$jsCode->compile(array( |
|
| 25 | 25 | "identifier" => $this->attachTo |
| 26 | 26 | )); |
| 27 | 27 | } |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | return $this; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - protected function generateParamParts(){ |
|
| 20 | + protected function generateParamParts() { |
|
| 21 | 21 | $results=[]; |
| 22 | - foreach ($this->paramParts as $paramPart){ |
|
| 22 | + foreach ($this->paramParts as $paramPart) { |
|
| 23 | 23 | $results[]="{$this->uiName}(".\implode(",", $paramPart).")"; |
| 24 | 24 | } |
| 25 | 25 | return \implode(".", $results); |
@@ -27,10 +27,10 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function getScript() { |
| 29 | 29 | $allParams=$this->params; |
| 30 | - $this->jquery_code_for_compile=array (); |
|
| 30 | + $this->jquery_code_for_compile=array(); |
|
| 31 | 31 | $this->compileJsCodes(); |
| 32 | 32 | $paramParts=""; |
| 33 | - if(\sizeof($this->paramParts)>0){ |
|
| 33 | + if (\sizeof($this->paramParts)>0) { |
|
| 34 | 34 | $paramParts=".".$this->generateParamParts(); |
| 35 | 35 | } |
| 36 | 36 | $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).")".$paramParts.";"; |
@@ -43,12 +43,12 @@ discard block |
||
| 43 | 43 | return $this; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - public function addComponentEvent($event,$jsCode){ |
|
| 47 | - $jsCode=\str_ireplace("\"","%quote%", $jsCode); |
|
| 46 | + public function addComponentEvent($event, $jsCode) { |
|
| 47 | + $jsCode=\str_ireplace("\"", "%quote%", $jsCode); |
|
| 48 | 48 | return $this->setParam($event, "%function(){".$jsCode."}%"); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - public function setJs(JsUtils $js){ |
|
| 51 | + public function setJs(JsUtils $js) { |
|
| 52 | 52 | $this->js=$js; |
| 53 | 53 | $js->semantic()->addComponent($this, $this->attachTo, $this->params); |
| 54 | 54 | } |
@@ -20,33 +20,33 @@ |
||
| 20 | 20 | $this->uiName='slider'; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function close(){ |
|
| 23 | + public function close() { |
|
| 24 | 24 | return $this->addBehavior('close'); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function setInterpretLabel($labels){ |
|
| 27 | + public function setInterpretLabel($labels) { |
|
| 28 | 28 | $var="window.document._slider_labels['".JString::cleanIdentifier($this->attachTo)."']"; |
| 29 | 29 | $this->addCode('window.document._slider_labels=window.document._slider_labels||[];'.$var.'='.\json_encode($labels).';'); |
| 30 | 30 | $this->params['interpretLabel']='%function(value) {return '.$var.'[value];}%'; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - public function setMin($min){ |
|
| 33 | + public function setMin($min) { |
|
| 34 | 34 | $this->params['min']=$min; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - public function setMax($max){ |
|
| 37 | + public function setMax($max) { |
|
| 38 | 38 | $this->params['max']=$max; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function setStart($start){ |
|
| 41 | + public function setStart($start) { |
|
| 42 | 42 | $this->params['start']=$start; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public function setEnd($end){ |
|
| 45 | + public function setEnd($end) { |
|
| 46 | 46 | $this->params['end']=$end; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - public function setStep($step){ |
|
| 49 | + public function setStep($step) { |
|
| 50 | 50 | $this->params['step']=$step; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -134,8 +134,8 @@ discard block |
||
| 134 | 134 | * @param string|array $params |
| 135 | 135 | * @return Modal |
| 136 | 136 | */ |
| 137 | - public function modal($attachTo=NULL, $params=NULL,$paramsParts=NULL) { |
|
| 138 | - $result= $this->addComponent(new Modal($this->js), $attachTo, $params); |
|
| 137 | + public function modal($attachTo=NULL, $params=NULL, $paramsParts=NULL) { |
|
| 138 | + $result=$this->addComponent(new Modal($this->js), $attachTo, $params); |
|
| 139 | 139 | $result->setParamParts($paramsParts); |
| 140 | 140 | return $result; |
| 141 | 141 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | * @return Tab |
| 147 | 147 | */ |
| 148 | 148 | public function tab($attachTo=NULL, $params=NULL) { |
| 149 | - $result= $this->addComponent(new Tab($this->js), $attachTo, $params); |
|
| 149 | + $result=$this->addComponent(new Tab($this->js), $attachTo, $params); |
|
| 150 | 150 | return $result; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * @return Shape |
| 157 | 157 | */ |
| 158 | 158 | public function shape($attachTo=NULL, $params=NULL) { |
| 159 | - $result= $this->addComponent(new Shape($this->js), $attachTo, $params); |
|
| 159 | + $result=$this->addComponent(new Shape($this->js), $attachTo, $params); |
|
| 160 | 160 | return $result; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * @return Form |
| 167 | 167 | */ |
| 168 | 168 | public function form($attachTo=NULL, $params=NULL) { |
| 169 | - $result= $this->addComponent(new Form($this->js), $attachTo, $params); |
|
| 169 | + $result=$this->addComponent(new Form($this->js), $attachTo, $params); |
|
| 170 | 170 | return $result; |
| 171 | 171 | } |
| 172 | 172 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * @return Toast |
| 177 | 177 | */ |
| 178 | 178 | public function toast($attachTo=NULL, $params=NULL) { |
| 179 | - $result= $this->addComponent(new Toast($this->js), $attachTo, $params); |
|
| 179 | + $result=$this->addComponent(new Toast($this->js), $attachTo, $params); |
|
| 180 | 180 | return $result; |
| 181 | 181 | } |
| 182 | 182 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * @return Slider |
| 187 | 187 | */ |
| 188 | 188 | public function slider($attachTo=NULL, $params=NULL) { |
| 189 | - $result= $this->addComponent(new Slider($this->js), $attachTo, $params); |
|
| 189 | + $result=$this->addComponent(new Slider($this->js), $attachTo, $params); |
|
| 190 | 190 | return $result; |
| 191 | 191 | } |
| 192 | 192 | |
@@ -18,14 +18,14 @@ discard block |
||
| 18 | 18 | protected $_paramParts=array(); |
| 19 | 19 | |
| 20 | 20 | public function __construct($identifier, $content='') { |
| 21 | - parent::__construct($identifier, 'div','ui toast'); |
|
| 22 | - if(isset($content)){ |
|
| 21 | + parent::__construct($identifier, 'div', 'ui toast'); |
|
| 22 | + if (isset($content)) { |
|
| 23 | 23 | $this->setContent($content); |
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | public function setContent($value) { |
| 28 | - $this->content['content']=new HtmlSemDoubleElement('content-' . $this->identifier, 'div', 'content', $value); |
|
| 28 | + $this->content['content']=new HtmlSemDoubleElement('content-'.$this->identifier, 'div', 'content', $value); |
|
| 29 | 29 | return $this; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
| 37 | 37 | */ |
| 38 | 38 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 39 | - $this->content=JArray::sortAssociative($this->content, ['content','actions' ]); |
|
| 39 | + $this->content=JArray::sortAssociative($this->content, ['content', 'actions']); |
|
| 40 | 40 | return parent::compile($js, $view); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | * @see BaseHtml::run() |
| 46 | 46 | */ |
| 47 | 47 | public function run(JsUtils $js) { |
| 48 | - if(isset($this->_bsComponent)===false){ |
|
| 49 | - $this->_bsComponent=$js->semantic()->toast('#'.$this->identifier,$this->_params,$this->_paramParts); |
|
| 48 | + if (isset($this->_bsComponent)===false) { |
|
| 49 | + $this->_bsComponent=$js->semantic()->toast('#'.$this->identifier, $this->_params, $this->_paramParts); |
|
| 50 | 50 | } |
| 51 | 51 | $this->addEventsOnRun($js); |
| 52 | 52 | return $this->_bsComponent; |
@@ -5,5 +5,5 @@ |
||
| 5 | 5 | use Ajax\common\BaseEnum; |
| 6 | 6 | |
| 7 | 7 | abstract class People extends BaseEnum { |
| 8 | - const ADULT='adult',ALIEN='alien',ANGEL='angel',ANGRY='angry',ANGUISHED='anguished',ASTONISHED='astonished',ATHLETIC_SHOE='athletic_shoe',BABY='baby',BALD='bald',BALLET_SHOES='ballet_shoes'; |
|
| 8 | + const ADULT='adult', ALIEN='alien', ANGEL='angel', ANGRY='angry', ANGUISHED='anguished', ASTONISHED='astonished', ATHLETIC_SHOE='athletic_shoe', BABY='baby', BALD='bald', BALLET_SHOES='ballet_shoes'; |
|
| 9 | 9 | } |