38 $this->tpl = $DIC[
"tpl"];
39 $this->
lng = $DIC->language();
40 $this->
ctrl = $DIC->ctrl();
47 $next_class = $this->
ctrl->getNextClass($this);
50 $cmd = $this->
ctrl->getCmd();
52 switch ($next_class) {
67 $this->tpl->setContent($this->
form->getHTML());
79 if ($this->
form->checkInput()) {
81 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
82 $this->content_obj->addItems($this->
form->getInput(
"nr_items"));
83 $this->content_obj->setStartValue(
84 (
int) $this->
form->getInput(
"start_value")
86 $list_type = $this->
form->getInput(
"list_type");
87 $this->content_obj->setListType(
90 if ($list_type ==
"Unordered") {
91 $this->content_obj->setNumberingType(
"");
92 $this->content_obj->setStyleClass(
93 $this->
form->getInput(
"bullet_style")
96 $this->content_obj->setNumberingType(
97 $this->
form->getInput(
"numbering_type")
99 $this->content_obj->setStyleClass(
100 $this->
form->getInput(
"number_style")
103 $this->updated = $this->pg_obj->update();
104 if ($this->updated ===
true) {
105 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
108 $this->
form->setValuesByPost();
120 $this->tpl->setContent($this->
form->getHTML());
131 if ($this->
form->checkInput()) {
132 $this->content_obj->setStartValue(
133 $this->
form->getInput(
"start_value")
135 $list_type = $this->
form->getInput(
"list_type");
136 $this->content_obj->setListType(
139 if ($list_type ==
"Unordered") {
140 $this->content_obj->setNumberingType(
"");
141 $this->content_obj->setStyleClass(
142 $this->
form->getInput(
"bullet_style")
144 $this->content_obj->setItemStyleClass(
145 $this->
form->getInput(
"item_style_1")
148 $this->content_obj->setNumberingType(
149 $this->
form->getInput(
"numbering_type")
151 $this->content_obj->setStyleClass(
152 $this->
form->getInput(
"number_style")
154 $this->content_obj->setItemStyleClass(
155 $this->
form->getInput(
"item_style_2")
159 $this->updated = $this->pg_obj->update();
160 if ($this->updated ===
true) {
161 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
164 $this->
form->setValuesByPost();
174 if ($a_style_id > 0 &&
178 foreach ($types as $t) {
187 string $a_mode =
"edit" 198 $this->
lng->txt(
"cont_style"),
203 if ($a_mode ==
"edit" && $this->content_obj->getListType() ==
"Unordered" 204 && $this->content_obj->getStyleClass() !=
"" 205 && !in_array($this->content_obj->getStyleClass(), $options)) {
206 $options[$this->content_obj->getStyleClass()] =
207 $this->content_obj->getStyleClass();
209 if (count($options) > 1) {
210 foreach ($options as $k => $option) {
211 $html =
'<ul class="ilc_list_u_' . $k .
'"><li class="ilc_list_item_StandardListItem">' .
212 $option .
'</li></ul>';
213 if ($k ==
"BulletedList") {
216 $style->addOption($k, $option, $html);
222 $radg->addOption($op1);
229 $this->
lng->txt(
"cont_style"),
234 if ($a_mode ==
"edit" && $this->content_obj->getListType() ==
"Ordered" 235 && $this->content_obj->getStyleClass() !=
"" 236 && !in_array($this->content_obj->getStyleClass(), $options)) {
237 $options[$this->content_obj->getStyleClass()] =
238 $this->content_obj->getStyleClass();
240 if (count($options) > 1) {
241 foreach ($options as $k => $option) {
242 $html =
'<ol class="ilc_list_o_' . $k .
'"><li class="ilc_list_item_StandardListItem">' .
243 $option .
'</li></ol>';
244 if ($k ==
"NumberedList") {
247 $style->addOption($k, $option, $html);
250 $op2->addSubItem($style);
255 "Number" => $this->
lng->txt(
"cont_number_std"),
256 "Decimal" => $this->
lng->txt(
"cont_decimal"),
257 "Roman" => $this->
lng->txt(
"cont_roman"),
258 "roman" => $this->
lng->txt(
"cont_roman_s"),
259 "Alphabetic" => $this->
lng->txt(
"cont_alphabetic"),
260 "alphabetic" => $this->
lng->txt(
"cont_alphabetic_s")
264 $op2->addSubItem($si);
268 $ni->setMaxLength(3);
270 $ni->setInfo(
$lng->
txt(
"cont_start_value_info"));
271 $op2->addSubItem($ni);
273 $radg->addOption($op2);
274 $radg->setValue(
"Unordered");
275 $this->
form->addItem($radg);
280 if (count($options) > 1) {
282 $this->
lng->txt(
"cont_list_item_style"),
286 $this->
lng->txt(
"cont_list_item_style"),
289 foreach ($options as $k => $option) {
290 $html =
'<ul style="list-style-type:none;"><li class="ilc_list_item_' . $option .
'">' .
291 $option .
'</li></ul>';
292 if ($k ==
"BulletedList") {
298 $style1->setValue(
"StandardListItem");
299 $style2->
setValue(
"StandardListItem");
301 $op2->addSubItem($style2);
308 if ($a_mode ==
"create") {
309 for ($i = 1; $i <= 10; $i++) {
315 $this->
form->addItem($si);
319 if ($a_mode ==
"create") {
320 $this->
form->addCommandButton(
"create_list",
$lng->
txt(
"save"));
321 $this->
form->addCommandButton(
"cancelCreate",
$lng->
txt(
"cancel"));
322 $this->
form->setTitle(
$lng->
txt(
"cont_insert_list"));
324 $this->
form->addCommandButton(
"saveProperties",
$lng->
txt(
"save"));
325 $this->
form->addCommandButton(
"cancelUpdate",
$lng->
txt(
"cancel"));
326 $this->
form->setTitle(
$lng->
txt(
"cont_list_properties"));
329 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
336 $values[
"start_value"] = $this->content_obj->getStartValue();
337 $values[
"list_type"] = $this->content_obj->getListType();
338 $values[
"numbering_type"] = $this->content_obj->getNumberingType();
339 if ($values[
"list_type"] ==
"Ordered") {
340 $values[
"number_style"] = $this->content_obj->getStyleClass();
341 $values[
"bullet_style"] =
"";
343 $values[
"bullet_style"] = $this->content_obj->getStyleClass();
344 $values[
"number_style"] =
"";
346 $values[
"item_style_1"] = $this->content_obj->getItemStyleClass();
347 $values[
"item_style_2"] = $this->content_obj->getItemStyleClass();
348 $this->
form->setValuesByArray($values);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
insert()
insert new list form
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initListForm(string $a_mode="edit")
static _getListCharacteristics(int $a_style_id, string $type)
Content object of ilPageObject (see ILIAS DTD).
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
setContent(string $a_html)
Sets content for standard template.
setValue(string $a_value)
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
ilGlobalTemplateInterface $tpl
saveProperties()
Save properties.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd, string $submit_caption="")
getCharacteristics(string $a_type="", bool $a_no_hidden=false, bool $a_include_core=true)
Get characteristics.
edit()
edit properties form
static _lookupType(int $id, bool $reference=false)