29 string $a_hier_id =
"",
34 $this->tpl = $DIC[
"tpl"];
35 $this->
lng = $DIC->language();
36 $this->
ctrl = $DIC->ctrl();
46 if ($params[
"form"] ==
true) {
48 $form = $this->
initForm($params[
"insert"] ??
false);
49 $form->setShowTopButtons(
false);
52 $char = $form->getItemByPostVar(
"characteristic");
55 $from = $form->getItemByPostVar(
"active_from");
56 $from->setSideBySide(
false);
57 $onload_code = array_merge($onload_code, $from->getOnloadCode());
59 $to = $form->getItemByPostVar(
"active_to");
60 $to->setSideBySide(
false);
61 $onload_code = array_merge($onload_code, $to->getOnloadCode());
63 $link = $form->getItemByPostVar(
"link");
64 $onload_code = array_merge($onload_code, $link->getOnloadCode());
66 $rep_sel = $form->getItemByPostVar(
"permission_ref_id");
70 $exp = $rep_sel->getExplorerGUI();
71 $this->
ctrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar",
"permission_ref_id");
72 $onload_code = array_merge($onload_code, [$exp->getOnloadCode()]);
74 $this->
ctrl->setParameterByClass(
"ilformpropertydispatchgui",
"postvar",
"");
75 $onload_code = array_merge($onload_code, $rep_sel->getOnloadCode());
78 if (($params[
"validation"] ??
false) ===
true) {
80 $form->setValuesByPost();
83 $html = $params[
"ui_wrapper"]->getRenderedForm(
89 implode(
"\n", $onload_code) .
105 $this->
lng->txt(
"copg_active_to_small")
117 $lng = $DIC->language();
119 return array(
"Block" =>
$lng->
txt(
"cont_Block"),
120 "Mnemonic" =>
$lng->
txt(
"cont_Mnemonic"),
121 "Remark" =>
$lng->
txt(
"cont_Remark"),
122 "Example" =>
$lng->
txt(
"cont_Example"),
123 "Additional" =>
$lng->
txt(
"cont_Additional"),
124 "Special" =>
$lng->
txt(
"cont_Special"),
126 "Attention" =>
$lng->
txt(
"cont_Attention"),
127 "Background" =>
$lng->
txt(
"cont_Background"),
128 "Citation" =>
$lng->
txt(
"cont_Citation"),
129 "Confirmation" =>
$lng->
txt(
"cont_Confirmation"),
130 "Information" =>
$lng->
txt(
"cont_Information"),
131 "Interaction" =>
$lng->
txt(
"cont_Interaction"),
132 "Link" =>
$lng->
txt(
"cont_Link"),
133 "Literature" =>
$lng->
txt(
"cont_Literature"),
134 "Separator" =>
$lng->
txt(
"cont_Separator"),
135 "StandardCenter" =>
$lng->
txt(
"cont_StandardCenter"),
137 "Excursus" =>
$lng->
txt(
"cont_Excursus"),
138 "AdvancedKnowledge" =>
$lng->
txt(
"cont_AdvancedKnowledge"));
145 $service = $DIC->contentStyle()->internal();
146 $request = $DIC->copage()->internal()
151 $access_manager =
$service->domain()->access(
153 $DIC->user()->getId()
162 if ($a_style_id > 0 &&
166 $new_chars = array();
167 foreach (
$chars as $char) {
171 if (($std_chars[$char] ??
"") !=
"") {
172 $new_chars[$char] = $std_chars[$char];
174 $new_chars[$char] = $char;
194 $next_class = $this->
ctrl->getNextClass($this);
197 $cmd = $this->
ctrl->getCmd();
199 switch ($next_class) {
200 case "ilpropertyformgui":
202 $this->
ctrl->forwardCommand($form);
206 $ret = $this->$cmd();
215 $this->
edit(
true, $a_form);
219 bool $a_insert =
false,
227 $a_form = $this->
initForm($a_insert);
234 bool $a_insert =
false 238 $a_seleted_value =
"";
242 $form->setFormAction($ilCtrl->getFormAction($this));
244 $form->setTitle($this->
lng->txt(
"cont_insert_section"));
246 $form->setTitle($this->
lng->txt(
"cont_update_section"));
251 $this->
lng->txt(
"cont_characteristic"),
255 if (is_object($this->content_obj)) {
256 if (($chars[$a_seleted_value] ??
"") ==
"" && ($this->content_obj->getCharacteristic() !=
"")) {
257 $chars = array_merge(
258 array($this->content_obj->getCharacteristic() => $this->content_obj->getCharacteristic()),
264 $selected = ($a_insert)
266 : $this->content_obj->getCharacteristic();
269 foreach ($chars as $k => $char) {
270 $options[$k] = $char;
272 $char_prop->setOptions($options);
274 $char_prop->setValue($selected);
275 $form->addItem($char_prop);
288 $ac->
setInfo($this->
lng->txt(
"copg_sec_link_info"));
289 $ac->setInternalLinkDefault(
293 $link_types = array();
297 $ac->setInternalLinkFilterTypes($link_types);
298 $ac->setFilterWhiteList(
303 $l = $this->content_obj->getLink();
304 if ($l[
"LinkType"] ==
"IntLink") {
305 $ac->setValueByIntLinkAttributes($l[
"Type"], $l[
"Target"], $l[
"TargetFrame"]);
307 } elseif ($l[
"LinkType"] ==
"ExtLink") {
309 $cb->setChecked(
true);
318 $cb->addSubItem($ac);
325 $form->addItem($act_cb);
327 if (!$a_insert && ($from = $this->content_obj->getActiveFrom()) > 0) {
329 $act_cb->setChecked(
true);
331 $dt_prop->setShowTime(
true);
332 $act_cb->addSubItem($dt_prop);
336 if (!$a_insert && ($to = $this->content_obj->getActiveTo()) > 0) {
338 $act_cb->setChecked(
true);
340 $dt_prop->setShowTime(
true);
341 $act_cb->addSubItem($dt_prop);
346 $form->addItem($perm_cb);
350 $rs->setParentForm($form);
351 $rs->setRequired(
true);
352 $perm_cb->addSubItem($rs);
358 "visible" =>
$lng->
txt(
"visible"),
359 "no_read" =>
$lng->
txt(
"cont_no_read")
363 $si->setOptions($options);
364 $perm_cb->addSubItem($si);
367 $si->setValue($this->content_obj->getPermission());
368 $rs->setValue($this->content_obj->getPermissionRefId());
369 if ($this->content_obj->getPermissionRefId() > 0) {
370 $perm_cb->setChecked(
true);
378 $cb->setInfo($this->
getPageConfig()->getSectionProtectionInfo());
380 $cb->setChecked($this->content_obj->getProtected());
387 $form->addCommandButton(
"create",
$lng->
txt(
"save"));
388 $form->addCommandButton(
"cancelCreate",
$lng->
txt(
"cancel"));
390 $form->addCommandButton(
"update",
$lng->
txt(
"save"));
391 $form->addCommandButton(
"cancelUpdate",
$lng->
txt(
"cancel"));
399 if ($form->checkInput()) {
401 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
405 $this->updated = $this->pg_obj->update();
406 if ($this->updated ===
true) {
407 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
417 if ($form->checkInput()) {
420 $this->updated = $this->pg_obj->update();
421 if ($this->updated ===
true) {
422 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
426 $this->pg_obj->addHierIDs();
427 $this->
edit(
false, $form);
432 $this->content_obj->setCharacteristic($form->
getInput(
"characteristic"));
434 $activation = (bool) $form->
getInput(
"activation");
436 if ($activation && $from) {
437 $this->content_obj->setActiveFrom($from->get(
IL_CAL_UNIX));
439 $this->content_obj->setActiveFrom(0);
443 if ($activation && $to) {
444 $this->content_obj->setActiveTo($to->get(
IL_CAL_UNIX));
446 $this->content_obj->setActiveTo(0);
450 $permission_handling = (bool) $form->
getInput(
"permission_handling");
451 if ($permission_handling) {
452 $this->content_obj->setPermissionRefId((
int) $form->
getInput(
"permission_ref_id"));
453 $this->content_obj->setPermission($form->
getInput(
"permission"));
455 $this->content_obj->setPermissionRefId(0);
456 $this->content_obj->setPermission(
"");
460 if ($form->
getInput(
"link_cb") !==
"") {
461 if ($form->
getInput(
"link_mode") ==
"ext" && $form->
getInput(
"link") !=
"") {
462 $this->content_obj->setExtLink($form->
getInput(
"link"));
463 } elseif ($form->
getInput(
"link_mode") ==
"int" && $form->
getInput(
"link") !=
"") {
465 if (($la[
"Type"] ??
"") !=
"") {
466 $this->content_obj->setIntLink($la[
"Type"], $la[
"Target"], $la[
"TargetFrame"]);
469 $this->content_obj->setNoLink();
472 $this->content_obj->setNoLink();
476 $this->content_obj->setProtected($form->
getInput(
"protected"));
initForm(bool $a_insert=false)
ilPageContent $content_obj
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
const SEC_PROTECT_EDITABLE
static _getStandardCharacteristics()
setContent(string $a_html)
Sets content for standard template.
setCharacteristics(array $a_chars)
insert(?ilPropertyFormGUI $a_form=null)
static _getCharacteristics(int $a_style_id)
Content object of ilPageObject (see ILIAS DTD).
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj=null, string $a_hier_id="", string $a_pc_id="")
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
Style Content CharacteristicManager $char_manager
edit(bool $a_insert=false, ?ilPropertyFormGUI $a_form=null)
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
ilGlobalTemplateInterface $tpl
checkInput(ilPropertyFormGUI $form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCharacteristics(string $a_type="", bool $a_no_hidden=false, bool $a_include_core=true)
Get characteristics.
__construct(Container $dic, ilPlugin $plugin)
static _lookupType(int $id, bool $reference=false)
setValuesFromForm(ilPropertyFormGUI $form)