@@ -9,15 +9,15 @@ discard block |
||
| 9 | 9 | protected $image; |
| 10 | 10 | |
| 11 | 11 | public function __construct($identifier, $content=NULL) { |
| 12 | - parent::__construct($identifier,"item",$content); |
|
| 12 | + parent::__construct($identifier, "item", $content); |
|
| 13 | 13 | } |
| 14 | - protected function initContent($content){ |
|
| 15 | - if(\is_array($content)){ |
|
| 16 | - if(JArray::isAssociative($content)===false){ |
|
| 14 | + protected function initContent($content) { |
|
| 15 | + if (\is_array($content)) { |
|
| 16 | + if (JArray::isAssociative($content)===false) { |
|
| 17 | 17 | $icon=@$content[0]; |
| 18 | 18 | $title=@$content[1]; |
| 19 | 19 | $desc=@$content[2]; |
| 20 | - }else{ |
|
| 20 | + } else { |
|
| 21 | 21 | $icon=@$content["icon"]; |
| 22 | 22 | $image=@$content["image"]; |
| 23 | 23 | $title=@$content["title"]; |
@@ -25,38 +25,38 @@ discard block |
||
| 25 | 25 | $desc=@$content["description"]; |
| 26 | 26 | $items=@$content["items"]; |
| 27 | 27 | } |
| 28 | - if(isset($icon)){ |
|
| 28 | + if (isset($icon)) { |
|
| 29 | 29 | $this->setIcon($icon); |
| 30 | 30 | } |
| 31 | - if(isset($image)){ |
|
| 31 | + if (isset($image)) { |
|
| 32 | 32 | $this->setImage($image); |
| 33 | 33 | } |
| 34 | - if(isset($title)){ |
|
| 35 | - $this->setTitle($title,$desc); |
|
| 36 | - }elseif (isset($header)){ |
|
| 37 | - $this->setTitle($header,$desc,"header"); |
|
| 34 | + if (isset($title)) { |
|
| 35 | + $this->setTitle($title, $desc); |
|
| 36 | + }elseif (isset($header)) { |
|
| 37 | + $this->setTitle($header, $desc, "header"); |
|
| 38 | 38 | } |
| 39 | - if(isset($items)){ |
|
| 39 | + if (isset($items)) { |
|
| 40 | 40 | $this->addList($items); |
| 41 | 41 | } |
| 42 | - }else{ |
|
| 42 | + } else { |
|
| 43 | 43 | $this->setContent($content); |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | - public function addList($items=array(),$ordered=false) { |
|
| 46 | + public function addList($items=array(), $ordered=false) { |
|
| 47 | 47 | $list=new HtmlList("", $items); |
| 48 | - if($ordered) |
|
| 48 | + if ($ordered) |
|
| 49 | 49 | $list->setOrdered(); |
| 50 | 50 | $list->setClass("list"); |
| 51 | 51 | $this->content["list"]=$list; |
| 52 | 52 | return $list; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function getList(){ |
|
| 55 | + public function getList() { |
|
| 56 | 56 | return $this->content["list"]; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - public function getItem($index){ |
|
| 59 | + public function getItem($index) { |
|
| 60 | 60 | return $this->getList()->getItem($index); |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $icon=@$content[0]; |
| 18 | 18 | $title=@$content[1]; |
| 19 | 19 | $desc=@$content[2]; |
| 20 | - }else{ |
|
| 20 | + } else{ |
|
| 21 | 21 | $icon=@$content["icon"]; |
| 22 | 22 | $image=@$content["image"]; |
| 23 | 23 | $title=@$content["title"]; |
@@ -33,20 +33,21 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | if(isset($title)){ |
| 35 | 35 | $this->setTitle($title,$desc); |
| 36 | - }elseif (isset($header)){ |
|
| 36 | + } elseif (isset($header)){ |
|
| 37 | 37 | $this->setTitle($header,$desc,"header"); |
| 38 | 38 | } |
| 39 | 39 | if(isset($items)){ |
| 40 | 40 | $this->addList($items); |
| 41 | 41 | } |
| 42 | - }else{ |
|
| 42 | + } else{ |
|
| 43 | 43 | $this->setContent($content); |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | public function addList($items=array(),$ordered=false) { |
| 47 | 47 | $list=new HtmlList("", $items); |
| 48 | - if($ordered) |
|
| 49 | - $list->setOrdered(); |
|
| 48 | + if($ordered) { |
|
| 49 | + $list->setOrdered(); |
|
| 50 | + } |
|
| 50 | 51 | $list->setClass("list"); |
| 51 | 52 | $this->content["list"]=$list; |
| 52 | 53 | return $list; |