4 require_once(
"./Services/COPage/classes/class.ilPCSection.php");
5 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
26 function __construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
28 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
40 return array(
"Block" => $lng->txt(
"cont_Block"),
41 "Mnemonic" => $lng->txt(
"cont_Mnemonic"),
42 "Remark" => $lng->txt(
"cont_Remark"),
43 "Example" => $lng->txt(
"cont_Example"),
44 "Additional" => $lng->txt(
"cont_Additional"),
45 "Special" => $lng->txt(
"cont_Special"),
46 "Excursus" => $lng->txt(
"cont_Excursus"),
47 "AdvancedKnowledge" => $lng->txt(
"cont_AdvancedKnowledge"));
57 if ($a_style_id > 0 &&
60 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
62 $chars =
$style->getCharacteristics(
"section");
64 foreach ($chars as $char)
66 if ($chars[$char] !=
"")
68 $new_chars[$char] = $chars[$char];
72 $new_chars[$char] = $char;
89 $next_class = $this->ctrl->getNextClass($this);
92 $cmd = $this->ctrl->getCmd();
96 case "ilpropertyformgui":
97 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
99 $this->ctrl->forwardCommand($form);
115 $this->
edit(
true, $a_form);
129 $a_form = $this->
initForm($a_insert);
132 $tpl->setContent($a_form->getHTML());
143 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
145 $form->setFormAction($ilCtrl->getFormAction($this));
148 $form->setTitle($this->lng->txt(
"cont_insert_section"));
152 $form->setTitle($this->lng->txt(
"cont_update_section"));
156 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
161 if (is_object($this->content_obj))
163 if ($chars[$a_seleted_value] ==
"" && ($this->content_obj->getCharacteristic() !=
""))
165 $chars = array_merge(
166 array($this->content_obj->getCharacteristic() => $this->content_obj->getCharacteristic()),
171 $selected = ($a_insert)
173 : $this->content_obj->getCharacteristic();
175 foreach($chars as $k => $char)
177 $html =
'<div class="ilCOPgEditStyleSelectionItem"><div class="ilc_section_'.$k.
'" style="'.self::$style_selector_reset.
'">'.
178 $char.
'</div></div>';
179 $char_prop->addOption($k, $char,
$html);
182 $char_prop->setValue($selected);
183 $form->addItem($char_prop);
186 include_once
'Services/Form/classes/class.ilLinkInputGUI.php';
189 $ac->setRequired(
false);
190 $ac->setInfo($this->lng->txt(
"copg_sec_link_info"));
191 $ac->setInternalLinkDefault($this->
getPageConfig()->getIntLinkHelpDefaultType(),
193 $link_types =
array();
198 $ac->setInternalLinkFilterTypes($link_types);
199 $ac->setFilterWhiteList(
204 $l = $this->content_obj->getLink();
205 if (
$l[
"LinkType"] ==
"IntLink")
207 $ac->setValueByIntLinkAttributes(
$l[
"Type"],
$l[
"Target"],
$l[
"TargetFrame"]);
209 if (
$l[
"LinkType"] ==
"ExtLink")
211 $ac->setValue(
$l[
"Href"]);
220 if (!$a_insert && ($from = $this->content_obj->getActiveFrom()) !=
"")
224 $dt_prop->setShowTime(
true);
225 $form->addItem($dt_prop);
229 if (!$a_insert && ($to = $this->content_obj->getActiveTo()) !=
"")
233 $dt_prop->setShowTime(
true);
234 $form->addItem($dt_prop);
239 include_once(
"./Services/Form/classes/class.ilRepositorySelector2InputGUI.php");
246 "read" => $lng->txt(
"read"),
247 "write" => $lng->txt(
"write"),
248 "visible" => $lng->txt(
"visible"),
251 $si->
setInfo($lng->txt(
"cont_permission_object_desc"));
257 $si->setValue($this->content_obj->getPermission());
258 $rs->setValue($this->content_obj->getPermissionRefId());
265 $form->addCommandButton(
"create_section", $lng->txt(
"save"));
266 $form->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
270 $form->addCommandButton(
"update", $lng->txt(
"save"));
271 $form->addCommandButton(
"cancelUpdate", $lng->txt(
"cancel"));
283 if($form->checkInput())
286 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
290 $this->updated = $this->pg_obj->update();
291 if ($this->updated ===
true)
293 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
306 if($form->checkInput())
310 $this->updated = $this->pg_obj->update();
311 if ($this->updated ===
true)
313 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
317 $this->pg_obj->addHierIDs();
318 $this->
edit(
false, $form);
328 $this->content_obj->setCharacteristic(
$_POST[
"characteristic"]);
330 $from = $form->getItemByPostVar(
"active_from")->getDate();
333 $this->content_obj->setActiveFrom($from->get(
IL_CAL_UNIX));
337 $this->content_obj->setActiveFrom(0);
340 $to = $form->getItemByPostVar(
"active_to")->getDate();
343 $this->content_obj->setActiveTo($to->get(
IL_CAL_UNIX));
347 $this->content_obj->setActiveTo(0);
352 $this->content_obj->setPermissionRefId(
$_POST[
"permission_ref_id"]);
353 $this->content_obj->setPermission(
$_POST[
"permission"]);
356 if (
$_POST[
"link_mode"] ==
"ext" &&
$_POST[
"link"] !=
"")
358 $this->content_obj->setExtLink(
$_POST[
"link"]);
360 else if (
$_POST[
"link_mode"] ==
"int" &&
$_POST[
"link"] !=
"")
364 $la = $form->getItemByPostVar(
"link")->getIntLinkAttributes();
367 if ($la[
"Type"] !=
"")
369 $this->content_obj->setIntLink($la[
"Type"], $la[
"Target"], $la[
"TargetFrame"]);
374 $this->content_obj->setNoLink();
executeCommand()
execute command
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
edit($a_insert=false, ilPropertyFormGUI $a_form=null)
Edit section form.
setValuesFromForm($form)
Set values from form.
create()
Create new Section.
initForm($a_insert=false)
Init editing form.
static _getStandardCharacteristics()
Get standard characteristics.
getPageConfig()
Get Page Config.
setCharacteristics($a_chars)
Set Characteristics.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
static _getCharacteristics($a_style_id)
Get characteristics.
if(!is_array($argv)) $options
displayValidationError()
display validation errors
insert(ilPropertyFormGUI $a_form=null)
Insert new section form.
getCharacteristics()
Get characteristics.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
__construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor public.