@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->startIndex=$startIndex; |
| 52 | 52 | $this->autoActive=$autoActive; |
| 53 | 53 | $this->_contentSeparator="<div class='divider'> / </div>"; |
| 54 | - $this->_hrefFunction=function ($e) { |
|
| 54 | + $this->_hrefFunction=function($e) { |
|
| 55 | 55 | return $e->getContent(); |
| 56 | 56 | }; |
| 57 | 57 | if (isset($hrefFunction)) { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @return HtmlBreadcrumbs |
| 69 | 69 | */ |
| 70 | 70 | public function autoGetOnClick($targetSelector) { |
| 71 | - return $this->getOnClick($this->root, $targetSelector, array ("attr" => $this->attr )); |
|
| 71 | + return $this->getOnClick($this->root, $targetSelector, array("attr" => $this->attr)); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public function contentAsString() { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | public function setActive($index=null) { |
| 82 | 82 | if (!isset($index)) { |
| 83 | - $index=sizeof($this->content) - 1; |
|
| 83 | + $index=sizeof($this->content)-1; |
|
| 84 | 84 | } |
| 85 | 85 | $activeItem=$this->content[$index]; |
| 86 | 86 | $activeItem->addToProperty("class", "active"); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @param Dispatcher $dispatcher the request dispatcher |
| 94 | 94 | * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
| 95 | 95 | */ |
| 96 | - public function fromDispatcher(JsUtils $js,$dispatcher, $startIndex=0) { |
|
| 96 | + public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0) { |
|
| 97 | 97 | return $this->addItems($js->fromDispatcher($dispatcher)); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | if (!isset($index)) { |
| 108 | 108 | $index=sizeof($this->content); |
| 109 | 109 | } |
| 110 | - if ($this->absolutePaths === true) { |
|
| 110 | + if ($this->absolutePaths===true) { |
|
| 111 | 111 | return $this->_hrefFunction($this->content[$index]); |
| 112 | 112 | } else { |
| 113 | - return $this->root . implode($separator, array_slice(array_map(function ($e) { |
|
| 113 | + return $this->root.implode($separator, array_slice(array_map(function($e) { |
|
| 114 | 114 | return $this->_hrefFunction($e); |
| 115 | - }, $this->content), $this->startIndex, $index + 1)); |
|
| 115 | + }, $this->content), $this->startIndex, $index+1)); |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
@@ -146,8 +146,8 @@ discard block |
||
| 146 | 146 | $this->setActive(); |
| 147 | 147 | } |
| 148 | 148 | $count=$this->count(); |
| 149 | - for($i=1; $i < $count; $i++) { |
|
| 150 | - $this->content[$i]->wrap($this->getContentDivider($i - 1)); |
|
| 149 | + for ($i=1; $i<$count; $i++) { |
|
| 150 | + $this->content[$i]->wrap($this->getContentDivider($i-1)); |
|
| 151 | 151 | } |
| 152 | 152 | return parent::compile($js, $view); |
| 153 | 153 | } |
@@ -157,15 +157,15 @@ discard block |
||
| 157 | 157 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
| 158 | 158 | */ |
| 159 | 159 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
| 160 | - foreach ( $this->content as $element ) { |
|
| 160 | + foreach ($this->content as $element) { |
|
| 161 | 161 | $element->on($event, $jsCode, $stopPropagation, $preventDefault); |
| 162 | 162 | } |
| 163 | 163 | return $this; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
| 167 | - foreach ( $this->content as $element ) { |
|
| 168 | - if ($element->getProperty($this->attr) != NULL){ |
|
| 167 | + foreach ($this->content as $element) { |
|
| 168 | + if ($element->getProperty($this->attr)!=NULL) { |
|
| 169 | 169 | $element->_ajaxOn($operation, $event, $url, $responseElement, $parameters); |
| 170 | 170 | } |
| 171 | 171 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | protected function createItem($value) { |
| 182 | 182 | $count=$this->count(); |
| 183 | - $itemO=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "a", "section"); |
|
| 183 | + $itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "a", "section"); |
|
| 184 | 184 | if (\is_array($value)) |
| 185 | 185 | $itemO->fromArray($value); |
| 186 | 186 | else { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | public function addIconAt($icon, $index) { |
| 193 | 193 | $item=$this->getItem($index); |
| 194 | 194 | if (isset($item)) { |
| 195 | - $icon=new HtmlIcon("icon-" . $this->identifier, $icon); |
|
| 195 | + $icon=new HtmlIcon("icon-".$this->identifier, $icon); |
|
| 196 | 196 | $item->wrapContent($icon); |
| 197 | 197 | } |
| 198 | 198 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | public function addItem($item) { |
| 201 | 201 | $count=$this->count(); |
| 202 | 202 | $itemO=parent::addItem($item); |
| 203 | - $this->addToPropertyCtrl("class", "section", array ("section" )); |
|
| 203 | + $this->addToPropertyCtrl("class", "section", array("section")); |
|
| 204 | 204 | $itemO->setProperty($this->attr, $this->getHref($count)); |
| 205 | 205 | return $itemO; |
| 206 | 206 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | public function setAbsolutePaths($absolutePaths) { |
| 217 | 217 | $this->absolutePaths=$absolutePaths; |
| 218 | - for($i=0;$i<\sizeof($this->content);$i++){ |
|
| 218 | + for ($i=0; $i<\sizeof($this->content); $i++) { |
|
| 219 | 219 | $this->content[$i]->setProperty($this->attr, $this->getHref($i)); |
| 220 | 220 | } |
| 221 | 221 | return $this; |