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")
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_char_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"));
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
237 $ilCtrl = $this->ctrl;
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"),
254 $chars = $this->getCharacteristics();
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) {
274 $char_prop->setValue($selected);
275 $form->addItem($char_prop);
282 if ($this->getPageConfig()->getEnableInternalLinks()) {
287 $ac->setRequired(
true);
288 $ac->setInfo($this->
lng->txt(
"copg_sec_link_info"));
289 $ac->setInternalLinkDefault(
290 $this->getPageConfig()->getIntLinkHelpDefaultType(),
291 $this->getPageConfig()->getIntLinkHelpDefaultId()
293 $link_types = array();
294 foreach ($this->getPageConfig()->getIntLinkFilters() as
$f) {
297 $ac->setInternalLinkFilterTypes($link_types);
298 $ac->setFilterWhiteList(
299 $this->getPageConfig()->getIntLinkFilterWhiteList()
303 $l = $this->content_obj->getLink();
304 if ($l[
"LinkType"] ==
"IntLink") {
305 $target_frame = $l[
"TargetFrame"];
306 if (trim($target_frame) ===
"") {
307 $target_frame = trim($l[
"Anchor"]);
309 $ac->setValueByIntLinkAttributes($l[
"Type"], $l[
"Target"], $target_frame);
310 $cb->setChecked(
true);
311 } elseif ($l[
"LinkType"] ==
"ExtLink") {
312 $ac->setValue($l[
"Href"]);
313 $cb->setChecked(
true);
315 $ac->setValue(
"https://");
318 $ac->setValue(
"https://");
321 $ac->setParentForm($form);
322 $cb->addSubItem($ac);
329 $form->addItem($act_cb);
331 if (!$a_insert && ($from = $this->content_obj->getActiveFrom()) > 0) {
333 $act_cb->setChecked(
true);
335 $dt_prop->setShowTime(
true);
336 $act_cb->addSubItem($dt_prop);
340 if (!$a_insert && ($to = $this->content_obj->getActiveTo()) > 0) {
342 $act_cb->setChecked(
true);
344 $dt_prop->setShowTime(
true);
345 $act_cb->addSubItem($dt_prop);
348 if ($this->getPageConfig()->getEnablePermissionChecks()) {
350 $form->addItem($perm_cb);
354 $rs->setParentForm($form);
355 $rs->setRequired(
true);
356 $perm_cb->addSubItem($rs);
360 "read" =>
$lng->txt(
"read"),
361 "write" =>
$lng->txt(
"write"),
362 "visible" =>
$lng->txt(
"visible"),
363 "no_read" =>
$lng->txt(
"cont_no_read")
366 $si->setInfo(
$lng->txt(
"cont_permission_object_desc"));
368 $perm_cb->addSubItem($si);
371 $si->setValue($this->content_obj->getPermission());
372 $rs->setValue($this->content_obj->getPermissionRefId());
373 if ($this->content_obj->getPermissionRefId() > 0) {
374 $perm_cb->setChecked(
true);
382 $cb->setInfo($this->getPageConfig()->getSectionProtectionInfo());
384 $cb->setChecked($this->content_obj->getProtected());
391 $form->addCommandButton(
"create",
$lng->txt(
"save"));
392 $form->addCommandButton(
"cancelCreate",
$lng->txt(
"cancel"));
394 $form->addCommandButton(
"update",
$lng->txt(
"save"));
395 $form->addCommandButton(
"cancelUpdate",
$lng->txt(
"cancel"));
402 $form = $this->initForm(
true);
403 if ($form->checkInput()) {
404 $this->content_obj =
new ilPCSection($this->getPage());
405 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
407 $this->setValuesFromForm($form);
409 $this->updated = $this->pg_obj->update();
410 if ($this->updated ===
true) {
411 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
415 $this->insert($form);
420 $form = $this->initForm(
false);
421 if ($form->checkInput()) {
422 $this->setValuesFromForm($form);
424 $this->updated = $this->pg_obj->update();
425 if ($this->updated ===
true) {
426 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
430 $this->pg_obj->addHierIDs();
431 $this->edit(
false, $form);
436 $this->content_obj->setCharacteristic($form->
getInput(
"characteristic"));
438 $activation = (bool) $form->
getInput(
"activation");
440 if ($activation && $from) {
441 $this->content_obj->setActiveFrom($from->get(
IL_CAL_UNIX));
443 $this->content_obj->setActiveFrom(0);
447 if ($activation && $to) {
448 $this->content_obj->setActiveTo($to->get(
IL_CAL_UNIX));
450 $this->content_obj->setActiveTo(0);
453 if ($this->getPageConfig()->getEnablePermissionChecks()) {
454 $permission_handling = (bool) $form->
getInput(
"permission_handling");
455 if ($permission_handling) {
456 $this->content_obj->setPermissionRefId((
int) $form->
getInput(
"permission_ref_id"));
457 $this->content_obj->setPermission($form->
getInput(
"permission"));
459 $this->content_obj->setPermissionRefId(0);
460 $this->content_obj->setPermission(
"");
464 if ($form->
getInput(
"link_cb") !==
"") {
465 if ($form->
getInput(
"link_mode") ==
"ext" && $form->
getInput(
"link") !=
"") {
466 $this->content_obj->setExtLink($form->
getInput(
"link"));
467 } elseif ($form->
getInput(
"link_mode") ==
"int" && $form->
getInput(
"link") !=
"") {
469 if (($la[
"Type"] ??
"") !=
"") {
471 if (trim($la[
"TargetFrame"]) !==
"" &&
472 !in_array($la[
"TargetFrame"], [
"Media",
"FAQ",
"Glossary",
"New"])) {
473 $anchor = trim($la[
"TargetFrame"]);
474 $la[
"TargetFrame"] =
"";
476 $this->content_obj->setIntLink($la[
"Type"], $la[
"Target"], $la[
"TargetFrame"], $anchor);
479 $this->content_obj->setNoLink();
482 $this->content_obj->setNoLink();
486 $this->content_obj->setProtected($form->
getInput(
"protected"));
@classDescription Date and time handling
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...
getCharacteristics(string $a_type="", bool $a_no_hidden=false, bool $a_include_core=true)
Get characteristics.
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setValuesFromForm(ilPropertyFormGUI $form)
initForm(bool $a_insert=false)
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj=null, string $a_hier_id="", string $a_pc_id="")
edit(bool $a_insert=false, ?ilPropertyFormGUI $a_form=null)
insert(?ilPropertyFormGUI $a_form=null)
checkInput(ilPropertyFormGUI $form)
static _getCharacteristics(int $a_style_id)
static _getStandardCharacteristics()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const SEC_PROTECT_EDITABLE
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
ilPageContent $content_obj
ilGlobalTemplateInterface $tpl
Style Content CharacteristicManager $char_manager
setCharacteristics(array $a_chars)
Content object of ilPageObject (see ILIAS DTD).
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
setContent(string $a_html)
Sets content for standard template.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc