Skip to content

Commit 243a1c8

Browse files
committed
Update HtmlSemNavElement.php
1 parent 8f72032 commit 243a1c8

File tree

1 file changed

+32
-26
lines changed

1 file changed

+32
-26
lines changed

Ajax/semantic/html/base/HtmlSemNavElement.php

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,76 +3,82 @@
33

44
use Ajax\service\JArray;
55
use Ajax\common\html\traits\NavElementTrait;
6-
use Ajax\bootstrap\html\base\HtmlNavElement;
6+
77
/**
88
* Sem class for navigation elements : Breadcrumbs and Pagination
9+
*
910
* @author jc
1011
* @version 1.001
1112
*/
1213
abstract class HtmlSemNavElement extends HtmlSemCollection {
1314
use NavElementTrait;
15+
1416
/**
17+
*
1518
* @var string the root site
1619
*/
1720
protected $root;
1821

1922
/**
23+
*
2024
* @var String the html attribute which contains the elements url. default : data-ajax
2125
*/
2226
protected $attr;
2327

2428
/**
29+
*
2530
* @var string|array
2631
*/
27-
protected $_contentSeparator="";
28-
32+
protected $_contentSeparator = "";
2933

30-
public function __construct($identifier,$tagName,$baseClass){
31-
parent::__construct($identifier,$tagName,$baseClass);
32-
$this->root="";
33-
$this->attr="data-ajax";
34+
public function __construct($identifier, $tagName, $baseClass) {
35+
parent::__construct($identifier, $tagName, $baseClass);
36+
$this->root = "";
37+
$this->attr = "data-ajax";
3438
}
3539

3640
/**
3741
* Associate an ajax get to the elements, displayed in $targetSelector
38-
* @param string $targetSelector the target of the get
42+
*
43+
* @param string $targetSelector
44+
* the target of the get
3945
* @return HtmlSemNavElement
4046
*/
41-
public function autoGetOnClick($targetSelector){
42-
return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
47+
public function autoGetOnClick($targetSelector) {
48+
return $this->getOnClick($this->root, $targetSelector, array(
49+
"attr" => $this->attr
50+
));
4351
}
4452

45-
public function contentAsString(){
53+
public function contentAsString() {
4654
return JArray::implode($this->_contentSeparator, $this->content);
4755
}
4856

49-
public function setContentDivider($divider,$index=NULL) {
50-
$divider="<div class='divider'> {$divider} </div>";
57+
public function setContentDivider($divider, $index = NULL) {
58+
$divider = "<div class='divider'> {$divider} </div>";
5159
return $this->setDivider($divider, $index);
5260
}
5361

54-
public function setIconContentDivider($iconContentDivider,$index=NULL) {
55-
$contentDivider="<i class='".$iconContentDivider." icon divider'></i>";
62+
public function setIconContentDivider($iconContentDivider, $index = NULL) {
63+
$contentDivider = "<i class='" . $iconContentDivider . " icon divider'></i>";
5664
return $this->setDivider($contentDivider, $index);
5765
}
5866

59-
protected function setDivider($divider,$index){
60-
if(isset($index)){
61-
if(!\is_array($this->_contentSeparator))
62-
$this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator);
63-
$this->_contentSeparator[$index]=$divider;
64-
}else{
65-
$this->_contentSeparator=$divider;
67+
protected function setDivider($divider, $index) {
68+
if (isset($index)) {
69+
if (! \is_array($this->_contentSeparator))
70+
$this->_contentSeparator = array_fill(0, $this->count() - 1, $this->_contentSeparator);
71+
$this->_contentSeparator[$index] = $divider;
72+
} else {
73+
$this->_contentSeparator = $divider;
6674
}
6775
return $this;
6876
}
6977

70-
protected function getContentDivider($index){
71-
if(\is_array($this->_contentSeparator)){
78+
protected function getContentDivider($index) {
79+
if (\is_array($this->_contentSeparator)) {
7280
return @$this->_contentSeparator[$index];
7381
}
7482
return $this->_contentSeparator;
7583
}
76-
77-
7884
}

0 commit comments

Comments
 (0)