4 require_once(
"./Services/COPage/classes/class.ilPCSection.php");
5 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
24 function ilPCSectionGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
38 return array(
"Block" => $lng->txt(
"cont_Block"),
39 "Mnemonic" => $lng->txt(
"cont_Mnemonic"),
40 "Remark" => $lng->txt(
"cont_Remark"),
41 "Example" => $lng->txt(
"cont_Example"),
42 "Additional" => $lng->txt(
"cont_Additional"),
43 "Special" => $lng->txt(
"cont_Special"),
44 "Excursus" => $lng->txt(
"cont_Excursus"),
45 "AdvancedKnowledge" => $lng->txt(
"cont_AdvancedKnowledge"));
55 if ($a_style_id > 0 &&
58 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
60 $chars = $style->getCharacteristics(
"section");
62 foreach ($chars as $char)
64 if ($chars[$char] !=
"")
66 $new_chars[$char] = $chars[$char];
70 $new_chars[$char] = $char;
87 $next_class = $this->ctrl->getNextClass($this);
90 $cmd = $this->ctrl->getCmd();
113 function edit($a_insert =
false)
120 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
122 $form->setFormAction($ilCtrl->getFormAction($this));
125 $form->setTitle($this->lng->txt(
"cont_insert_section"));
129 $form->setTitle($this->lng->txt(
"cont_update_section"));
133 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
138 if (is_object($this->content_obj))
140 if ($chars[$a_seleted_value] ==
"" && ($this->content_obj->getCharacteristic() !=
""))
142 $chars = array_merge(
143 array($this->content_obj->getCharacteristic() => $this->content_obj->getCharacteristic()),
148 $selected = ($a_insert)
150 : $this->content_obj->getCharacteristic();
152 foreach($chars as $k => $char)
154 $html =
'<div class="ilCOPgEditStyleSelectionItem"><div class="ilc_section_'.$k.
'" style="'.self::$style_selector_reset.
'">'.
155 $char.
'</div></div>';
156 $char_prop->addOption($k, $char, $html);
159 $char_prop->setValue($selected);
160 $form->addItem($char_prop);
165 $form->addCommandButton(
"create_section", $lng->txt(
"save"));
166 $form->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
170 $form->addCommandButton(
"update", $lng->txt(
"save"));
171 $form->addCommandButton(
"cancelUpdate", $lng->txt(
"cancel"));
173 $html = $form->getHTML();
174 $tpl->setContent($html);
186 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
187 $this->content_obj->setCharacteristic(
$_POST[
"characteristic"]);
188 $this->updated = $this->pg_obj->update();
189 if ($this->updated ===
true)
191 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
204 $this->content_obj->setCharacteristic(
$_POST[
"characteristic"]);
205 $this->updated = $this->pg_obj->update();
206 if ($this->updated ===
true)
208 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
212 $this->pg_obj->addHierIDs();