phpMv -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
HtmlListItem.php
Go to the documentation of this file.
1<?php
3
6
8
9 protected $image;
10
11 public function __construct($identifier, $content = NULL) {
12 parent::__construct($identifier, "item", $content);
13 }
14
15 protected function initContent($content) {
16 if (\is_array($content)) {
17 if (JArray::isAssociative($content) === false) {
18 $icon = $content[0] ?? null;
19 $title = $content[1] ?? null;
20 $desc = $content[2] ?? null;
21 } else {
22 $icon = $content["icon"] ?? null;
23 $image = $content["image"] ?? null;
24 $title = $content["title"] ?? null;
25 $header = $content["header"] ?? null;
26 $desc = $content["description"] ?? null;
27 $items = $content["items"] ?? null;
28 }
29 if (isset($icon)) {
30 $this->setIcon($icon);
31 }
32 if (isset($image)) {
33 $this->setImage($image);
34 }
35 if (isset($title)) {
36 $this->setTitle($title, $desc);
37 } elseif (isset($header)) {
38 $this->setTitle($header, $desc, "header");
39 }
40 if (isset($items)) {
41 $this->addList($items);
42 }
43 } else {
44 $this->setContent($content);
45 }
46 }
47
48 public function addList($items = array(), $ordered = false) {
49 $list = new HtmlList("", $items);
50 if ($ordered)
51 $list->setOrdered();
52 $list->setClass("list");
53 $this->content["list"] = $list;
54 return $list;
55 }
56
57 public function getList() {
58 return $this->content["list"];
59 }
60
61 public function getItem($index) {
62 return $this->getList()->getItem($index);
63 }
64}
setTitle($title, $description=NULL, $baseClass="title")
__construct($identifier, $content=NULL)
addList($items=array(), $ordered=false)