39         $this->tpl = $DIC[
"tpl"];
    40         $this->
ctrl = $DIC->ctrl();
    41         $this->
tabs = $DIC->tabs();
    43         $this->
lng = $DIC->language();
    45         $cs = $DIC->contentStyle();
    46         $this->content_style_domain = $cs->domain();
    54         $this->obj = $a_pg_obj;
    55         $this->obj->
setLMId($this->content_object->getId());
    64         $next_class = $this->
ctrl->getNextClass($this);
    65         $cmd = $this->
ctrl->getCmd();
    67         switch ($next_class) {
    72                 $this->
ctrl->setReturn($this, 
"edit");
    75                     if ($this->requested_totransl == 
"") {
    77                         $ilCtrl->setParameterByClass(
"illmpagegui", 
"totransl", $this->requested_transl);
    78                         $ilCtrl->redirectByClass(
"illmpagegui", 
"switchToLanguage");
    80                     $ilCtrl->setCmdClass(
"illmpagegui");
    81                     $page_gui = 
new ilLMPageGUI($this->obj->getId(), 0, 
false, 
"-");
    86                 $page_gui->activateMetaDataEditor(
    87                     $this->content_object,
    88                     $this->obj->getType(),
    94                     $page_gui->setEnabledNews(
    96                         $this->obj->content_object->getId(),
    97                         $this->obj->content_object->getType()
   101                 $page_gui->setViewPageLink(
   102                     ILIAS_HTTP_PATH . 
"/goto.php?target=pg_" . $this->obj->getId() .
   106                 $page_gui->setStyleId($this->content_style_domain
   107                     ->styleForRefId($this->content_object->getRefId())
   108                     ->getEffectiveStyleId());
   109                 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
   110                 $page_gui->getPageObject()->buildDom();
   111                 $int_links = $page_gui->getPageObject()->getInternalLinks();
   113                 $page_gui->setLinkXml($link_xml);
   115                 $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
   116                 $page_gui->setFileDownloadLink(
"ilias.php?cmd=downloadFile&ref_id=" . $this->requested_ref_id . 
"&baseClass=ilLMPresentationGUI");
   117                 $page_gui->setFullscreenLink(
"ilias.php?cmd=fullscreen&ref_id=" . $this->requested_ref_id . 
"&baseClass=ilLMPresentationGUI");
   118                 $page_gui->setLinkParams(
"ref_id=" . $this->content_object->getRefId());
   119                 $page_gui->setSourcecodeDownloadScript(
"ilias.php?ref_id=" . $this->requested_ref_id . 
"&baseClass=ilLMPresentationGUI");
   120                 $page_gui->setPresentationTitle(
   123                         $this->content_object->getPageHeader(),
   124                         $this->content_object->isActiveNumbering(),
   128                         $page_gui->getLanguage()
   132                 $page_gui->setHeader($this->
lng->txt(
"page") . 
": " . $this->obj->getTitle());
   133                 $page_gui->setActivationListener($this, 
"activatePage");
   135                 $up_gui = 
"ilobjlearningmodulegui";
   136                 $ilCtrl->setParameterByClass($up_gui, 
"active_node", $this->obj->getId());
   139                 $tpl->
setTitle($this->
lng->txt(
"page") . 
": " . $this->obj->getTitle());
   140                 if ($this->content_object->getLayoutPerPage()) {
   141                     $page_gui->setTabHook($this, 
"addPageTabs");
   143                 $ret = $this->
ctrl->forwardCommand($page_gui);
   161         $this->
ctrl->setCmdClass(
"ilLMPageGUI");
   162         $this->
ctrl->setCmd(
"edit");
   171         $this->
ctrl->setCmdClass(
"ilLMPageGUI");
   172         $this->
ctrl->setCmd(
"preview");
   182         if ($this->requested_obj_id != 0) {
   184                 "ilStructureObjectGUI",
   190         $up_gui = 
"ilobjlearningmodulegui";
   191         $this->
ctrl->redirectByClass($up_gui, 
"pages");
   199         $link_info = 
"<IntLinkInfos>";
   200         foreach ($a_int_links as $int_link) {
   201             $target = $int_link[
"Target"];
   205             if (substr($target, 0, 4) == 
"il__") {
   206                 $target_arr = explode(
"_", $target);
   207                 $target_id = $target_arr[count($target_arr) - 1];
   208                 $type = $int_link[
"Type"];
   209                 $targetframe = ($int_link[
"TargetFrame"] != 
"")
   210                     ? $int_link[
"TargetFrame"]
   214                 $anc = $anc_add = 
"";
   215                 if (($int_link[
"Anchor"] ?? 
"") != 
"") {
   216                     $anc = $int_link[
"Anchor"];
   217                     $anc_add = 
"_" . rawurlencode($int_link[
"Anchor"]);
   222                     case "StructureObject":
   225                         if ($lm_id == $cont_obj->getId()) {
   227                             if ($type == 
"PageObject") {
   228                                 $this->
ctrl->setParameter($this, 
"obj_id", $target_id);
   229                                 $href = $this->
ctrl->getLinkTargetByClass(
   237                                 $this->
ctrl->setParameterByClass(
"ilstructureobjectgui", 
"obj_id", $target_id);
   238                                 $href = $this->
ctrl->getLinkTargetByClass(
   239                                     "ilstructureobjectgui",
   246                             $href = str_replace(
"&", 
"&", $href);
   247                             $this->
ctrl->setParameter($this, 
"obj_id", $this->requested_obj_id);
   249                             if ($type == 
"PageObject") {
   250                                 $href = 
"goto.php?target=pg_" . $target_id . $anc_add;
   252                                 $href = 
"goto.php?target=st_" . $target_id;
   254                             $ltarget = 
"ilContObj" . $lm_id;
   262                         $ltarget = $nframe = 
"_blank";
   263                         $href = 
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&" .
   264                             "obj_type=$type&cmd=glossary&ref_id=" . $this->requested_ref_id .
   265                             "&obj_id=" . $target_id . 
"&frame=$nframe";
   269                         $ltarget = $nframe = 
"_blank";
   270                         $href = 
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&obj_type=$type&cmd=media&ref_id=" . $this->requested_ref_id .
   271                             "&mob_id=" . $target_id . 
"&frame=$nframe";
   274                     case "RepositoryItem":
   277                         $href = 
"./goto.php?target=" . $obj_type . 
"_" . $target_id;
   283                         $this->
ctrl->setParameter($this, 
"file_id", 
"il__file_" . $target_id);
   284                         $href = $this->
ctrl->getLinkTarget(
   291                         $this->
ctrl->setParameter($this, 
"file_id", null);
   300                         if ($obj_type == 
"usr") {
   301                             $back = $this->
ctrl->getLinkTarget(
   309                             $this->
ctrl->setParameterByClass(
"ilpublicuserprofilegui", 
"user_id", $target_id);
   310                             $this->
ctrl->setParameterByClass(
   311                                 "ilpublicuserprofilegui",
   317                                 $href = $this->
ctrl->getLinkTargetByClass(
   318                                     "ilpublicuserprofilegui",
   325                             $this->
ctrl->setParameterByClass(
"ilpublicuserprofilegui", 
"user_id", null);
   332                     $anc_par = 
'Anchor="' . $anc . 
'"';
   333                     $link_info .= 
"<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
   334                         "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
   338         $link_info .= 
"</IntLinkInfos>";
   351             $this->content_object->getType() . 
":pg",
   360     public static function _goto(
string $a_target): void
   363         $main_tpl = $DIC->ui()->mainTemplate();
   366         $lng = $DIC->language();
   367         $ilAccess = $DIC->access();
   368         $ctrl = $DIC->ctrl();
   372         $first = strpos($a_target, 
"_");
   373         $second = strpos($a_target, 
"_", $first + 1);
   375             $page_id = substr($a_target, 0, $first);
   377                 $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
   378                 $anchor = substr($a_target, $second + 1);
   380                 $ref_id = substr($a_target, $first + 1);
   383             $page_id = $a_target;
   393         if (in_array(
$ref_id, $ref_ids)) {
   394             $ref_ids = array_merge(array(
$ref_id), $ref_ids);
   398         foreach ($ref_ids as 
$ref_id) {
   400             if ($ilAccess->checkAccess(
"read", 
"", $ref_id)) {
   410                 $main_tpl->setOnScreenMessage(
'failure', sprintf(
   411                     $lng->
txt(
"msg_no_perm_read_item"),
   416                 $main_tpl->setOnScreenMessage(
'failure', 
$lng->
txt(
"page_does_not_exist"), 
true);
   435         $page_gui->activateMetaDataEditor(
   436             $this->content_object,
   437             $this->obj->getType(),
   442         $page_gui->setActivationListener($this, 
"activatePage");
   443         $page_gui->setTabHook($this, 
"addPageTabs");
   446         $tpl->
setTitle($this->
lng->txt(
"page") . 
": " . $this->obj->getTitle());
   447         $ilCtrl->getHTML($page_gui);
   448         $ilTabs->setTabActive(
"cont_layout");
   464         if (is_file($im = 
ilUtil::getImagePath(
"layout_" . $this->content_object->getLayout() . 
".png"))) {
   465             $im_tag = 
ilUtil::img($im, $this->content_object->getLayout());
   467         $layout->addOption(
new ilRadioOption(
"<table><tr><td>" . $im_tag . 
"</td><td><strong>" .
   468             $lng->
txt(
"cont_lm_default_layout") .
   469             "</strong>: " . 
$lng->
txt(
"cont_layout_" . $this->content_object->getLayout()) .
   470             "</td></tr></table>", 
""));
   477             $layout->addOption(
new ilRadioOption(
"<table><tr><td>" . $im_tag . 
"</td><td><strong>" .
   478                 $lng->
txt(
"cont_layout_" . $l) . 
"</strong>: " . 
$lng->
txt(
"cont_layout_" . $l . 
"_desc") .
   479                 "</td></tr></table>", $l));
   482         $layout->setValue($this->obj->getLayout());
   483         $this->
form->addItem($layout);
   485         $this->
form->addCommandButton(
"saveLayout", 
$lng->
txt(
"save"));
   487         $this->
form->setTitle(
$lng->
txt(
"cont_page_layout"));
   488         $this->
form->setFormAction($ilCtrl->getFormAction($this));
   498         if ($this->
form->checkInput()) {
   500             $this->tpl->setOnScreenMessage(
'success', 
$lng->
txt(
"msg_obj_modified"), 
true);
   501             $ilCtrl->redirect($this, 
"editLayout");
   503         $this->
form->setValuesByPost();
   514             $ilCtrl->getLinkTarget($this, 
'editLayout'),
   524         $pg_obj = $this->obj->getPageObject();
   526         $int_links = $pg_obj->getInternalLinks();
   527         foreach ($int_links as $il) {
   528             if ($il[
"Target"] == str_replace(
   531                 $this->request->getFileId()
   533                 $file = explode(
"_", $this->request->getFileId());
   534                 $file_id = (
int) $file[count($file) - 1];
   535                 $fileObj = 
new ilObjFile($file_id, 
false);
   536                 $fileObj->sendFile();
   554         $this->tpl->setContent(
$ui->renderer()->render($form) . self::getLayoutCssFix());
   564         $fields[
"title"] = 
$f->input()->field()->text(
$lng->
txt(
"title"), 
"");
   566         $fields[
"description"] = 
$f->input()->field()->textarea(
$lng->
txt(
"description"));
   570             $fields[
"layout_id"] = $ts;
   574         $section1 = 
$f->input()->field()->section($fields, 
$lng->
txt(
"cont_insert_pagelayout"));
   577         return $f->input()->container()->form()->standard($form_action, [
"sec" => $section1]);
   591         if (
$request->getMethod() == 
"POST") {
   592             $form = $form->withRequest(
$request);
   593             $data = $form->getData()[
"sec"];
   595             $layout_id = (
int) (
$data[
"layout_id"] ?? 0);
   598             $this->obj->setType(
"pg");
   601             $this->obj->setLMId($this->content_object->getId());
   602             if ($layout_id > 0) {
   603                 $this->obj->create(
false, 
false, $layout_id);
   605                 $this->obj->create();
   607             $this->tpl->setOnScreenMessage(
'success', 
$lng->
txt(
"cont_page_created"), 
true);
   620                 .form-control.il-input-radiooption > label {   621                         vertical-align: middle;   623                 .form-control.il-input-radiooption > .help-block { setEditPreview(bool $a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit. 
 
EditingGUIRequest $request
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
 
ilGlobalTemplateInterface $tpl
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
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 _createEntry(int $a_obj_id, string $a_action, array $a_info_params=[], string $a_obj_type="", string $a_user_comment="", bool $a_update_last=false)
Creates a new history entry for an object. 
 
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
 
static _getAllReferences(int $id)
get all reference ids for object ID 
 
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
static getAvailableLayouts()
get all available lm layouts 
 
setParameterByClass(string $a_class, string $a_parameter, $a_value)
 
loadLanguageModule(string $a_module)
Load language module. 
 
static getLayoutCssFix()
Get layout css fix (workaround for broken radio options) 
 
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag. 
 
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon 
 
Base class for ilStructureObjects and ilPageObjects (see ILIAS DTD) 
 
static _lookupObjId(int $ref_id)
 
preview()
display content of page (edit view) 
 
__construct(ilObjLearningModule $a_content_obj)
 
ILIAS Style Content DomainService $content_style_domain
 
edit()
display content of page (edit view) 
 
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='ilpublicuserprofilegui')
Default behaviour is: 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static _lookupTitle(int $obj_id)
 
setContent(string $a_html)
Sets content for standard template. 
 
static writeLayout(int $a_obj_id, string $a_layout, ?ilObjLearningModule $a_lm=null)
Write layout setting. 
 
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists. 
 
Extension of ilPageObjectGUI for learning modules. 
 
static _goto(string $a_target)
redirect script 
 
editLayout()
Edit layout of page. 
 
setBackTarget(string $a_title, string $a_target, string $a_frame="")
 
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template. 
 
static redirect(string $a_script)
 
ilObjLearningModule $content_object
 
User Interface for Learning Module Page Objects Editing. 
 
form( $class_path, string $cmd, string $submit_caption="")
 
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
 
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...
 
static getGotoForWikiPageTarget(string $a_target, bool $a_offline=false)
 
static hasPublicProfile(int $a_user_id)
 
static _lookupContObjID(int $a_id)
get learning module id for lm object 
 
downloadFile()
download file of file lists 
 
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
 
updateHistory()
update history 
 
static _lookupType(int $id, bool $reference=false)
 
getLinkXML(array $a_int_links)
get link targets 
 
setLMPageObject(ilLMPageObject $a_pg_obj)
Set content object dependent page object (co page) 
 
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.