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
2
namespace
Ajax\semantic\html\content
;
3
4
use
Ajax\service\JArray
;
5
use
Ajax\semantic\html\elements\HtmlList
;
6
7
class
HtmlListItem
extends
HtmlAbsractItem
{
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
}
Ajax\common\html\BaseWidget\$identifier
$identifier
Definition
BaseWidget.php:14
Ajax\common\html\HtmlDoubleElement\setContent
setContent($content)
Definition
HtmlDoubleElement.php:27
Ajax\common\html\HtmlDoubleElement\$content
$content
Definition
HtmlDoubleElement.php:14
Ajax\semantic\html\content\HtmlAbsractItem
Definition
HtmlAbsractItem.php:12
Ajax\semantic\html\content\HtmlAbsractItem\setIcon
setIcon($icon)
Definition
HtmlAbsractItem.php:22
Ajax\semantic\html\content\HtmlAbsractItem\setTitle
setTitle($title, $description=NULL, $baseClass="title")
Definition
HtmlAbsractItem.php:62
Ajax\semantic\html\content\HtmlAbsractItem\setImage
setImage($image)
Definition
HtmlAbsractItem.php:32
Ajax\semantic\html\content\HtmlListItem
Definition
HtmlListItem.php:7
Ajax\semantic\html\content\HtmlListItem\initContent
initContent($content)
Definition
HtmlListItem.php:15
Ajax\semantic\html\content\HtmlListItem\__construct
__construct($identifier, $content=NULL)
Definition
HtmlListItem.php:11
Ajax\semantic\html\content\HtmlListItem\addList
addList($items=array(), $ordered=false)
Definition
HtmlListItem.php:48
Ajax\semantic\html\content\HtmlListItem\getList
getList()
Definition
HtmlListItem.php:57
Ajax\semantic\html\content\HtmlListItem\getItem
getItem($index)
Definition
HtmlListItem.php:61
Ajax\semantic\html\content\HtmlListItem\$image
$image
Definition
HtmlListItem.php:9
Ajax\semantic\html\elements\HtmlList
Definition
HtmlList.php:12
Ajax\service\JArray
Definition
JArray.php:4
Ajax\semantic\html\content
Definition
HtmlAbsractItem.php:3
Ajax
semantic
html
content
HtmlListItem.php
Generated on Sun Dec 10 2023 16:16:06 for
phpMv-UI
by
doxygen
1.9.8