@@ -3,11 +3,11 @@ |
||
| 3 | 3 | namespace Ajax\common\html\html5; |
| 4 | 4 | |
| 5 | 5 | class HtmlUtils { |
| 6 | - public static function javascriptInclude($url){ |
|
| 6 | + public static function javascriptInclude($url) { |
|
| 7 | 7 | return '<script src="'.$url.'"></script>'; |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | - public static function stylesheetInclude($url){ |
|
| 10 | + public static function stylesheetInclude($url) { |
|
| 11 | 11 | return '<link rel="stylesheet" type="text/css" href="'.$url.'">'; |
| 12 | 12 | } |
| 13 | 13 | } |
@@ -8,12 +8,12 @@ discard block |
||
| 8 | 8 | * @author jc |
| 9 | 9 | * @property BaseWidget $_self |
| 10 | 10 | */ |
| 11 | -trait BaseHtmlPropertiesTrait{ |
|
| 11 | +trait BaseHtmlPropertiesTrait { |
|
| 12 | 12 | |
| 13 | - protected $properties=array (); |
|
| 13 | + protected $properties=array(); |
|
| 14 | 14 | abstract protected function ctrl($name, $value, $typeCtrl); |
| 15 | 15 | abstract protected function removeOldValues(&$oldValue, $allValues); |
| 16 | - abstract protected function _getElementBy($callback,$elements); |
|
| 16 | + abstract protected function _getElementBy($callback, $elements); |
|
| 17 | 17 | public function getProperties() { |
| 18 | 18 | return $this->_self->properties; |
| 19 | 19 | } |
@@ -45,14 +45,14 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function addToProperty($name, $value, $separator=" ") { |
| 47 | 47 | if (\is_array($value)) { |
| 48 | - foreach ( $value as $v ) { |
|
| 48 | + foreach ($value as $v) { |
|
| 49 | 49 | $this->_self->addToProperty($name, $v, $separator); |
| 50 | 50 | } |
| 51 | - } else if ($value !== "" && $this->_self->propertyContains($name, $value) === false) { |
|
| 52 | - if(isset($this->_self->properties[$name])){ |
|
| 51 | + } else if ($value!=="" && $this->_self->propertyContains($name, $value)===false) { |
|
| 52 | + if (isset($this->_self->properties[$name])) { |
|
| 53 | 53 | $v=$this->_self->properties[$name]; |
| 54 | - if (isset($v) && $v !== "") |
|
| 55 | - $v=$v . $separator . $value; |
|
| 54 | + if (isset($v) && $v!=="") |
|
| 55 | + $v=$v.$separator.$value; |
|
| 56 | 56 | else |
| 57 | 57 | $v=$value; |
| 58 | 58 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | public function addToPropertyCtrlCheck($name, $value, $typeCtrl) { |
| 94 | - if ($this->_self->ctrl($name, $value, $typeCtrl) === true) { |
|
| 94 | + if ($this->_self->ctrl($name, $value, $typeCtrl)===true) { |
|
| 95 | 95 | return $this->_self->addToProperty($name, $value); |
| 96 | 96 | } |
| 97 | 97 | return $this; |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
| 115 | - if ($this->_self->ctrl($name, $value, $typeCtrl) === true) |
|
| 115 | + if ($this->_self->ctrl($name, $value, $typeCtrl)===true) |
|
| 116 | 116 | return $this->_self->setProperty($name, $value); |
| 117 | 117 | return $this; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - protected function getElementByPropertyValue($propertyName,$value, $elements) { |
|
| 121 | - return $this->_self->_getElementBy(function(BaseHtml $element) use ($propertyName,$value){return $element->propertyContains($propertyName, $value) === true;}, $elements); |
|
| 120 | + protected function getElementByPropertyValue($propertyName, $value, $elements) { |
|
| 121 | + return $this->_self->_getElementBy(function(BaseHtml $element) use ($propertyName, $value){return $element->propertyContains($propertyName, $value)===true; }, $elements); |
|
| 122 | 122 | } |
| 123 | 123 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function __construct($identifier, $brand="Brand", $brandHref="#") { |
| 33 | 33 | parent::__construct($identifier); |
| 34 | 34 | $this->_template=include 'templates/tplNavbar.php'; |
| 35 | - $this->navZones=array (); |
|
| 35 | + $this->navZones=array(); |
|
| 36 | 36 | $this->class="navbar-default"; |
| 37 | 37 | $this->brand=$brand; |
| 38 | 38 | $this->brandHref=$brandHref; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | public function setBrandImage($imageSrc) { |
| 63 | - $this->brandImage=new HtmlImg("brand-img-".$this->_identifier,$imageSrc,$this->brand); |
|
| 63 | + $this->brandImage=new HtmlImg("brand-img-".$this->_identifier, $imageSrc, $this->brand); |
|
| 64 | 64 | $this->brand=""; |
| 65 | 65 | return $this; |
| 66 | 66 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | public function setNavZones($navZones) { |
| 106 | 106 | if (\is_array($navZones)) { |
| 107 | - foreach ( $navZones as $zoneType => $zoneArray ) { |
|
| 107 | + foreach ($navZones as $zoneType => $zoneArray) { |
|
| 108 | 108 | if (is_string($zoneType)) { |
| 109 | 109 | $zone=$this->addZone($zoneType); |
| 110 | 110 | $zone->fromArray($zoneArray); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | if ($index<$nb) |
| 145 | 145 | $zone=$this->navZones [$index]; |
| 146 | 146 | } else { |
| 147 | - for($i=0; $i<$nb; $i++) { |
|
| 147 | + for ($i=0; $i<$nb; $i++) { |
|
| 148 | 148 | if ($this->navZones [$i]->getIdentifier()===$index) { |
| 149 | 149 | $zone=$this->navZones [$i]; |
| 150 | 150 | break; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | public function run(JsUtils $js) { |
| 158 | - foreach ( $this->navZones as $zone ) { |
|
| 158 | + foreach ($this->navZones as $zone) { |
|
| 159 | 159 | $zone->run($js); |
| 160 | 160 | } |
| 161 | 161 | if ($this->hasScrollspy) { |
@@ -177,9 +177,9 @@ discard block |
||
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | public function setFluid($fluid) { |
| 180 | - if($fluid===true){ |
|
| 180 | + if ($fluid===true) { |
|
| 181 | 181 | $this->fluid="container-fluid"; |
| 182 | - }else{ |
|
| 182 | + } else { |
|
| 183 | 183 | $this->fluid="container"; |
| 184 | 184 | } |
| 185 | 185 | return $this; |