4 require_once(
"./Services/COPage/classes/class.ilPCList.php");
5 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
24 function ilPCListGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
35 $next_class = $this->ctrl->getNextClass($this);
38 $cmd = $this->ctrl->getCmd();
59 $this->tpl->setContent($this->form->getHTML());
71 if ($this->form->checkInput())
73 $this->content_obj =
new ilPCList($this->dom);
74 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
75 $this->content_obj->addItems(
$_POST[
"nr_items"]);
76 $this->content_obj->setStartValue(
$_POST[
"start_value"]);
77 $this->content_obj->setListType(
$_POST[
"list_type"]);
78 if (
$_POST[
"list_type"] ==
"Unordered")
80 $this->content_obj->setNumberingType(
"");
81 $this->content_obj->setStyleClass(
$_POST[
"bullet_style"]);
85 $this->content_obj->setNumberingType(
$_POST[
"numbering_type"]);
86 $this->content_obj->setStyleClass(
$_POST[
"number_style"]);
88 $this->updated = $this->pg_obj->update();
89 if ($this->updated ===
true)
91 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
94 $this->form->setValuesByPost();
95 $tpl->setContent($this->form->getHtml());
107 $this->tpl->setContent($this->form->getHTML());
118 if ($this->form->checkInput())
120 $this->content_obj->setStartValue(
$_POST[
"start_value"]);
121 $this->content_obj->setListType(
$_POST[
"list_type"]);
122 if (
$_POST[
"list_type"] ==
"Unordered")
124 $this->content_obj->setNumberingType(
"");
125 $this->content_obj->setStyleClass(
$_POST[
"bullet_style"]);
129 $this->content_obj->setNumberingType(
$_POST[
"numbering_type"]);
130 $this->content_obj->setStyleClass(
$_POST[
"number_style"]);
133 $this->updated = $this->pg_obj->update();
134 if ($this->updated ===
true)
136 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
139 $this->form->setValuesByPost();
140 $tpl->setContent($this->form->getHtml());
151 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
156 $op1 =
new ilRadioOption($lng->txt(
"cont_bullet_list"),
"Unordered");
159 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
164 if ($a_mode ==
"edit" && $this->content_obj->getListType() ==
"Unordered"
165 && $this->content_obj->getStyleClass() !=
""
166 && !in_array($this->content_obj->getStyleClass(), $options))
168 $options[$this->content_obj->getStyleClass()] =
169 $this->content_obj->getStyleClass();
171 if (count($options) > 1)
173 foreach($options as $k => $option)
175 $html =
'<ul class="ilc_list_u_'.$k.
'"><li class="ilc_list_item_StandardListItem">'.
176 $option.
'</li></ul>';
177 if ($k ==
"BulletedList")
181 $style->addOption($k, $option, $html);
183 $style->setValue(
"");
187 $radg->addOption($op1);
190 $op2 =
new ilRadioOption($lng->txt(
"cont_numbered_list"),
"Ordered");
193 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
198 if ($a_mode ==
"edit" && $this->content_obj->getListType() ==
"Ordered"
199 && $this->content_obj->getStyleClass() !=
""
200 && !in_array($this->content_obj->getStyleClass(), $options))
202 $options[$this->content_obj->getStyleClass()] =
203 $this->content_obj->getStyleClass();
205 if (count($options) > 1)
207 foreach($options as $k => $option)
209 $html =
'<ol class="ilc_list_o_'.$k.
'"><li class="ilc_list_item_StandardListItem">'.
210 $option.
'</li></ol>';
211 if ($k ==
"NumberedList")
215 $style->addOption($k, $option, $html);
217 $style->setValue(
"");
218 $op2->addSubItem($style);
223 "Number" => $this->lng->txt(
"cont_number_std"),
224 "Decimal" => $this->lng->txt(
"cont_decimal"),
225 "Roman" => $this->lng->txt(
"cont_roman"),
226 "roman" => $this->lng->txt(
"cont_roman_s"),
227 "Alphabetic" => $this->lng->txt(
"cont_alphabetic"),
228 "alphabetic" => $this->lng->txt(
"cont_alphabetic_s")
230 $si =
new ilSelectInputGUI($this->lng->txt(
"cont_number_type"),
"numbering_type");
232 $op2->addSubItem($si);
235 $ni =
new ilNumberInputGUI($this->lng->txt(
"cont_start_value"),
"start_value");
238 $ni->setInfo($lng->txt(
"cont_start_value_info"));
239 $op2->addSubItem($ni);
241 $radg->addOption($op2);
242 $radg->setValue(
"Unordered");
243 $this->form->addItem($radg);
247 if ($a_mode ==
"create")
249 for ($i=1; $i<=10; $i++)
256 $this->form->addItem($si);
260 if ($a_mode ==
"create")
262 $this->form->addCommandButton(
"create_list", $lng->txt(
"save"));
263 $this->form->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
264 $this->form->setTitle($lng->txt(
"cont_insert_list"));
268 $this->form->addCommandButton(
"saveProperties", $lng->txt(
"save"));
269 $this->form->addCommandButton(
"cancelUpdate", $lng->txt(
"cancel"));
270 $this->form->setTitle($lng->txt(
"cont_list_properties"));
273 $this->form->setFormAction($this->ctrl->getFormAction($this));
286 $values[
"start_value"] = $this->content_obj->getStartValue();
287 $values[
"list_type"] = $this->content_obj->getListType();
288 $values[
"numbering_type"] = $this->content_obj->getNumberingType();
289 if ($values[
"list_type"] ==
"Ordered")
291 $values[
"number_style"] = $this->content_obj->getStyleClass();
292 $values[
"bullet_style"] =
"";
296 $values[
"bullet_style"] = $this->content_obj->getStyleClass();
297 $values[
"number_style"] =
"";
299 $this->form->setValuesByArray($values);