4require_once(
"./Modules/LearningModule/classes/class.ilLMObjectGUI.php");
 
    5require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
 
    6require_once(
"./Modules/LearningModule/classes/class.ilLMPageGUI.php");
 
    7require_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
 
   45        $this->tpl = 
$DIC[
"tpl"];
 
   46        $this->ctrl = 
$DIC->ctrl();
 
   47        $this->tabs = 
$DIC->tabs();
 
   49        $this->lng = 
$DIC->language();
 
   50        parent::__construct($a_content_obj);
 
   59        $this->obj = $a_pg_obj;
 
   60        $this->obj->setLMId($this->content_object->getId());
 
   73        $next_class = $this->ctrl->getNextClass($this);
 
   74        $cmd = $this->ctrl->getCmd();
 
   79        switch ($next_class) {
 
   84                $showViewInFrameset = 
true;
 
   87                $this->ctrl->setReturn($this, 
"edit");
 
   90                    if (
$_GET[
"totransl"] == 
"") {
 
   92                        $ilCtrl->setCmd(
"switchToLanguage");
 
   94                    $ilCtrl->setCmdClass(
"illmpagegui");
 
   95                    $page_gui = 
new ilLMPageGUI($this->obj->getId(), 0, 
false, 
"-");
 
   99                $page_gui->setEditPreview(
true);
 
  100                $page_gui->activateMetaDataEditor(
 
  101                    $this->content_object,
 
  102                    $this->obj->getType(),
 
  107                if (
$ilSetting->get(
"block_activated_news")) {
 
  108                    $page_gui->setEnabledNews(
 
  110                        $this->obj->content_object->getId(),
 
  111                        $this->obj->content_object->getType()
 
  116                if ($showViewInFrameset) {
 
  119                    $view_frame = 
"ilContObj" . $this->content_object->getID();
 
  121                $page_gui->setViewPageLink(
 
  122                    ILIAS_HTTP_PATH . 
"/goto.php?target=pg_" . $this->obj->getId() .
 
  123                    "_" . 
$_GET[
"ref_id"],
 
  127                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  129                    $this->content_object->getStyleSheetId(),
 
  132                $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
 
  133                $page_gui->getPageObject()->buildDom();
 
  134                $int_links = $page_gui->getPageObject()->getInternalLinks();
 
  136                $page_gui->setLinkXML($link_xml);
 
  138                $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
 
  139                $page_gui->setFileDownloadLink(
"ilias.php?cmd=downloadFile&ref_id=" . 
$_GET[
"ref_id"] . 
"&baseClass=ilLMPresentationGUI");
 
  140                $page_gui->setFullscreenLink(
"ilias.php?cmd=fullscreen&ref_id=" . 
$_GET[
"ref_id"] . 
"&baseClass=ilLMPresentationGUI");
 
  141                $page_gui->setLinkParams(
"ref_id=" . $this->content_object->getRefId());
 
  142                $page_gui->setSourcecodeDownloadScript(
"ilias.php?ref_id=" . 
$_GET[
"ref_id"] . 
"&baseClass=ilLMPresentationGUI");
 
  143                $page_gui->setPresentationTitle(
 
  146                        $this->content_object->getPageHeader(),
 
  147                        $this->content_object->isActiveNumbering()
 
  150                $page_gui->setLocator($contObjLocator);
 
  151                $page_gui->setHeader($this->lng->txt(
"page") . 
": " . $this->obj->getTitle());
 
  152                $page_gui->setActivationListener($this, 
"activatePage");
 
  154                $up_gui = 
"ilobjlearningmodulegui";
 
  155                $ilCtrl->setParameterByClass($up_gui, 
"active_node", $this->obj->getId());
 
  158                $tpl->setTitle($this->lng->txt(
"page") . 
": " . $this->obj->getTitle());
 
  159                if ($this->content_object->getLayoutPerPage()) {
 
  160                    $page_gui->setTabHook($this, 
"addPageTabs");
 
  162                $ret = $this->ctrl->forwardCommand($page_gui);
 
  167                $ret = $this->$cmd();
 
  179        $this->ctrl->setCmdClass(
"ilLMPageGUI");
 
  180        $this->ctrl->setCmd(
"edit");
 
  190        $this->ctrl->setCmdClass(
"ilLMPageGUI");
 
  191        $this->ctrl->setCmd(
"preview");
 
  202        $this->obj->setType(
"pg");
 
  205        $this->obj->setLMId($this->content_object->getId());
 
  206        $this->obj->create();
 
  211        if (
$_GET[
"obj_id"] != 0) {
 
  218                "ilStructureObjectGUI",
 
  224        $up_gui = 
"ilobjlearningmodulegui";
 
  225        $this->ctrl->redirectByClass($up_gui, 
"pages");
 
  233        if (
$_GET[
"obj_id"] != 0) {
 
  235                "ilStructureObjectGUI",
 
  241        $up_gui = 
"ilobjlearningmodulegui";
 
  242        $this->ctrl->redirectByClass($up_gui, 
"pages");
 
  250        if ($a_layoutframes == 
"") {
 
  251            $a_layoutframes = array();
 
  253        $link_info = 
"<IntLinkInfos>";
 
  254        foreach ($a_int_links as $int_link) {
 
  256            if (substr(
$target, 0, 4) == 
"il__") {
 
  259                $type = $int_link[
"Type"];
 
  260                $targetframe = ($int_link[
"TargetFrame"] != 
"")
 
  261                    ? $int_link[
"TargetFrame"]
 
  265                $anc = $anc_add = 
"";
 
  266                if ($int_link[
"Anchor"] != 
"") {
 
  267                    $anc = $int_link[
"Anchor"];
 
  268                    $anc_add = 
"_" . rawurlencode($int_link[
"Anchor"]);
 
  273                    case "StructureObject":
 
  276                        if ($lm_id == $cont_obj->getId()) {
 
  278                            if (
$type == 
"PageObject") {
 
  279                                $this->ctrl->setParameter($this, 
"obj_id", 
$target_id);
 
  280                                $href = $this->ctrl->getLinkTargetByClass(get_class($this), 
"edit");
 
  282                                $this->ctrl->setParameterByClass(
"ilstructureobjectgui", 
"obj_id", 
$target_id);
 
  283                                $href = $this->ctrl->getLinkTargetByClass(
"ilstructureobjectgui", 
"view");
 
  285                            $href = str_replace(
"&", 
"&", $href);
 
  286                            $this->ctrl->setParameter($this, 
"obj_id", 
$_GET[
"obj_id"]);
 
  288                            if (
$type == 
"PageObject") {
 
  289                                $href = 
"goto.php?target=pg_" . 
$target_id . $anc_add;
 
  293                            $ltarget = 
"ilContObj" . $lm_id;
 
  301                        $ltarget = $nframe = 
"_blank";
 
  302                        $href = 
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&" .
 
  303                            "obj_type=$type&cmd=glossary&ref_id=" . 
$_GET[
"ref_id"] .
 
  304                            "&obj_id=" . 
$target_id . 
"&frame=$nframe";
 
  308                        $ltarget = $nframe = 
"_blank";
 
  309                        $href = 
"ilias.php?cmdClass=illmpresentationgui&baseClass=ilLMPresentationGUI&obj_type=$type&cmd=media&ref_id=" . 
$_GET[
"ref_id"] .
 
  310                            "&mob_id=" . 
$target_id . 
"&frame=$nframe";
 
  313                    case "RepositoryItem":
 
  316                        $href = 
"./goto.php?target=" . $obj_type . 
"_" . 
$target_id;
 
  322                        $this->ctrl->setParameter($this, 
"file_id", 
"il__file_" . 
$target_id);
 
  323                        $href = $this->ctrl->getLinkTarget($this, 
"downloadFile");
 
  324                        $this->ctrl->setParameter($this, 
"file_id", 
"");
 
  329                        if ($obj_type == 
"usr") {
 
  330                            include_once(
"./Services/User/classes/class.ilUserUtil.php");
 
  331                            $back = $this->ctrl->getLinkTarget($this, 
"edit");
 
  333                            $this->ctrl->setParameterByClass(
"ilpublicuserprofilegui", 
"user_id", 
$target_id);
 
  334                            $this->ctrl->setParameterByClass(
 
  335                                "ilpublicuserprofilegui",
 
  340                            include_once(
"./Services/User/classes/class.ilUserUtil.php");
 
  342                                $href = $this->ctrl->getLinkTargetByClass(
"ilpublicuserprofilegui", 
"getHTML");
 
  344                            $this->ctrl->setParameterByClass(
"ilpublicuserprofilegui", 
"user_id", 
"");
 
  352                    $anc_par = 
'Anchor="' . $anc . 
'"';
 
  353                    $link_info .= 
"<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
 
  354                        "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
 
  358        $link_info .= 
"</IntLinkInfos>";
 
  368        require_once(
"./Services/History/classes/class.ilHistory.php");
 
  373            $this->content_object->getType() . 
":pg",
 
  384    public static function _goto($a_target)
 
  388        $rbacsystem = 
$DIC->rbac()->system();
 
  391        $ilAccess = 
$DIC->access();
 
  393        $first = strpos($a_target, 
"_");
 
  394        $second = strpos($a_target, 
"_", $first + 1);
 
  395        $page_id = substr($a_target, 0, $first);
 
  397            $page_id = substr($a_target, 0, $first);
 
  399                $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
 
  400                $anchor = substr($a_target, $second + 1);
 
  402                $ref_id = substr($a_target, $first + 1);
 
  405            $page_id = $a_target;
 
  415        if (in_array($ref_id, $ref_ids)) {
 
  416            $ref_ids = array_merge(array($ref_id), $ref_ids);
 
  420        foreach ($ref_ids as $ref_id) {
 
  422            if ($ilAccess->checkAccess(
"read", 
"", $ref_id)) {
 
  425                $_GET[
"baseClass"] = 
"ilLMPresentationGUI";
 
  426                $_GET[
"obj_id"] = $page_id;
 
  427                $_GET[
"ref_id"] = $ref_id;
 
  428                $_GET[
"anchor"] = $anchor;
 
  429                include_once(
"ilias.php");
 
  434        if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID)) {
 
  437                    $lng->txt(
"msg_no_perm_read_item"),
 
  441                $lng->loadLanguageModule(
"content");
 
  444            include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
 
  461        $page_gui->setEditPreview(
true);
 
  462        $page_gui->activateMetaDataEditor(
 
  463            $this->content_object,
 
  464            $this->obj->getType(),
 
  469        $page_gui->setActivationListener($this, 
"activatePage");
 
  470        $page_gui->setTabHook($this, 
"addPageTabs");
 
  473        $tpl->setTitle($this->lng->txt(
"page") . 
": " . $this->obj->getTitle());
 
  475        $ilTabs->setTabActive(
"cont_layout");
 
  477        $tpl->setContent($this->form->getHTML());
 
  490        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  496        if (is_file($im = 
ilUtil::getImagePath(
"layout_" . $this->content_object->getLayout() . 
".png"))) {
 
  497            $im_tag = 
ilUtil::img($im, $this->content_object->getLayout());
 
  499        $layout->addOption(
new ilRadioOption(
"<table><tr><td>" . $im_tag . 
"</td><td><b>" .
 
  500            $lng->txt(
"cont_lm_default_layout") .
 
  501            "</b>: " . 
$lng->txt(
"cont_layout_" . $this->content_object->getLayout()) .
 
  502            "</td></tr></table>", 
""));
 
  509            $layout->addOption(
new ilRadioOption(
"<table><tr><td>" . $im_tag . 
"</td><td><b>" .
 
  510                $lng->txt(
"cont_layout_" . 
$l) . 
"</b>: " . 
$lng->txt(
"cont_layout_" . 
$l . 
"_desc") .
 
  511                "</td></tr></table>", 
$l));
 
  514        $layout->setValue($this->obj->getLayout());
 
  515        $this->form->addItem($layout);
 
  517        $this->form->addCommandButton(
"saveLayout", 
$lng->txt(
"save"));
 
  519        $this->form->setTitle(
$lng->txt(
"cont_page_layout"));
 
  520        $this->form->setFormAction(
$ilCtrl->getFormAction($this));
 
  534        if ($this->form->checkInput()) {
 
  536            ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
  537            $ilCtrl->redirect($this, 
"editLayout");
 
  539        $this->form->setValuesByPost();
 
  540        $tpl->setContent($this->form->getHtml());
 
  553            $ilCtrl->getLinkTarget($this, 
'editLayout'),
 
  563        $pg_obj = $this->obj->getPageObject();
 
  565        $int_links = $pg_obj->getInternalLinks();
 
  566        foreach ($int_links as $il) {
 
  567            if ($il[
"Target"] == str_replace(
"_file_", 
"_dfile_", 
$_GET[
"file_id"])) {
 
  568                $file = explode(
"_", 
$_GET[
"file_id"]);
 
  569                $file_id = (int) $file[count($file) - 1];
 
  570                require_once(
"./Modules/File/classes/class.ilObjFile.php");
 
  571                $fileObj = 
new ilObjFile($file_id, 
false);
 
  572                $fileObj->sendFile();
 
An exception for terminatinating execution or to throw for unit testing.
static _createEntry( $a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
putInTree()
put this object into content object tree
checkTree()
check the content object tree
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static writeLayout($a_obj_id, $a_layout, $a_lm=null)
Write layout setting.
Extension of ilPageObjectGUI for learning modules.
__construct(&$a_content_obj)
Constructor.
editLayout()
Edit layout of page.
initEditLayoutForm()
Init edit layout form.
setLMPageObject($a_pg_obj)
Set content object dependent page object (co page)
downloadFile()
download file of file lists
executeCommand()
execute command
addPageTabs()
Add page tabs.
save()
save co page object
static _goto($a_target)
redirect script
getLinkXML($a_int_links)
get link targets
updateHistory()
update history
static _getPresentationTitle( $a_pg_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
static getAvailableLayouts()
get all available lm layouts
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
This class represents an option in a radio group.
static hasPublicProfile($a_user_id)
Has public profile.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)