@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function setActive($value) { |
| 30 | - if(is_array($this->content)){ |
|
| 31 | - foreach ($this->content as $pb){ |
|
| 30 | + if (is_array($this->content)) { |
|
| 31 | + foreach ($this->content as $pb) { |
|
| 32 | 32 | $pb->setActive($value); |
| 33 | 33 | } |
| 34 | - }else{ |
|
| 34 | + }else { |
|
| 35 | 35 | if ($value===true) |
| 36 | 36 | $this->active="active"; |
| 37 | 37 | else |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function setStriped($value) { |
| 44 | - if(is_array($this->content)){ |
|
| 45 | - foreach ($this->content as $pb){ |
|
| 44 | + if (is_array($this->content)) { |
|
| 45 | + foreach ($this->content as $pb) { |
|
| 46 | 46 | $pb->setStriped($value); |
| 47 | 47 | } |
| 48 | - }else{ |
|
| 48 | + }else { |
|
| 49 | 49 | if ($value===true) |
| 50 | 50 | $this->striped="progress-bar-striped"; |
| 51 | 51 | else |
@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public function showCaption($value) { |
| 58 | - if(is_array($this->content)){ |
|
| 59 | - foreach ($this->content as $pb){ |
|
| 58 | + if (is_array($this->content)) { |
|
| 59 | + foreach ($this->content as $pb) { |
|
| 60 | 60 | $pb->showCaption($value); |
| 61 | 61 | } |
| 62 | - }else{ |
|
| 62 | + }else { |
|
| 63 | 63 | if ($value===true) |
| 64 | 64 | $this->caption="%value%%"; |
| 65 | 65 | else |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $progressBar->setStriped($this->striped!=="" || $progressBar->isStriped()); |
| 80 | 80 | $progressBar->setActive($this->active==="active" || $progressBar->isActive()); |
| 81 | 81 | if (is_array($this->content)===false) { |
| 82 | - $this->content=array (); |
|
| 82 | + $this->content=array(); |
|
| 83 | 83 | } |
| 84 | 84 | $this->content []=$progressBar; |
| 85 | 85 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | * @return \Ajax\bootstrap\html\HtmlProgressbar default : "" |
| 124 | 124 | */ |
| 125 | 125 | public function setStyle($cssStyle) { |
| 126 | - return $this->setMemberCtrl($this->style,CssRef::getStyle($cssStyle, "progress-bar"), CssRef::Styles("progress-bar")); |
|
| 126 | + return $this->setMemberCtrl($this->style, CssRef::getStyle($cssStyle, "progress-bar"), CssRef::Styles("progress-bar")); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /* |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | public function run(JsUtils $js) { |
| 44 | 44 | if ($this->getProperty("role")==="nav") { |
| 45 | - foreach ( $this->items as $dropdownItem ) { |
|
| 45 | + foreach ($this->items as $dropdownItem) { |
|
| 46 | 46 | $dropdownItem->runNav($js); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | use Phalcon\Mvc\View; |
| 17 | 17 | |
| 18 | 18 | class HtmlTabs extends HtmlDoubleElement { |
| 19 | - protected $tabs=array (); |
|
| 19 | + protected $tabs=array(); |
|
| 20 | 20 | protected $_tabsType="tabs"; |
| 21 | 21 | protected $stacked=""; |
| 22 | 22 | |
@@ -27,25 +27,25 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | protected function addTab_($tab, $index=null) { |
| 30 | - if($tab instanceof HtmlDropdown){ |
|
| 30 | + if ($tab instanceof HtmlDropdown) { |
|
| 31 | 31 | $tab->setMTagName("li"); |
| 32 | 32 | } |
| 33 | 33 | if (isset($index)) { |
| 34 | - $inserted=array ( |
|
| 34 | + $inserted=array( |
|
| 35 | 35 | $tab |
| 36 | 36 | ); |
| 37 | 37 | array_splice($this->tabs, $index, 0, $inserted); |
| 38 | - } else |
|
| 38 | + }else |
|
| 39 | 39 | $this->tabs []=$tab; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - public function setActive($index){ |
|
| 43 | - for ($i=0;$i<sizeof($this->tabs);$i++){ |
|
| 42 | + public function setActive($index) { |
|
| 43 | + for ($i=0; $i<sizeof($this->tabs); $i++) { |
|
| 44 | 44 | $this->tabs[$i]->setActive($i==$index); |
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - public function disable($index){ |
|
| 48 | + public function disable($index) { |
|
| 49 | 49 | $this->tabs[$index]->disable(); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $tab=new HtmlTabItem("tab-".$this->identifier."-".$iid); |
| 60 | 60 | $tab->fromArray($element); |
| 61 | 61 | $this->addTab_($tab, $index); |
| 62 | - } else { |
|
| 62 | + }else { |
|
| 63 | 63 | $this->addTab_($tab, $index); |
| 64 | 64 | } |
| 65 | 65 | return $tab; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | public function addTabs($tabs) { |
| 79 | - foreach ( $tabs as $tab ) { |
|
| 79 | + foreach ($tabs as $tab) { |
|
| 80 | 80 | $this->addTab($tab); |
| 81 | 81 | } |
| 82 | 82 | return $this; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function run(JsUtils $js) { |
| 108 | 108 | $this->_bsComponent=new Tabs($js); |
| 109 | - foreach ( $this->tabs as $tab ) { |
|
| 109 | + foreach ($this->tabs as $tab) { |
|
| 110 | 110 | $this->_bsComponent->addTab($tab->run($js)); |
| 111 | 111 | } |
| 112 | 112 | $this->addEventsOnRun($js); |
@@ -115,11 +115,11 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | public function createTabContents() { |
| 117 | 117 | $tabContent=new HtmlTabContent("tabcontent-".$this->identifier); |
| 118 | - foreach ( $this->tabs as $tab ) { |
|
| 118 | + foreach ($this->tabs as $tab) { |
|
| 119 | 119 | if ($tab instanceof HtmlTabItem) |
| 120 | 120 | $tabContent->addTabItem($tab->getHref()); |
| 121 | 121 | elseif ($tab instanceof HtmlDropdown) { |
| 122 | - foreach ( $tab->getItems() as $dropdownItem ) { |
|
| 122 | + foreach ($tab->getItems() as $dropdownItem) { |
|
| 123 | 123 | $tabContent->addTabItem($dropdownItem->getHref()); |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -154,21 +154,21 @@ discard block |
||
| 154 | 154 | if (sizeof($this->content->getTabItems())>0) { |
| 155 | 155 | $this->content->getTabItem(0)->addToProperty("class", "fade in"); |
| 156 | 156 | $size=sizeof($this->tabs); |
| 157 | - for($index=0; $index<$size; $index++) { |
|
| 157 | + for ($index=0; $index<$size; $index++) { |
|
| 158 | 158 | $this->content->getTabItem($index)->addToProperty("class", "fade"); |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - public function on($event, $jsCode,$stopPropagation=false,$preventDefault=false){ |
|
| 164 | - foreach ($this->tabs as $tab){ |
|
| 165 | - $tab->on($event,$jsCode,$stopPropagation,$preventDefault); |
|
| 163 | + public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
|
| 164 | + foreach ($this->tabs as $tab) { |
|
| 165 | + $tab->on($event, $jsCode, $stopPropagation, $preventDefault); |
|
| 166 | 166 | } |
| 167 | 167 | return $this; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - public function setStacked($stacked=true){ |
|
| 171 | - if($stacked) |
|
| 170 | + public function setStacked($stacked=true) { |
|
| 171 | + if ($stacked) |
|
| 172 | 172 | $this->stacked="nav-stacked"; |
| 173 | 173 | else $this->stacked=""; |
| 174 | 174 | } |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | abstract class BaseHtml extends BaseWidget { |
| 16 | 16 | protected $_template; |
| 17 | 17 | protected $tagName; |
| 18 | - protected $properties=array (); |
|
| 19 | - protected $events=array (); |
|
| 18 | + protected $properties=array(); |
|
| 19 | + protected $events=array(); |
|
| 20 | 20 | protected $wrapBefore=""; |
| 21 | 21 | protected $wrapAfter=""; |
| 22 | 22 | protected $_bsComponent; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function addToProperty($name, $value, $separator=" ") { |
| 57 | 57 | $v=$this->properties [$name]; |
| 58 | - if (isset($v)&&$v!=="") |
|
| 58 | + if (isset($v) && $v!=="") |
|
| 59 | 59 | $v=$v.$separator.$value; |
| 60 | 60 | else |
| 61 | 61 | $v=$value; |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | public function compile(JsUtils $js=NULL, View $view=NULL) { |
| 72 | 72 | $result=$this->getTemplate(); |
| 73 | - foreach ( $this as $key => $value ) { |
|
| 74 | - if (PhalconUtils::startsWith($key, "_")===false&&$key!=="events") { |
|
| 73 | + foreach ($this as $key => $value) { |
|
| 74 | + if (PhalconUtils::startsWith($key, "_")===false && $key!=="events") { |
|
| 75 | 75 | if (is_array($value)) { |
| 76 | 76 | $v=PropertyWrapper::wrap($value, $js); |
| 77 | - } else { |
|
| 77 | + }else { |
|
| 78 | 78 | $v=$value; |
| 79 | 79 | } |
| 80 | 80 | $result=str_ireplace("%".$key."%", $v, $result); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | if (isset($view)===true) { |
| 87 | 87 | $controls=$view->getVar("q"); |
| 88 | 88 | if (isset($controls)===false) { |
| 89 | - $controls=array (); |
|
| 89 | + $controls=array(); |
|
| 90 | 90 | } |
| 91 | 91 | $controls [$this->identifier]=$result; |
| 92 | 92 | $view->setVar("q", $controls); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | if (array_search($value, $typeCtrl)===false) { |
| 100 | 100 | throw new \Exception("La valeur passée a propriété `".$name."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
| 101 | 101 | } |
| 102 | - } else { |
|
| 102 | + }else { |
|
| 103 | 103 | if (!$typeCtrl($value)) { |
| 104 | 104 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$name); |
| 105 | 105 | } |
@@ -176,28 +176,28 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | public function fromArray($array) { |
| 179 | - foreach ( $this as $key => $value ) { |
|
| 179 | + foreach ($this as $key => $value) { |
|
| 180 | 180 | if (array_key_exists($key, $array) && !PhalconUtils::startsWith($key, "_")) { |
| 181 | 181 | $setter="set".ucfirst($key); |
| 182 | 182 | $this->$setter($array [$key]); |
| 183 | 183 | unset($array [$key]); |
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | - foreach ( $array as $key => $value ) { |
|
| 186 | + foreach ($array as $key => $value) { |
|
| 187 | 187 | if (method_exists($this, $key)) { |
| 188 | 188 | try { |
| 189 | 189 | $this->$key($value); |
| 190 | 190 | unset($array [$key]); |
| 191 | - } catch ( \Exception $e ) { |
|
| 191 | + } catch (\Exception $e) { |
|
| 192 | 192 | // Nothing to do |
| 193 | 193 | } |
| 194 | - } else { |
|
| 194 | + }else { |
|
| 195 | 195 | $setter="set".ucfirst($key); |
| 196 | 196 | if (method_exists($this, $setter)) { |
| 197 | 197 | try { |
| 198 | 198 | $this->$setter($value); |
| 199 | 199 | unset($array [$key]); |
| 200 | - } catch ( \Exception $e ) { |
|
| 200 | + } catch (\Exception $e) { |
|
| 201 | 201 | // Nothing to do |
| 202 | 202 | } |
| 203 | 203 | } |
@@ -206,16 +206,16 @@ discard block |
||
| 206 | 206 | return $array; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - public function fromDatabaseObjects($objects,$function) { |
|
| 210 | - if(isset($objects)){ |
|
| 211 | - foreach ($objects as $object){ |
|
| 212 | - $this->fromDatabaseObject($object,$function); |
|
| 209 | + public function fromDatabaseObjects($objects, $function) { |
|
| 210 | + if (isset($objects)) { |
|
| 211 | + foreach ($objects as $object) { |
|
| 212 | + $this->fromDatabaseObject($object, $function); |
|
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | return $this; |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - public function fromDatabaseObject($object,$function){ |
|
| 218 | + public function fromDatabaseObject($object, $function) { |
|
| 219 | 219 | |
| 220 | 220 | } |
| 221 | 221 | |
@@ -240,13 +240,13 @@ discard block |
||
| 240 | 240 | if (array_key_exists($event, $this->events)) { |
| 241 | 241 | if (is_array($this->events [$event])) { |
| 242 | 242 | $this->events [$event] []=$jsCode; |
| 243 | - } else { |
|
| 244 | - $this->events [$event]=array ( |
|
| 243 | + }else { |
|
| 244 | + $this->events [$event]=array( |
|
| 245 | 245 | $this->events [$event], |
| 246 | 246 | $jsCode |
| 247 | 247 | ); |
| 248 | 248 | } |
| 249 | - } else { |
|
| 249 | + }else { |
|
| 250 | 250 | $this->events [$event]=$jsCode; |
| 251 | 251 | } |
| 252 | 252 | } |
@@ -265,14 +265,14 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | public function addEventsOnRun(JsUtils $js) { |
| 267 | 267 | if (isset($this->_bsComponent)) { |
| 268 | - foreach ( $this->events as $event => $jsCode ) { |
|
| 268 | + foreach ($this->events as $event => $jsCode) { |
|
| 269 | 269 | $code=$jsCode; |
| 270 | 270 | if (is_array($jsCode)) { |
| 271 | 271 | $code=""; |
| 272 | - foreach ( $jsCode as $jsC ) { |
|
| 272 | + foreach ($jsCode as $jsC) { |
|
| 273 | 273 | if ($jsC instanceof AjaxCall) { |
| 274 | 274 | $code.="\n".$jsC->compile($js); |
| 275 | - } else { |
|
| 275 | + }else { |
|
| 276 | 276 | $code.="\n".$jsC; |
| 277 | 277 | } |
| 278 | 278 | } |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
| 289 | - $params=array ( |
|
| 289 | + $params=array( |
|
| 290 | 290 | "url" => $url, |
| 291 | 291 | "responseElement" => $responseElement |
| 292 | 292 | ); |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | if (is_array($elements)) { |
| 326 | 326 | $flag=false; |
| 327 | 327 | $index=0; |
| 328 | - while ( !$flag&&$index<sizeof($elements) ) { |
|
| 328 | + while (!$flag && $index<sizeof($elements)) { |
|
| 329 | 329 | if ($elements [$index] instanceof BaseHtml) |
| 330 | 330 | $flag=($elements [$index]->getIdentifier()===$identifier); |
| 331 | 331 | $index++; |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | return null; |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | - public function __toString(){ |
|
| 342 | + public function __toString() { |
|
| 343 | 343 | return $this->compile(); |
| 344 | 344 | } |
| 345 | 345 | |
@@ -355,25 +355,25 @@ discard block |
||
| 355 | 355 | if (is_array($value)) { |
| 356 | 356 | $value=implode(",", $value); |
| 357 | 357 | } |
| 358 | - if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false) { |
|
| 358 | + if (strrpos($value, 'this')===false && strrpos($value, 'event')===false) { |
|
| 359 | 359 | $value='"'.$value.'"'; |
| 360 | 360 | } |
| 361 | 361 | return $value; |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | - public function jsDoJquery($jqueryCall, $param=""){ |
|
| 364 | + public function jsDoJquery($jqueryCall, $param="") { |
|
| 365 | 365 | return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");"; |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | - public function jsHtml($content=""){ |
|
| 369 | - return $this->jsDoJquery("html",$content); |
|
| 368 | + public function jsHtml($content="") { |
|
| 369 | + return $this->jsDoJquery("html", $content); |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | - public function jsShow(){ |
|
| 372 | + public function jsShow() { |
|
| 373 | 373 | return $this->jsDoJquery("show"); |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | - public function jsHide(){ |
|
| 376 | + public function jsHide() { |
|
| 377 | 377 | return $this->jsDoJquery("hide"); |
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 | \ No newline at end of file |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | const CSS_DEFAULT="-default", CSS_PRIMARY="-primary", CSS_SUCCESS="-success", CSS_INFO="-info", CSS_WARNING="-warning", CSS_DANGER="-danger", CSS_LINK="-link"; |
| 15 | 15 | |
| 16 | 16 | public static function buttonStyles() { |
| 17 | - return array ( |
|
| 17 | + return array( |
|
| 18 | 18 | "btn-default", |
| 19 | 19 | "btn-primary", |
| 20 | 20 | "btn-success", |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public static function Styles($prefix="btn") { |
| 29 | - return array ( |
|
| 29 | + return array( |
|
| 30 | 30 | $prefix."-default", |
| 31 | 31 | $prefix."-primary", |
| 32 | 32 | $prefix."-success", |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public static function sizes($prefix="btn") { |
| 40 | - return array ( |
|
| 40 | + return array( |
|
| 41 | 41 | $prefix."-lg", |
| 42 | 42 | "", |
| 43 | 43 | $prefix."-sm", |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | public static function position() { |
| 49 | - return array ( |
|
| 49 | + return array( |
|
| 50 | 50 | "top", |
| 51 | 51 | "left", |
| 52 | 52 | "right", |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | public static function alignment($prefix="") { |
| 59 | - return array ( |
|
| 59 | + return array( |
|
| 60 | 60 | $prefix."", |
| 61 | 61 | $prefix."left", |
| 62 | 62 | $prefix."right", |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | public static function navbarZoneClasses() { |
| 69 | - return array ( |
|
| 69 | + return array( |
|
| 70 | 70 | "navbar-nav", |
| 71 | 71 | "navbar-left", |
| 72 | 72 | "navbar-right", |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | public static function glyphIcons() { |
| 78 | - return array ( |
|
| 78 | + return array( |
|
| 79 | 79 | "glyphicon-asterisk", |
| 80 | 80 | "glyphicon-plus", |
| 81 | 81 | "glyphicon-euro", |
@@ -347,9 +347,9 @@ discard block |
||
| 347 | 347 | public static function getStyle($cssStyle, $prefix) { |
| 348 | 348 | if (is_int($cssStyle)) { |
| 349 | 349 | $styles=CssRef::Styles($prefix); |
| 350 | - if ($cssStyle<sizeof($styles)&&$cssStyle>=0) { |
|
| 350 | + if ($cssStyle<sizeof($styles) && $cssStyle>=0) { |
|
| 351 | 351 | return CssRef::styles($prefix)[$cssStyle]; |
| 352 | - } else { |
|
| 352 | + }else { |
|
| 353 | 353 | throw new \Exception("La valeur passée a propriété `Style` ne fait pas partie des valeurs possibles : index '".$cssStyle."' inexistant"); |
| 354 | 354 | } |
| 355 | 355 | } |
@@ -33,12 +33,12 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function addContent($content) { |
| 35 | 35 | if (is_array($this->content)===false) { |
| 36 | - $newContent=array (); |
|
| 36 | + $newContent=array(); |
|
| 37 | 37 | if (isset($this->content)) |
| 38 | 38 | $newContent []=$this->content; |
| 39 | 39 | $newContent []=$content; |
| 40 | 40 | $this->content=$newContent; |
| 41 | - } else { |
|
| 41 | + }else { |
|
| 42 | 42 | $this->content []=$content; |
| 43 | 43 | } |
| 44 | 44 | return $this; |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | parent::run($js); |
| 53 | 53 | if ($this->content instanceof HtmlDoubleElement) { |
| 54 | 54 | $this->content->run($js); |
| 55 | - } else if (is_array($this->content)) { |
|
| 56 | - foreach ( $this->content as $itemContent ) { |
|
| 55 | + }else if (is_array($this->content)) { |
|
| 56 | + foreach ($this->content as $itemContent) { |
|
| 57 | 57 | if ($itemContent instanceof HtmlDoubleElement) { |
| 58 | 58 | $itemContent->run($js); |
| 59 | 59 | } |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | return $this; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - public function wrapContentWithGlyph($glyphBefore,$glyphAfter=""){ |
|
| 85 | + public function wrapContentWithGlyph($glyphBefore, $glyphAfter="") { |
|
| 86 | 86 | $before=HtmlGlyphicon::getGlyphicon($glyphBefore)." "; |
| 87 | 87 | $after=""; |
| 88 | - if($glyphAfter!==""){ |
|
| 88 | + if ($glyphAfter!=="") { |
|
| 89 | 89 | $after="énbsp;".HtmlGlyphicon::getGlyphicon($glyphAfter); |
| 90 | 90 | } |
| 91 | - return $this->wrapContent($before,$after); |
|
| 91 | + return $this->wrapContent($before, $after); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | \ No newline at end of file |
@@ -26,11 +26,11 @@ |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public function addBadge($caption, $leftSeparator=" ") { |
| 29 | - return $this->element->addBadge($caption,$leftSeparator); |
|
| 29 | + return $this->element->addBadge($caption, $leftSeparator); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function addLabel($caption, $style="label-default", $leftSeparator=" ") { |
| 33 | - return $this->element->addLabel($caption,$style,$leftSeparator); |
|
| 33 | + return $this->element->addLabel($caption, $style, $leftSeparator); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | public function run(JsUtils $js) { |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function fromArray($array) { |
| 36 | 36 | $array=parent::fromArray($array); |
| 37 | - foreach ( $array as $key => $value ) { |
|
| 37 | + foreach ($array as $key => $value) { |
|
| 38 | 38 | $this->setProperty($key, $value); |
| 39 | 39 | } |
| 40 | 40 | return $array; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $value1=reset($input); |
| 18 | 18 | if (is_object($value1)) { |
| 19 | 19 | $output=PropertyWrapper::wrapObjects($input, $js, $separator=' '); |
| 20 | - } else |
|
| 20 | + }else |
|
| 21 | 21 | $output=PropertyWrapper::wrapStrings($input, $separator=' ', $valueQuote='"'); |
| 22 | 22 | } |
| 23 | 23 | } |
@@ -26,17 +26,17 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public static function wrapStrings($input, $separator=' ', $valueQuote='"') { |
| 28 | 28 | if (JArray::isAssociative($input)===true) { |
| 29 | - $result=implode($separator, array_map(function ($v, $k) use($valueQuote) { |
|
| 29 | + $result=implode($separator, array_map(function($v, $k) use($valueQuote) { |
|
| 30 | 30 | return $k.'='.$valueQuote.$v.$valueQuote; |
| 31 | 31 | }, $input, array_keys($input))); |
| 32 | - } else { |
|
| 32 | + }else { |
|
| 33 | 33 | $result=implode($separator, array_values($input)); |
| 34 | 34 | } |
| 35 | 35 | return $result; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public static function wrapObjects($input, $js=NULL, $separator=' ') { |
| 39 | - return implode($separator, array_map(function ($v) use($js) { |
|
| 39 | + return implode($separator, array_map(function($v) use($js) { |
|
| 40 | 40 | return $v->compile($js); |
| 41 | 41 | }, $input)); |
| 42 | 42 | } |