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"),
201 $this->getCharacteristicsOfCurrentStyle([
"list_u"]);
202 $options = $this->getCharacteristics();
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 $style->setValue(
"");
211 $style->setOptions($options);
212 $op1->addSubItem($style);
215 $radg->addOption($op1);
222 $this->
lng->txt(
"cont_style"),
225 $this->getCharacteristicsOfCurrentStyle([
"list_o"]);
226 $options = $this->getCharacteristics();
227 if ($a_mode ==
"edit" && $this->content_obj->getListType() ==
"Ordered"
228 && $this->content_obj->getStyleClass() !=
""
229 && !in_array($this->content_obj->getStyleClass(), $options)) {
230 $options[$this->content_obj->getStyleClass()] =
231 $this->content_obj->getStyleClass();
233 if (count($options) > 1) {
234 foreach ($options as $k => $option) {
235 $html =
'<ol class="ilc_list_o_' . $k .
'"><li class="ilc_list_item_StandardListItem">' .
236 $option .
'</li></ol>';
237 if ($k ==
"NumberedList") {
242 $style->setValue(
"");
243 $style->setOptions($options);
244 $op2->addSubItem($style);
249 "Number" => $this->
lng->txt(
"cont_number_std"),
250 "Decimal" => $this->lng->txt(
"cont_decimal"),
251 "Roman" => $this->lng->txt(
"cont_roman"),
252 "roman" => $this->lng->txt(
"cont_roman_s"),
253 "Alphabetic" => $this->lng->txt(
"cont_alphabetic"),
254 "alphabetic" => $this->lng->txt(
"cont_alphabetic_s")
257 $si->setOptions($options);
258 $op2->addSubItem($si);
262 $ni->setMaxLength(3);
264 $ni->setInfo(
$lng->txt(
"cont_start_value_info"));
265 $op2->addSubItem($ni);
267 $radg->addOption($op2);
268 $radg->setValue(
"Unordered");
269 $this->
form->addItem($radg);
272 $this->getCharacteristicsOfCurrentStyle([
"list_item"]);
273 $options = $this->getCharacteristics();
274 if (count($options) > 1) {
276 $this->
lng->txt(
"cont_list_item_style"),
280 $this->
lng->txt(
"cont_list_item_style"),
283 foreach ($options as $k => $option) {
284 $html =
'<ul style="list-style-type:none;"><li class="ilc_list_item_' . $option .
'">' .
285 $option .
'</li></ul>';
286 if ($k ==
"BulletedList") {
292 $style1->setOptions($options);
293 $style2->setOptions($options);
294 $style1->setValue(
"StandardListItem");
295 $style2->setValue(
"StandardListItem");
296 $op1->addSubItem($style1);
297 $op2->addSubItem($style2);
299 $options = $this->getCharacteristicsOfCurrentStyle([
"list_item"]);
304 if ($a_mode ==
"create") {
305 for ($i = 1; $i <= 10; $i++) {
309 $si->setOptions($options);
311 $this->
form->addItem($si);
315 if ($a_mode ==
"create") {
316 $this->
form->addCommandButton(
"create",
$lng->txt(
"save"));
317 $this->
form->addCommandButton(
"cancelCreate",
$lng->txt(
"cancel"));
318 $this->
form->setTitle(
$lng->txt(
"cont_insert_list"));
320 $this->
form->addCommandButton(
"saveProperties",
$lng->txt(
"save"));
321 $this->
form->addCommandButton(
"cancelUpdate",
$lng->txt(
"cancel"));
322 $this->
form->setTitle(
$lng->txt(
"cont_list_properties"));
325 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
332 $values[
"start_value"] = $this->content_obj->getStartValue();
333 $values[
"list_type"] = $this->content_obj->getListType();
334 $values[
"numbering_type"] = $this->content_obj->getNumberingType();
335 if ($values[
"list_type"] ==
"Ordered") {
336 $values[
"number_style"] = $this->content_obj->getStyleClass();
337 $values[
"bullet_style"] =
"";
339 $values[
"bullet_style"] = $this->content_obj->getStyleClass();
340 $values[
"number_style"] =
"";
342 $values[
"item_style_1"] = $this->content_obj->getItemStyleClass();
343 $values[
"item_style_2"] = $this->content_obj->getItemStyleClass();
344 $this->
form->setValuesByArray($values);
getCharacteristics(string $a_type="", bool $a_no_hidden=false, bool $a_include_core=true)
Get characteristics.
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initListForm(string $a_mode="edit")
edit()
edit properties form
static _getListCharacteristics(int $a_style_id, string $type)
saveProperties()
Save properties.
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
insert()
insert new list form
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
ilGlobalTemplateInterface $tpl
Content object of ilPageObject (see ILIAS DTD).
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
This class represents an option in a radio group.
setContent(string $a_html)
Sets content for standard template.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
form( $class_path, string $cmd, string $submit_caption="")