@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function __construct($identifier, $tagName="div") { |
| 15 | 15 | parent::__construct($identifier, $tagName); |
| 16 | 16 | $this->setProperty("class", "tab-content"); |
| 17 | - $this->content=array (); // HtmlTabContentItem |
|
| 17 | + $this->content=array(); // HtmlTabContentItem |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function addTabItem($identifier) { |
@@ -62,15 +62,15 @@ |
||
| 62 | 62 | */ |
| 63 | 63 | public function setIdentifier($identifier) { |
| 64 | 64 | parent::setIdentifier($identifier); |
| 65 | - if($this->content instanceof HtmlLink){ |
|
| 65 | + if ($this->content instanceof HtmlLink) { |
|
| 66 | 66 | $this->content->setIdentifier("link-".$identifier); |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | - public function setActive($value=true){ |
|
| 70 | - $this->setProperty("class", ($value)?"active":""); |
|
| 69 | + public function setActive($value=true) { |
|
| 70 | + $this->setProperty("class", ($value) ? "active" : ""); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - public function disable(){ |
|
| 73 | + public function disable() { |
|
| 74 | 74 | $this->setProperty("class", "disabled"); |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | class HtmlOption extends HtmlDoubleElement { |
| 11 | 11 | protected $value; |
| 12 | 12 | protected $selected; |
| 13 | - public function __construct($identifier,$caption,$value="") { |
|
| 13 | + public function __construct($identifier, $caption, $value="") { |
|
| 14 | 14 | parent::__construct($identifier, "option"); |
| 15 | 15 | $this->_template='<option id="%identifier%" value="%value%" %selected% %properties%>%content%</option>'; |
| 16 | 16 | $this->content=$caption; |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $this->selected=""; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function select(){ |
|
| 21 | + public function select() { |
|
| 22 | 22 | $this->selected="selected"; |
| 23 | 23 | return $this; |
| 24 | 24 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | return $this->value; |
| 28 | 28 | } |
| 29 | 29 | public function setValue($value) { |
| 30 | - $this->value = $value; |
|
| 30 | + $this->value=$value; |
|
| 31 | 31 | return $this; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | public function compile(JsUtils $js=NULL, View $view=NULL) { |
| 31 | 31 | $result=""; |
| 32 | - foreach ( $this->_elements as $element ) { |
|
| 32 | + foreach ($this->_elements as $element) { |
|
| 33 | 33 | if ($element instanceof PhBsElement) |
| 34 | 34 | $result.=$element->compile($js, $view); |
| 35 | 35 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function run(JsUtils $js) { |
| 40 | - foreach ( $this->_elements as $element ) { |
|
| 40 | + foreach ($this->_elements as $element) { |
|
| 41 | 41 | if ($element instanceof PhBsElement) |
| 42 | 42 | $element->run($js); |
| 43 | 43 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | public function render($attributes=null) { |
| 53 | 53 | $attrs=$this->element->getAttributes(); |
| 54 | - foreach ( $attrs as $key => $value ) { |
|
| 54 | + foreach ($attrs as $key => $value) { |
|
| 55 | 55 | $this->htmlElement->setProperty($key, $value); |
| 56 | 56 | } |
| 57 | 57 | if (isset($attributes)) |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | parent::__construct($name, $attributes); |
| 14 | 14 | $list=new HtmlSelect($name); |
| 15 | 15 | $list->setTagName("select"); |
| 16 | - $this->renderer=new PhBsRenderer(new Select($name, array (), $attributes), $list); |
|
| 16 | + $this->renderer=new PhBsRenderer(new Select($name, array(), $attributes), $list); |
|
| 17 | 17 | $this->setOptions($options); |
| 18 | 18 | } |
| 19 | 19 | |
@@ -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 | * |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | if (is_array($typeCtrl)) { |
| 60 | 60 | if (array_search($value, $typeCtrl)===false) |
| 61 | 61 | throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
| 62 | - } else { |
|
| 62 | + }else { |
|
| 63 | 63 | if (!$typeCtrl($value)) { |
| 64 | 64 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key); |
| 65 | 65 | } |
@@ -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); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | public static function getConstants() { |
| 15 | 15 | if (self::$constCacheArray==NULL) { |
| 16 | - self::$constCacheArray=[ ]; |
|
| 16 | + self::$constCacheArray=[]; |
|
| 17 | 17 | } |
| 18 | 18 | $calledClass=get_called_class(); |
| 19 | 19 | if (!array_key_exists($calledClass, self::$constCacheArray)) { |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function __construct($autoCompile=true) { |
| 29 | 29 | $this->autoCompile=$autoCompile; |
| 30 | - $this->components=array (); |
|
| 31 | - $this->htmlComponents=array (); |
|
| 30 | + $this->components=array(); |
|
| 31 | + $this->htmlComponents=array(); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function isAutoCompile() { |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function compile($internal=false) { |
| 44 | - if ($internal===false&&$this->autoCompile===true) |
|
| 44 | + if ($internal===false && $this->autoCompile===true) |
|
| 45 | 45 | throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
| 46 | - foreach ( $this->components as $component ) { |
|
| 46 | + foreach ($this->components as $component) { |
|
| 47 | 47 | $component->compile(); |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | public function compileHtml(JsUtils $js=NULL, View $view=NULL) { |
| 73 | - foreach ( $this->htmlComponents as $htmlComponent ) { |
|
| 73 | + foreach ($this->htmlComponents as $htmlComponent) { |
|
| 74 | 74 | $htmlComponent->compile($js, $view); |
| 75 | 75 | } |
| 76 | 76 | } |