4 require_once(
"./Services/COPage/classes/class.ilPCSection.php");
5 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
26 public function __construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id =
"")
30 $this->tpl = $DIC[
"tpl"];
31 $this->lng = $DIC->language();
32 $this->ctrl = $DIC->ctrl();
47 if ($params[
"form"] ==
true) {
48 $insert = (bool) !($this->content_obj);
50 $form->setShowTopButtons(
false);
52 $from = $form->getItemByPostVar(
"active_from");
53 $from->setSideBySide(
false);
54 $on_load_code1 = $from->getOnloadCode();
55 $to = $form->getItemByPostVar(
"active_to");
56 $to->setSideBySide(
false);
57 $on_load_code2 = $to->getOnloadCode();
59 $rep_sel = $form->getItemByPostVar(
"permission_ref_id");
62 $exp = $rep_sel->getExplorerGUI();
63 $this->ctrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar",
"permission_ref_id");
64 $on_load_code3 = $exp->getOnloadCode();
65 $this->ctrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar",
"");
68 $html = $params[
"ui_wrapper"]->getRenderedForm(
74 implode(
"\n", array_merge($on_load_code1, $on_load_code2)) .
75 "\n" . $on_load_code3 .
90 $lng = $DIC->language();
92 return array(
"Block" =>
$lng->txt(
"cont_Block"),
93 "Mnemonic" =>
$lng->txt(
"cont_Mnemonic"),
94 "Remark" =>
$lng->txt(
"cont_Remark"),
95 "Example" =>
$lng->txt(
"cont_Example"),
96 "Additional" =>
$lng->txt(
"cont_Additional"),
97 "Special" =>
$lng->txt(
"cont_Special"),
99 "Attention" =>
$lng->txt(
"cont_Attention"),
100 "Background" =>
$lng->txt(
"cont_Background"),
101 "Citation" =>
$lng->txt(
"cont_Citation"),
102 "Confirmation" =>
$lng->txt(
"cont_Confirmation"),
103 "Information" =>
$lng->txt(
"cont_Information"),
104 "Interaction" =>
$lng->txt(
"cont_Interaction"),
105 "Link" =>
$lng->txt(
"cont_Link"),
106 "Literature" =>
$lng->txt(
"cont_Literature"),
107 "Separator" =>
$lng->txt(
"cont_Separator"),
108 "StandardCenter" =>
$lng->txt(
"cont_StandardCenter"),
110 "Excursus" =>
$lng->txt(
"cont_Excursus"),
111 "AdvancedKnowledge" =>
$lng->txt(
"cont_AdvancedKnowledge"));
121 if ($a_style_id > 0 &&
123 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
125 $chars = $style->getCharacteristics(
"section");
126 $new_chars = array();
127 foreach ($chars as $char) {
128 if (($std_chars[$char] ??
"") !=
"") {
129 $new_chars[$char] = $std_chars[$char];
131 $new_chars[$char] = $char;
148 $next_class = $this->ctrl->getNextClass($this);
151 $cmd = $this->ctrl->getCmd();
153 switch ($next_class) {
154 case "ilpropertyformgui":
155 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
157 $this->ctrl->forwardCommand($form);
161 $ret = $this->$cmd();
173 $this->
edit(
true, $a_form);
186 $a_form = $this->
initForm($a_insert);
189 $tpl->setContent($a_form->getHTML());
201 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
203 $form->setFormAction($ilCtrl->getFormAction($this));
205 $form->setTitle($this->lng->txt(
"cont_insert_section"));
207 $form->setTitle($this->lng->txt(
"cont_update_section"));
211 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
213 $this->lng->txt(
"cont_characteristic"),
217 if (is_object($this->content_obj)) {
218 if ($chars[$a_seleted_value] ==
"" && ($this->content_obj->getCharacteristic() !=
"")) {
219 $chars = array_merge(
220 array($this->content_obj->getCharacteristic() => $this->content_obj->getCharacteristic()),
226 $selected = ($a_insert)
228 : $this->content_obj->getCharacteristic();
230 foreach ($chars as $k => $char) {
231 $html =
'<div class="ilCOPgEditStyleSelectionItem"><div class="ilc_section_' . $k .
'" style="' . self::$style_selector_reset .
'">' .
232 $char .
'</div></div>';
233 $char_prop->addOption($k, $char, $html);
236 $char_prop->setValue($selected);
237 $form->addItem($char_prop);
240 include_once
'Services/Form/classes/class.ilLinkInputGUI.php';
247 $ac->setRequired(
false);
248 $ac->setInfo($this->lng->txt(
"copg_sec_link_info"));
249 $ac->setInternalLinkDefault(
253 $link_types = array();
257 $ac->setInternalLinkFilterTypes($link_types);
258 $ac->setFilterWhiteList(
263 $l = $this->content_obj->getLink();
264 if ($l[
"LinkType"] ==
"IntLink") {
265 $ac->setValueByIntLinkAttributes($l[
"Type"], $l[
"Target"], $l[
"TargetFrame"]);
267 if ($l[
"LinkType"] ==
"ExtLink") {
268 $ac->setValue($l[
"Href"]);
277 if (!$a_insert && ($from = $this->content_obj->getActiveFrom()) !=
"") {
280 $dt_prop->setShowTime(
true);
281 $form->addItem($dt_prop);
285 if (!$a_insert && ($to = $this->content_obj->getActiveTo()) !=
"") {
288 $dt_prop->setShowTime(
true);
289 $form->addItem($dt_prop);
293 include_once(
"./Services/Form/classes/class.ilRepositorySelector2InputGUI.php");
300 "read" =>
$lng->txt(
"read"),
301 "write" =>
$lng->txt(
"write"),
302 "visible" =>
$lng->txt(
"visible"),
303 "no_read" =>
$lng->txt(
"cont_no_read")
306 $si->setInfo(
$lng->txt(
"cont_permission_object_desc"));
307 $si->setOptions($options);
311 $si->setValue($this->content_obj->getPermission());
312 $rs->setValue($this->content_obj->getPermissionRefId());
318 $form->addCommandButton(
"create_section",
$lng->txt(
"save"));
319 $form->addCommandButton(
"cancelCreate",
$lng->txt(
"cancel"));
321 $form->addCommandButton(
"update",
$lng->txt(
"save"));
322 $form->addCommandButton(
"cancelUpdate",
$lng->txt(
"cancel"));
334 if ($form->checkInput()) {
336 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
340 $this->updated = $this->pg_obj->update();
341 if ($this->updated ===
true) {
342 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
355 if ($form->checkInput()) {
358 $this->updated = $this->pg_obj->update();
359 if ($this->updated ===
true) {
360 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
364 $this->pg_obj->addHierIDs();
365 $this->
edit(
false, $form);
375 $this->content_obj->setCharacteristic(
$_POST[
"characteristic"]);
377 $from = $form->getItemByPostVar(
"active_from")->getDate();
379 $this->content_obj->setActiveFrom($from->get(
IL_CAL_UNIX));
381 $this->content_obj->setActiveFrom(0);
384 $to = $form->getItemByPostVar(
"active_to")->getDate();
386 $this->content_obj->setActiveTo($to->get(
IL_CAL_UNIX));
388 $this->content_obj->setActiveTo(0);
392 $this->content_obj->setPermissionRefId(
$_POST[
"permission_ref_id"]);
393 $this->content_obj->setPermission(
$_POST[
"permission"]);
396 if (
$_POST[
"link_mode"] ==
"ext" &&
$_POST[
"link"] !=
"") {
397 $this->content_obj->setExtLink(
$_POST[
"link"]);
398 } elseif (
$_POST[
"link_mode"] ==
"int" &&
$_POST[
"link"] !=
"") {
401 $la = $form->getItemByPostVar(
"link")->getIntLinkAttributes();
404 if ($la[
"Type"] !=
"") {
405 $this->content_obj->setIntLink($la[
"Type"], $la[
"Target"], $la[
"TargetFrame"]);
408 $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.
displayValidationError()
display validation errors
insert(ilPropertyFormGUI $a_form=null)
Insert new section form.
getCharacteristics()
Get characteristics.
static _lookupType($a_id, $a_reference=false)
lookup object type
getHTML(array $params)
Get HTML.
__construct(Container $dic, ilPlugin $plugin)
__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id="")
Constructor public.