40 $this->tpl =
$DIC[
"tpl"];
41 $this->
ctrl = $DIC->ctrl();
42 $this->
tabs = $DIC->tabs();
44 $this->
lng = $DIC->language();
46 $cs =
$DIC->contentStyle();
47 $this->content_style_domain = $cs->domain();
55 $this->obj = $a_pg_obj;
56 $this->obj->
setLMId($this->content_object->getId());
65 $next_class = $this->
ctrl->getNextClass($this);
66 $cmd = $this->
ctrl->getCmd();
68 switch ($next_class) {
71 $this->
ctrl->setReturn($this,
"edit");
74 if ($this->requested_totransl ==
"") {
76 $ilCtrl->setParameterByClass(
"illmpagegui",
"totransl", $this->requested_transl);
77 $ilCtrl->redirectByClass(
"illmpagegui",
"switchToLanguage");
79 $page_gui =
new ilLMPageGUI($this->obj->getId(), 0,
false,
"-");
83 $page_gui->setEditPreview(
true);
84 $page_gui->activateMetaDataEditor(
85 $this->content_object,
86 $this->obj->getType(),
92 $page_gui->setEnabledNews(
94 $this->obj->content_object->getId(),
95 $this->obj->content_object->getType()
99 $page_gui->setViewPageLink(
100 ILIAS_HTTP_PATH .
"/goto.php?target=pg_" . $this->obj->getId() .
101 "_" . $this->requested_ref_id
104 $page_gui->setStyleId($this->content_style_domain
105 ->styleForRefId($this->content_object->getRefId())
106 ->getEffectiveStyleId());
107 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
108 $page_gui->getPageObject()->buildDom();
109 $int_links = $page_gui->getPageObject()->getInternalLinks();
111 $page_gui->setLinkXml($link_xml);
113 $page_gui->setFileDownloadLink(
"ilias.php?cmd=downloadFile&ref_id=" . $this->requested_ref_id .
"&baseClass=ilLMPresentationGUI");
114 $page_gui->setFullscreenLink(
"ilias.php?cmd=fullscreen&ref_id=" . $this->requested_ref_id .
"&baseClass=ilLMPresentationGUI");
115 $page_gui->setLinkParams(
"ref_id=" . $this->content_object->getRefId());
116 $page_gui->setSourcecodeDownloadScript(
"ilias.php?ref_id=" . $this->requested_ref_id .
"&baseClass=ilLMPresentationGUI");
117 $page_gui->setPresentationTitle(
120 $this->content_object->getPageHeader(),
121 $this->content_object->isActiveNumbering(),
125 $page_gui->getLanguage()
129 $page_gui->setHeader($this->
lng->txt(
"page") .
": " . $this->obj->getTitle());
130 $page_gui->setActivationListener($this,
"activatePage");
132 $up_gui =
"ilobjlearningmodulegui";
133 $ilCtrl->setParameterByClass($up_gui,
"active_node", $this->obj->getId());
136 $tpl->
setTitle($this->
lng->txt(
"page") .
": " . $this->obj->getTitle());
137 if ($this->content_object->getLayoutPerPage()) {
138 $page_gui->setTabHook($this,
"addPageTabs");
140 $ret = $this->
ctrl->forwardCommand($page_gui);
158 $this->
ctrl->redirectByClass(ilLMPageGUI::class,
"edit");
166 $this->
ctrl->redirectByClass(ilLMPageGUI::class,
"preview");
175 if ($this->requested_obj_id != 0) {
177 "ilStructureObjectGUI",
183 $up_gui =
"ilobjlearningmodulegui";
184 $this->
ctrl->redirectByClass($up_gui,
"pages");
192 $link_info =
"<IntLinkInfos>";
193 foreach ($a_int_links as $int_link) {
194 $target = $int_link[
"Target"];
198 if (substr($target, 0, 4) ==
"il__") {
199 $target_arr = explode(
"_", $target);
200 $target_id = $target_arr[count($target_arr) - 1];
201 $type = $int_link[
"Type"];
202 $targetframe = ($int_link[
"TargetFrame"] !=
"")
203 ? $int_link[
"TargetFrame"]
207 $anc = $anc_add =
"";
208 if (($int_link[
"Anchor"] ??
"") !=
"") {
209 $anc = $int_link[
"Anchor"];
210 $anc_add =
"_" . rawurlencode($int_link[
"Anchor"]);
215 case "StructureObject":
218 if ($lm_id == $cont_obj->getId()) {
220 if ($type ==
"PageObject") {
221 $this->
ctrl->setParameter($this,
"obj_id", $target_id);
222 $href = $this->
ctrl->getLinkTargetByClass(
230 $this->
ctrl->setParameterByClass(
"ilstructureobjectgui",
"obj_id", $target_id);
231 $href = $this->
ctrl->getLinkTargetByClass(
232 "ilstructureobjectgui",
239 $href = str_replace(
"&",
"&", $href);
240 $this->
ctrl->setParameter($this,
"obj_id", $this->requested_obj_id);
242 if ($type ==
"PageObject") {
243 $href =
"goto.php?target=pg_" . $target_id . $anc_add;
245 $href =
"goto.php?target=st_" . $target_id;
247 $ltarget =
"ilContObj" . $lm_id;
255 $ltarget = $nframe =
"_blank";
256 $href =
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&" .
257 "obj_type=$type&cmd=glossary&ref_id=" . $this->requested_ref_id .
258 "&obj_id=" . $target_id .
"&frame=$nframe";
262 $ltarget = $nframe =
"_blank";
263 $href =
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&obj_type=$type&cmd=media&ref_id=" . $this->requested_ref_id .
264 "&mob_id=" . $target_id .
"&frame=$nframe";
267 case "RepositoryItem":
270 $href =
"./goto.php?target=" . $obj_type .
"_" . $target_id;
276 $this->
ctrl->setParameter($this,
"file_id",
"il__file_" . $target_id);
277 $href = $this->
ctrl->getLinkTarget(
284 $this->
ctrl->setParameter($this,
"file_id",
null);
293 if ($obj_type ==
"usr") {
294 $back = $this->
ctrl->getLinkTarget(
302 $this->
ctrl->setParameterByClass(PublicProfileGUI::class,
"user_id", $target_id);
303 $this->
ctrl->setParameterByClass(
304 PublicProfileGUI::class,
310 $href = $this->
ctrl->getLinkTargetByClass(
311 PublicProfileGUI::class,
318 $this->
ctrl->setParameterByClass(PublicProfileGUI::class,
"user_id",
null);
325 $anc_par =
'Anchor="' . $anc .
'"';
326 $link_info .=
"<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
327 "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
331 $link_info .=
"</IntLinkInfos>";
338 public static function _goto(
string $a_target): void
341 $main_tpl =
$DIC->ui()->mainTemplate();
345 $ilAccess =
$DIC->access();
350 $first = strpos($a_target,
"_");
351 $second = strpos($a_target,
"_", $first + 1);
353 $page_id = substr($a_target, 0, $first);
355 $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
356 $anchor = substr($a_target, $second + 1);
358 $ref_id = substr($a_target, $first + 1);
361 $page_id = $a_target;
371 if (in_array(
$ref_id, $ref_ids)) {
372 $ref_ids = array_merge(array(
$ref_id), $ref_ids);
376 foreach ($ref_ids as
$ref_id) {
378 if ($ilAccess->checkAccess(
"read",
"",
$ref_id)) {
388 $main_tpl->setOnScreenMessage(
'failure', sprintf(
389 $lng->
txt(
"msg_no_perm_read_item"),
394 $main_tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"page_does_not_exist"),
true);
412 $page_gui->setEditPreview(
true);
413 $page_gui->activateMetaDataEditor(
414 $this->content_object,
415 $this->obj->getType(),
420 $page_gui->setActivationListener($this,
"activatePage");
421 $page_gui->setTabHook($this,
"addPageTabs");
424 $tpl->
setTitle($this->
lng->txt(
"page") .
": " . $this->obj->getTitle());
425 $ilCtrl->getHTML($page_gui);
426 $ilTabs->setTabActive(
"cont_layout");
442 if (is_file($im =
ilUtil::getImagePath(
"layout_" . $this->content_object->getLayout() .
".png"))) {
443 $im_tag =
ilUtil::img($im, $this->content_object->getLayout());
445 $layout->addOption(
new ilRadioOption(
"<table><tr><td>" . $im_tag .
"</td><td><strong>" .
446 $lng->
txt(
"cont_lm_default_layout") .
447 "</strong>: " .
$lng->
txt(
"cont_layout_" . $this->content_object->getLayout()) .
448 "</td></tr></table>",
""));
455 $layout->addOption(
new ilRadioOption(
"<table><tr><td>" . $im_tag .
"</td><td><strong>" .
456 $lng->
txt(
"cont_layout_" . $l) .
"</strong>: " .
$lng->
txt(
"cont_layout_" . $l .
"_desc") .
457 "</td></tr></table>", $l));
460 $layout->setValue($this->obj->getLayout());
461 $this->
form->addItem($layout);
463 $this->
form->addCommandButton(
"saveLayout",
$lng->
txt(
"save"));
465 $this->
form->setTitle(
$lng->
txt(
"cont_page_layout"));
466 $this->
form->setFormAction($ilCtrl->getFormAction($this));
476 if ($this->
form->checkInput()) {
478 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
479 $ilCtrl->redirect($this,
"editLayout");
481 $this->
form->setValuesByPost();
492 $ilCtrl->getLinkTarget($this,
'editLayout'),
502 $pg_obj = $this->obj->getPageObject();
504 $int_links = $pg_obj->getInternalLinks();
505 foreach ($int_links as $il) {
506 if ($il[
"Target"] == str_replace(
509 $this->request->getFileId()
511 $file = explode(
"_", $this->request->getFileId());
512 $file_id = (
int) $file[count($file) - 1];
513 $fileObj =
new ilObjFile($file_id,
false);
514 $fileObj->sendFile();
532 $this->tpl->setContent(
$ui->renderer()->render(
$form) . self::getLayoutCssFix());
542 $fields[
"title"] =
$f->input()->field()->text(
$lng->
txt(
"title"),
"");
544 $fields[
"description"] =
$f->input()->field()->textarea(
$lng->
txt(
"description"));
548 $fields[
"layout_id"] = $ts;
552 $section1 =
$f->input()->field()->section($fields,
$lng->
txt(
"cont_insert_pagelayout"));
555 return $f->input()->container()->form()->standard($form_action, [
"sec" => $section1]);
569 if (
$request->getMethod() ==
"POST") {
573 $layout_id = (
int) (
$data[
"layout_id"] ?? 0);
576 $this->obj->setType(
"pg");
579 $this->obj->setLMId($this->content_object->getId());
580 if ($layout_id > 0) {
581 $this->obj->create(
false,
false, $layout_id);
583 $this->obj->create();
585 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"cont_page_created"),
true);
598 .form-control.il-input-radiooption > label {
599 vertical-align: middle;
601 .form-control.il-input-radiooption > .help-block {
GUI class for public user profile presentation.
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
Base class for ilStructureObjects and ilPageObjects (see ILIAS DTD)
EditingGUIRequest $request
ilGlobalTemplateInterface $tpl
ilObjLearningModule $content_object
static writeLayout(int $a_obj_id, string $a_layout, ?ilObjLearningModule $a_lm=null)
Write layout setting.
static _lookupContObjID(int $a_id)
get learning module id for lm object
Extension of ilPageObjectGUI for learning modules.
User Interface for Learning Module Page Objects Editing.
static _goto(string $a_target)
redirect script
editLayout()
Edit layout of page.
getLinkXML(array $a_int_links)
get link targets
preview()
display content of page (edit view)
__construct(ilObjLearningModule $a_content_obj)
constructor
downloadFile()
download file of file lists
setLMPageObject(ilLMPageObject $a_pg_obj)
Set content object dependent page object (co page)
static getLayoutCssFix()
Get layout css fix (workaround for broken radio options)
create()
structure / page object creation form
ILIAS Style Content DomainService $content_style_domain
edit()
display content of page (edit view)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getPresentationTitle(int $a_pg_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
loadLanguageModule(string $a_module)
Load language module.
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...
static getAvailableLayouts()
get all available lm layouts
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
This class represents an option in a radio group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setBackTarget(string $a_title, string $a_target, string $a_frame="")
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
static hasPublicProfile(int $a_user_id)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static redirect(string $a_script)
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static getGotoForWikiPageTarget(string $a_target, bool $a_offline=false)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setContent(string $a_html)
Sets content for standard template.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
form( $class_path, string $cmd, string $submit_caption="")