ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
class.ilPCList.php
Go to the documentation of this file.
1
<?php
2
26
class
ilPCList
extends
ilPageContent
27
{
28
public
function
init
(): void
29
{
30
$this->
setType
(
"list"
);
31
}
32
33
public
function
create
(
34
ilPageObject
$a_pg_obj,
35
string
$a_hier_id,
36
string
$a_pc_id =
""
37
): void {
38
$this->
createInitialChildNode
($a_hier_id, $a_pc_id,
"List"
);
39
}
40
44
public
function
addItems
(
int
$a_nr): void
45
{
46
for
($i = 1; $i <= $a_nr; $i++) {
47
$new_item = $this->dom_doc->createElement(
"ListItem"
);
48
$new_item = $this->
getChildNode
()->appendChild($new_item);
49
}
50
}
51
52
56
public
function
getOrderType
(): string
57
{
58
if
($this->
getChildNode
()->getAttribute(
"Type"
) ==
"Unordered"
) {
59
return
"Unordered"
;
60
}
61
62
$nt = $this->
getChildNode
()->getAttribute(
"NumberingType"
);
63
switch
($nt) {
64
case
"Number"
:
65
case
"Roman"
:
66
case
"roman"
:
67
case
"Alphabetic"
:
68
case
"alphabetic"
:
69
case
"Decimal"
:
70
return
$nt;
71
72
default
:
73
return
"Number"
;
74
}
75
}
76
77
public
function
getListType
(): string
78
{
79
if
($this->
getChildNode
()->getAttribute(
"Type"
) ==
"Unordered"
) {
80
return
"Unordered"
;
81
}
82
return
"Ordered"
;
83
}
84
85
public
function
setListType
(
string
$a_val): void
86
{
87
$this->
getChildNode
()->setAttribute(
"Type"
, $a_val);
88
}
89
93
public
function
getNumberingType
(): string
94
{
95
$nt = $this->
getChildNode
()->getAttribute(
"NumberingType"
);
96
switch
($nt) {
97
case
"Number"
:
98
case
"Roman"
:
99
case
"roman"
:
100
case
"Alphabetic"
:
101
case
"alphabetic"
:
102
case
"Decimal"
:
103
return
$nt;
104
105
default
:
106
return
"Number"
;
107
}
108
}
109
110
public
function
setNumberingType
(
string
$a_val): void
111
{
112
if
($a_val !=
""
) {
113
$this->
getChildNode
()->setAttribute(
"NumberingType"
, $a_val);
114
}
else
{
115
if
($this->
getChildNode
()->hasAttribute(
"NumberingType"
)) {
116
$this->
getChildNode
()->removeAttribute(
"NumberingType"
);
117
}
118
}
119
}
120
121
public
function
setStartValue
(
int
$a_val): void
122
{
123
if
($a_val !=
""
) {
124
$this->
getChildNode
()->setAttribute(
"StartValue"
, $a_val);
125
}
else
{
126
if
($this->
getChildNode
()->hasAttribute(
"StartValue"
)) {
127
$this->
getChildNode
()->removeAttribute(
"StartValue"
);
128
}
129
}
130
}
131
132
public
function
getStartValue
():
int
133
{
134
return
(
int
) $this->
getChildNode
()->getAttribute(
"StartValue"
);
135
}
136
137
public
function
setStyleClass
(
string
$a_val): void
138
{
139
if
(!in_array($a_val, array(
""
,
"BulletedList"
,
"NumberedList"
))) {
140
$this->
getChildNode
()->setAttribute(
"Class"
, $a_val);
141
}
else
{
142
if
($this->
getChildNode
()->hasAttribute(
"Class"
)) {
143
$this->
getChildNode
()->removeAttribute(
"Class"
);
144
}
145
}
146
}
147
148
public
function
setItemStyleClass
(
string
$a_val): void
149
{
150
if
(!in_array($a_val, array(
""
,
"StandardListItem"
))) {
151
$this->
getChildNode
()->setAttribute(
"ItemClass"
, $a_val);
152
}
else
{
153
if
($this->
getChildNode
()->hasAttribute(
"ItemClass"
)) {
154
$this->
getChildNode
()->removeAttribute(
"ItemClass"
);
155
}
156
}
157
}
158
159
public
function
getStyleClass
(): string
160
{
161
return
$this->
getChildNode
()->getAttribute(
"Class"
);
162
}
163
164
public
function
getItemStyleClass
(): string
165
{
166
return
$this->
getChildNode
()->getAttribute(
"ItemClass"
);
167
}
168
}
ilPageContent\setType
setType(string $a_type)
Set Type.
Definition:
class.ilPageContent.php:103
ilPCList\create
create(ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
Definition:
class.ilPCList.php:33
ilPCList\getOrderType
getOrderType()
Get order type.
Definition:
class.ilPCList.php:56
ilPageContent\getChildNode
getChildNode()
Definition:
class.ilPageContent.php:128
ilPageContent
Content object of ilPageObject (see ILIAS DTD).
Definition:
class.ilPageContent.php:28
ilPCList\getListType
getListType()
Definition:
class.ilPCList.php:77
ilPCList\setStartValue
setStartValue(int $a_val)
Definition:
class.ilPCList.php:121
ilPCList\setItemStyleClass
setItemStyleClass(string $a_val)
Definition:
class.ilPCList.php:148
ilPCList\getItemStyleClass
getItemStyleClass()
Definition:
class.ilPCList.php:164
ilPageObject
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
Definition:
class.ilPageObject.php:52
ilPCList\getNumberingType
getNumberingType()
Get numbering type.
Definition:
class.ilPCList.php:93
ilPCList\setListType
setListType(string $a_val)
Definition:
class.ilPCList.php:85
ilPCList
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilPCList.php:26
ilPCList\setNumberingType
setNumberingType(string $a_val)
Definition:
class.ilPCList.php:110
ilPCList\getStartValue
getStartValue()
Definition:
class.ilPCList.php:132
ilPCList\addItems
addItems(int $a_nr)
Add a number of items to list.
Definition:
class.ilPCList.php:44
ilPCList\init
init()
Definition:
class.ilPCList.php:28
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
ilPCList\getStyleClass
getStyleClass()
Definition:
class.ilPCList.php:159
ilPCList\setStyleClass
setStyleClass(string $a_val)
Definition:
class.ilPCList.php:137
ilPageContent\createInitialChildNode
createInitialChildNode(string $hier_id, string $pc_id, string $child, array $child_attributes=[])
Definition:
class.ilPageContent.php:317
components
ILIAS
COPage
PC
List
class.ilPCList.php
Generated on Sun Aug 31 2025 23:02:40 for ILIAS by
1.8.13 (using
Doxyfile
)