4 require_once(
"./Services/COPage/classes/class.ilPCList.php");
5 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
24 public function __construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
28 $this->tpl = $DIC[
"tpl"];
29 $this->lng = $DIC->language();
30 $this->ctrl = $DIC->ctrl();
31 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
40 $next_class = $this->ctrl->getNextClass($this);
43 $cmd = $this->ctrl->getCmd();
45 switch ($next_class) {
63 $this->tpl->setContent($this->form->getHTML());
77 if ($this->form->checkInput()) {
79 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
80 $this->content_obj->addItems(
$_POST[
"nr_items"]);
81 $this->content_obj->setStartValue(
$_POST[
"start_value"]);
82 $this->content_obj->setListType(
$_POST[
"list_type"]);
83 if (
$_POST[
"list_type"] ==
"Unordered") {
84 $this->content_obj->setNumberingType(
"");
85 $this->content_obj->setStyleClass(
$_POST[
"bullet_style"]);
87 $this->content_obj->setNumberingType(
$_POST[
"numbering_type"]);
88 $this->content_obj->setStyleClass(
$_POST[
"number_style"]);
90 $this->updated = $this->pg_obj->update();
91 if ($this->updated ===
true) {
92 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
95 $this->form->setValuesByPost();
96 $tpl->setContent($this->form->getHtml());
108 $this->tpl->setContent($this->form->getHTML());
121 if ($this->form->checkInput()) {
122 $this->content_obj->setStartValue(
$_POST[
"start_value"]);
123 $this->content_obj->setListType(
$_POST[
"list_type"]);
124 if (
$_POST[
"list_type"] ==
"Unordered") {
125 $this->content_obj->setNumberingType(
"");
126 $this->content_obj->setStyleClass(
$_POST[
"bullet_style"]);
128 $this->content_obj->setNumberingType(
$_POST[
"numbering_type"]);
129 $this->content_obj->setStyleClass(
$_POST[
"number_style"]);
132 $this->updated = $this->pg_obj->update();
133 if ($this->updated ===
true) {
134 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
137 $this->form->setValuesByPost();
138 $tpl->setContent($this->form->getHtml());
149 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
157 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
159 $this->lng->txt(
"cont_style"),
164 if ($a_mode ==
"edit" && $this->content_obj->getListType() ==
"Unordered" 165 && $this->content_obj->getStyleClass() !=
"" 166 && !in_array($this->content_obj->getStyleClass(),
$options)) {
167 $options[$this->content_obj->getStyleClass()] =
168 $this->content_obj->getStyleClass();
171 foreach (
$options as $k => $option) {
172 $html =
'<ul class="ilc_list_u_' . $k .
'"><li class="ilc_list_item_StandardListItem">' .
173 $option .
'</li></ul>';
174 if ($k ==
"BulletedList") {
183 $radg->addOption($op1);
189 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
191 $this->lng->txt(
"cont_style"),
196 if ($a_mode ==
"edit" && $this->content_obj->getListType() ==
"Ordered" 197 && $this->content_obj->getStyleClass() !=
"" 198 && !in_array($this->content_obj->getStyleClass(),
$options)) {
199 $options[$this->content_obj->getStyleClass()] =
200 $this->content_obj->getStyleClass();
203 foreach (
$options as $k => $option) {
204 $html =
'<ol class="ilc_list_o_' . $k .
'"><li class="ilc_list_item_StandardListItem">' .
205 $option .
'</li></ol>';
206 if ($k ==
"NumberedList") {
217 "Number" => $this->lng->txt(
"cont_number_std"),
218 "Decimal" => $this->lng->txt(
"cont_decimal"),
219 "Roman" => $this->lng->txt(
"cont_roman"),
220 "roman" => $this->lng->txt(
"cont_roman_s"),
221 "Alphabetic" => $this->lng->txt(
"cont_alphabetic"),
222 "alphabetic" => $this->lng->txt(
"cont_alphabetic_s")
226 $op2->addSubItem($si);
229 $ni =
new ilNumberInputGUI($this->lng->txt(
"cont_start_value"),
"start_value");
232 $ni->setInfo(
$lng->txt(
"cont_start_value_info"));
233 $op2->addSubItem($ni);
235 $radg->addOption($op2);
236 $radg->setValue(
"Unordered");
237 $this->form->addItem($radg);
241 if ($a_mode ==
"create") {
242 for (
$i = 1;
$i <= 10;
$i++) {
248 $this->form->addItem($si);
252 if ($a_mode ==
"create") {
253 $this->form->addCommandButton(
"create_list",
$lng->txt(
"save"));
254 $this->form->addCommandButton(
"cancelCreate",
$lng->txt(
"cancel"));
255 $this->form->setTitle(
$lng->txt(
"cont_insert_list"));
257 $this->form->addCommandButton(
"saveProperties",
$lng->txt(
"save"));
258 $this->form->addCommandButton(
"cancelUpdate",
$lng->txt(
"cancel"));
259 $this->form->setTitle(
$lng->txt(
"cont_list_properties"));
262 $this->form->setFormAction($this->ctrl->getFormAction($this));
275 $values[
"start_value"] = $this->content_obj->getStartValue();
276 $values[
"list_type"] = $this->content_obj->getListType();
277 $values[
"numbering_type"] = $this->content_obj->getNumberingType();
278 if (
$values[
"list_type"] ==
"Ordered") {
279 $values[
"number_style"] = $this->content_obj->getStyleClass();
282 $values[
"bullet_style"] = $this->content_obj->getStyleClass();
285 $this->form->setValuesByArray(
$values);
__construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor public.
This class represents an option in a radio group.
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
insert()
insert new list form
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
displayValidationError()
display validation errors
getValues()
Get current values for list from.
saveProperties()
Save properties.
getCharacteristics()
Get characteristics.
executeCommand()
execute command
edit()
edit properties form
initListForm($a_mode="edit")
Init list form.