@@ -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 | } |
@@ -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 | } |
@@ -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) { |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | $glyph->setGlyphicon($glyphicon); |
| 150 | 150 | if ($left) { |
| 151 | 151 | $this->content=$glyph->compile().$separator.$this->content; |
| 152 | - } else { |
|
| 152 | + }else { |
|
| 153 | 153 | $this->content.=$separator.$glyph->compile(); |
| 154 | 154 | } |
| 155 | 155 | return $this; |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | $element=new HtmlDoubleElement("", "p"); |
| 72 | 72 | $element->setContent($content); |
| 73 | 73 | $element->setClass("list-group-item-text"); |
| 74 | - $this->element->setContent(array ( |
|
| 74 | + $this->element->setContent(array( |
|
| 75 | 75 | $elementHeader, |
| 76 | 76 | $element |
| 77 | 77 | )); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | parent::__construct($identifier); |
| 28 | 28 | $this->tagName="ul"; |
| 29 | 29 | $this->_template='<%tagName% class="nav navbar-nav %class%">%elements%</%tagName%>'; |
| 30 | - $this->elements=array (); |
|
| 30 | + $this->elements=array(); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public function setClass($value) { |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public function addElement($element) { |
| 38 | - if($element instanceof HtmlLink){ |
|
| 38 | + if ($element instanceof HtmlLink) { |
|
| 39 | 39 | $this->addLink($element); |
| 40 | - } else if (is_object($element)) { |
|
| 40 | + }else if (is_object($element)) { |
|
| 41 | 41 | $this->elements []=$element; |
| 42 | - } else if (is_array($element)) { |
|
| 42 | + }else if (is_array($element)) { |
|
| 43 | 43 | $this->addLink(array_pop($element), array_pop($element)); |
| 44 | - } else { |
|
| 44 | + }else { |
|
| 45 | 45 | $this->addLink($element); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function addElements($elements) { |
| 57 | 57 | if (is_array($elements)) { |
| 58 | - foreach ( $elements as $key => $element ) { |
|
| 58 | + foreach ($elements as $key => $element) { |
|
| 59 | 59 | $iid=$this->getElementsCount()+1; |
| 60 | 60 | if ($element instanceof HtmlDropdownItem) |
| 61 | 61 | $this->elements []=$element; |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | $dropdown->setBtnCaption($key); |
| 67 | 67 | $dropdown->setMTagName("li"); |
| 68 | 68 | $this->addElement($dropdown); |
| 69 | - } else { |
|
| 69 | + }else { |
|
| 70 | 70 | $this->addLink(array_pop($element), array_pop($element)); |
| 71 | 71 | } |
| 72 | - } else if (is_object($element)) { |
|
| 72 | + }else if (is_object($element)) { |
|
| 73 | 73 | $this->addElement($element); |
| 74 | - } else if (is_string($element)) { |
|
| 74 | + }else if (is_string($element)) { |
|
| 75 | 75 | $this->addLink($element); |
| 76 | 76 | } |
| 77 | 77 | // TODO A vérifier |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | public function addLink($caption, $href="#") { |
| 84 | 84 | $iid=$this->getElementsCount()+1; |
| 85 | 85 | $li=new HtmlDoubleElement($this->identifier."-li-".$iid, "li"); |
| 86 | - if($caption instanceof HtmlLink){ |
|
| 86 | + if ($caption instanceof HtmlLink) { |
|
| 87 | 87 | $link=$caption; |
| 88 | - }else{ |
|
| 88 | + }else { |
|
| 89 | 89 | $link=new HtmlLink($this->identifier."-link-".$iid, $href, $caption); |
| 90 | 90 | } |
| 91 | 91 | $li->setContent($link); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | public function run(JsUtils $js) { |
| 116 | - foreach ( $this->elements as $element ) { |
|
| 116 | + foreach ($this->elements as $element) { |
|
| 117 | 117 | $element->run($js); |
| 118 | 118 | } |
| 119 | 119 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @param int $index |
| 135 | 135 | * @return BaseHtml |
| 136 | 136 | */ |
| 137 | - public function getElement($index){ |
|
| 137 | + public function getElement($index) { |
|
| 138 | 138 | return $this->elements[$index]; |
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | \ No newline at end of file |
@@ -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 |