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 =
"")
26 parent::ilPageContentGUI($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)
121 $html = $form->getHTML();
122 $tpl->setContent(
$html);
133 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
135 $form->setFormAction($ilCtrl->getFormAction($this));
138 $form->setTitle($this->lng->txt(
"cont_insert_section"));
142 $form->setTitle($this->lng->txt(
"cont_update_section"));
146 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
151 if (is_object($this->content_obj))
153 if ($chars[$a_seleted_value] ==
"" && ($this->content_obj->getCharacteristic() !=
""))
155 $chars = array_merge(
156 array($this->content_obj->getCharacteristic() => $this->content_obj->getCharacteristic()),
161 $selected = ($a_insert)
163 : $this->content_obj->getCharacteristic();
165 foreach($chars as $k => $char)
167 $html =
'<div class="ilCOPgEditStyleSelectionItem"><div class="ilc_section_'.$k.
'" style="'.self::$style_selector_reset.
'">'.
168 $char.
'</div></div>';
169 $char_prop->addOption($k, $char,
$html);
172 $char_prop->setValue($selected);
173 $form->addItem($char_prop);
177 if (!$a_insert && ($from = $this->content_obj->getActiveFrom()) !=
"")
182 $dt_prop->setShowTime(
true);
183 $form->addItem($dt_prop);
187 if (!$a_insert && ($to = $this->content_obj->getActiveTo()) !=
"")
192 $dt_prop->setShowTime(
true);
193 $form->addItem($dt_prop);
198 $form->addCommandButton(
"create_section", $lng->txt(
"save"));
199 $form->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
203 $form->addCommandButton(
"update", $lng->txt(
"save"));
204 $form->addCommandButton(
"cancelUpdate", $lng->txt(
"cancel"));
220 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
225 $this->updated = $this->pg_obj->update();
226 if ($this->updated ===
true)
228 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
246 $this->updated = $this->pg_obj->update();
247 if ($this->updated ===
true)
249 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
253 $this->pg_obj->addHierIDs();
265 $this->content_obj->setCharacteristic(
$_POST[
"characteristic"]);
267 if (
$_POST[
"active_from"][
"date"] !=
"" &&
268 $from = $form->getItemByPostVar(
"active_from")->getDate())
270 $this->content_obj->setActiveFrom($from->get(
IL_CAL_UNIX));
274 $this->content_obj->setActiveFrom(0);
277 if (
$_POST[
"active_to"][
"date"] !=
"" &&
278 $to = $form->getItemByPostVar(
"active_to")->getDate())
280 $this->content_obj->setActiveTo($to->get(
IL_CAL_UNIX));
284 $this->content_obj->setActiveTo(0);
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
insert()
Insert new section form.
setValuesFromForm($form)
Set values from form.
create()
Create new Section.
ilPCSectionGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor public.
initForm($a_insert=false)
Init editing form.
static _getStandardCharacteristics()
Get standard characteristics.
setCharacteristics($a_chars)
Set Characteristics.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
static _getCharacteristics($a_style_id)
Get characteristics.
displayValidationError()
display validation errors
edit($a_insert=false)
Edit section form.
getCharacteristics()
Get characteristics.
static _lookupType($a_id, $a_reference=false)
lookup object type
& executeCommand()
execute command