4require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
 
    5require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
 
   34                $lng->loadLanguageModule(
"link");
 
   37                if ((
$_SESSION[
"il_link_cont_obj"] != 
"" && !$tree->isInTree(
$_SESSION[
"il_link_cont_obj"])) ||
 
   48                $this->ctrl->saveParameter($this, array(
"linkmode", 
"target_type"));
 
   49                $this->default_type = $a_default_type;
 
   50                $this->default_obj = $a_default_obj;
 
   51                $this->filter_link_types = array();
 
   63                $this->ltypes = array(
 
   64                        "StructureObject" => 
$lng->txt(
"cont_lk_chapter"),
 
   65                        "StructureObject_New" => 
$lng->txt(
"cont_lk_chapter_new"),
 
   66                        "PageObject" => 
$lng->txt(
"cont_lk_page"),
 
   67                        "PageObject_FAQ" => 
$lng->txt(
"cont_lk_page_faq"),
 
   68                        "PageObject_New" => 
$lng->txt(
"cont_lk_page_new"),
 
   69                        "GlossaryItem" => 
$lng->txt(
"cont_lk_term"),
 
   70                        "GlossaryItem_New" => 
$lng->txt(
"cont_lk_term_new"),
 
   71                        "Media" => 
$lng->txt(
"cont_lk_media_inline"),
 
   72                        "Media_Media" => 
$lng->txt(
"cont_lk_media_media"),
 
   73                        "Media_FAQ" => 
$lng->txt(
"cont_lk_media_faq"),
 
   74                        "Media_New" => 
$lng->txt(
"cont_lk_media_new"),
 
   75                        "WikiPage" => 
$lng->txt(
"cont_wiki_page"),
 
   76                        "File" => 
$lng->txt(
"cont_lk_file"),
 
   77                        "RepositoryItem" => 
$lng->txt(
"cont_repository_item")
 
   87                $ltype = (
$_SESSION[
"il_link_type"] == 
"")
 
   90                $ltype_arr = explode(
"_", $ltype);
 
   92                if (!isset($this->ltypes[$ltype_arr[0]]) &&
 
   93                        !isset($this->ltypes[$ltype]))
 
   99                        $this->link_type = ($ltype_arr[0] == 
"")
 
  100                                ? $this->default_type
 
  102                        $this->link_target = $ltype_arr[1];
 
  111                $this->mode = $a_mode;
 
  116                $this->set_link_script = $a_script;
 
  121                $this->
return = $a_return;
 
  131                $this->filter_link_types[] = $a_link_type;
 
  141                $this->filter_white_list = $a_white_list;
 
  147                $next_class = $this->ctrl->getNextClass($this);
 
  149                $cmd = $this->ctrl->getCmd(
"showLinkHelp");
 
  176                if ($this->
return == 
"")
 
  178                        $this->ctrl->returnToParent($this);
 
  193                include_once(
"./Services/COPage/classes/class.ilPageEditorGUI.php");
 
  194                if (self::_doJSEditing())
 
  196                        $str = htmlspecialchars($str, ENT_QUOTES);
 
  210                if (!$this->filter_white_list)
 
  212                        foreach($this->filter_link_types as 
$link_type)
 
  220                        foreach($this->ltypes as $k => 
$l)
 
  222                                if (in_array($k, $this->filter_link_types))
 
  234                $ltype = ($this->link_target != 
"")
 
  235                        ? $this->link_type.
"_".$this->link_target
 
  241                switch($this->link_type)
 
  244                        case "StructureObject":
 
  245                                if  (empty(
$_SESSION[
"il_link_cont_obj"]) &&
 
  246                                        ($def_type != 
"mep" && $def_type != 
"glo"))
 
  253                                if  (empty(
$_SESSION[
"il_link_glossary"]) && $def_type == 
"glo")
 
  260                                if  (empty(
$_SESSION[
"il_link_mep"]) && $def_type == 
"mep")
 
  267                                if  (empty(
$_SESSION[
"il_link_wiki"]) && $def_type == 
"wiki")
 
  281                $target_str = ($this->link_target == 
"")
 
  283                        : 
" target=\"".$this->link_target.
"\"";
 
  285                if(($this->link_type == 
"GlossaryItem") &&
 
  292                if(($this->link_type == 
"WikiPage") &&
 
  299                if(($this->link_type == 
"PageObject" || $this->link_type == 
"StructureObject") &&
 
  306                if ($ilCtrl->isAsynch())
 
  308                        $tpl = 
new ilTemplate(
"tpl.link_help_asynch.html", 
true, 
true, 
"Services/Link");
 
  312                        $tpl = 
new ilTemplate(
"tpl.link_help.html", 
true, 
true, 
"Services/Link");
 
  316                switch($this->link_type)
 
  319                                $this->ctrl->setParameter($this, 
"target_type", 
"glo");
 
  323                        case "StructureObject":
 
  324                                $this->ctrl->setParameter($this, 
"target_type", 
"cont_obj");
 
  328                                $this->ctrl->setParameter($this, 
"target_type", 
"mep");
 
  332                                $this->ctrl->setParameter($this, 
"target_type", 
"wiki");
 
  342                $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this, 
"changeLinkType", 
"", 
true));
 
  343                $tpl->setVariable(
"FORMACTION2", $this->ctrl->getFormAction($this));
 
  344                $tpl->setVariable(
"TXT_HELP_HEADER", $this->lng->txt(
"cont_link_select"));
 
  345                $tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"cont_link_type"));
 
  351                        "ltype", $this->ltypes, 
false, 
true, 
"0", 
"", array(
"id" => 
"ilIntLinkTypeSelector"));
 
  352                $tpl->setVariable(
"SELECT_TYPE", $select_ltype);
 
  353                $tpl->setVariable(
"CMD_CHANGETYPE", 
"changeLinkType");
 
  354                $tpl->setVariable(
"BTN_CHANGETYPE", $this->lng->txt(
"cont_change_type"));
 
  362                        $tpl->setVariable(
"CMD_CLOSE", 
"closeLinkHelp");
 
  363                        $tpl->setVariable(
"BTN_CLOSE", $this->lng->txt(
"close"));
 
  366                $chapterRowBlock = 
"chapter_row";
 
  367                $anchor_row_block = 
"anchor_link";
 
  370                        $chapterRowBlock .= 
"_js";
 
  371                        $anchor_row_block .= 
"_js";
 
  378                switch($this->link_type)
 
  382                                require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
 
  383                                include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
 
  388                                $ctree = $cont_obj->getLMTree();
 
  389                                $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
 
  390                                $tpl->setCurrentBlock(
"chapter_list");
 
  391                                $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"obj_lm"));
 
  392                                $tpl->setVariable(
"TXT_CONT_TITLE", $cont_obj->getTitle());
 
  393                                $tpl->setVariable(
"THEAD", $this->lng->txt(
"pages"));
 
  396                                $tpl->setCurrentBlock(
"change_cont_obj");
 
  397                                $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  398                                $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  399                                $tpl->parseCurrentBlock();
 
  401                                foreach($nodes as $node)
 
  403                                        if($node[
"type"] == 
"st")
 
  405                                                $tpl->setCurrentBlock(
"chapter_row");
 
  406                                                $tpl->setVariable(
"TXT_CHAPTER", $node[
"title"]);
 
  407                                                $tpl->setVariable(
"ROWCLASS", 
"tblrow1");
 
  410                                                $tpl->parseCurrentBlock();
 
  411                                                $tpl->setCurrentBlock(
"row");
 
  412                                                $tpl->parseCurrentBlock();
 
  415                                        if($node[
"type"] == 
"pg")
 
  417                                                include_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
 
  419                                                        "PageObject", 
"pg", 
"page",
 
  426                                $free_pages = array();
 
  427                                foreach ($pages as $page)
 
  429                                        if (!$ctree->isInTree($page[
"obj_id"]))
 
  431                                                $free_pages[] = $page;
 
  434                                if(count($free_pages) > 0)
 
  436                                        $tpl->setCurrentBlock(str_replace(
"_js",
"",$chapterRowBlock));
 
  437                                        $tpl->setVariable(
"TXT_CHAPTER", $this->lng->txt(
"cont_free_pages"));
 
  438                                        $tpl->setVariable(
"ROWCLASS", 
"tblrow1");
 
  439                                        $tpl->parseCurrentBlock();
 
  441                                        foreach ($free_pages as $node)
 
  443                                                include_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
 
  445                                                        "PageObject", 
"pg", 
"page",
 
  450                                $tpl->setCurrentBlock(
"chapter_list");
 
  451                                $tpl->parseCurrentBlock();
 
  456                        case "StructureObject":
 
  467                                        require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
 
  472                                $ctree =& $cont_obj->getLMTree();
 
  473                                $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
 
  474                                $tpl->setCurrentBlock(
"chapter_list");
 
  475                                $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"obj_lm"));
 
  476                                $tpl->setVariable(
"TXT_CONT_TITLE", $cont_obj->getTitle());
 
  477                                $tpl->setVariable(
"THEAD", $this->lng->txt(
"link_chapters"));
 
  478                                $tpl->setCurrentBlock(
"change_cont_obj");
 
  479                                $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  480                                $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  481                                $tpl->parseCurrentBlock();
 
  483                                foreach($nodes as $node)
 
  485                                        if($node[
"type"] == 
"st")
 
  488                                                        "StructureObject", 
"st", 
"chap");
 
  491                                $tpl->setCurrentBlock(
"chapter_list");
 
  492                                $tpl->parseCurrentBlock();
 
  497                                require_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
 
  501                                $terms = $glossary->getTermList();
 
  502                                $tpl->setCurrentBlock(
"chapter_list");
 
  503                                $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"glossary"));
 
  504                                $tpl->setVariable(
"TXT_CONT_TITLE", $glossary->getTitle());
 
  505                                $tpl->setVariable(
"THEAD", $this->lng->txt(
"link_terms"));
 
  506                                $tpl->setCurrentBlock(
"change_cont_obj");
 
  507                                $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  508                                $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  509                                $tpl->parseCurrentBlock();
 
  511                                foreach($terms as $term)
 
  514                                                "GlossaryItem", 
"git", 
"term");
 
  517                                $tpl->setCurrentBlock(
"chapter_list");
 
  518                                $tpl->parseCurrentBlock();
 
  523                                include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
 
  528                                        $tpl->setCurrentBlock(
"change_cont_obj");
 
  529                                        $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  530                                        $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  531                                        $tpl->parseCurrentBlock();
 
  532                                        $mobjs = 
$ilUser->getClipboardObjects(
"mob");
 
  535                                        foreach ($mobjs as $obj)
 
  537                                                $objs[$obj[
"title"].
":".$obj[
"id"]] = $obj;
 
  540                                        $tpl->setCurrentBlock(
"chapter_list");
 
  541                                        $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"cont_media_source"));
 
  542                                        $tpl->setVariable(
"TXT_CONT_TITLE", $this->lng->txt(
"cont_personal_clipboard"));
 
  543                                        $tpl->setVariable(
"THEAD", $this->lng->txt(
"link_mobs"));
 
  544                                        $tpl->setVariable(
"COLSPAN", 
"2");
 
  546                                        foreach($objs as $obj)
 
  549                                                        "MediaObject", 
"mob", 
"media");
 
  551                                        $tpl->setCurrentBlock(
"chapter_list");
 
  552                                        $tpl->parseCurrentBlock();
 
  556                                        require_once(
"./Modules/MediaPool/classes/class.ilObjMediaPool.php");
 
  559                                        $fobjs = $med_pool->getChilds(
$_SESSION[
"il_link_mep_obj"], 
"fold");
 
  561                                        foreach ($fobjs as $obj)
 
  563                                                $f2objs[$obj[
"title"].
":".$obj[
"child"]] = $obj;
 
  567                                        $mobjs = $med_pool->getChilds(
$_SESSION[
"il_link_mep_obj"], 
"mob");
 
  569                                        foreach ($mobjs as $obj)
 
  571                                                $m2objs[$obj[
"title"].
":".$obj[
"child"]] = $obj;
 
  576                                        $objs = array_merge($f2objs, $m2objs);
 
  578                                        $tpl->setCurrentBlock(
"chapter_list");
 
  579                                        $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"mep"));
 
  580                                        $tpl->setVariable(
"TXT_CONT_TITLE", $med_pool->getTitle());
 
  581                                        $tpl->setVariable(
"THEAD", $this->lng->txt(
"link_mobs"));
 
  582                                        $tpl->setCurrentBlock(
"change_cont_obj");
 
  583                                        $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  584                                        $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  585                                        $tpl->setVariable(
"COLSPAN", 
"2");
 
  586                                        $tpl->parseCurrentBlock();
 
  587                                        if ($parent_id = $med_pool->getParentId(
$_SESSION[
"il_link_mep_obj"]))
 
  589                                                $css_row = 
"tblrow1";
 
  590                                                $tpl->setCurrentBlock(
"icon");
 
  592                                                $tpl->parseCurrentBlock();
 
  593                                                $tpl->setCurrentBlock(
"link_row");
 
  594                                                $tpl->setVariable(
"ROWCLASS", $css_row);
 
  595                                                $tpl->setVariable(
"TXT_CHAPTER", 
"..");
 
  596                                                $this->ctrl->setParameter($this, 
"mep_fold", $parent_id);
 
  599                                                        $tpl->setVariable(
"LINK", 
"#");
 
  600                                                        $tpl->setVariable(
"LR_ONCLICK",
 
  601                                                                " onclick=\"return il.IntLink.setMepPoolFolder('".$parent_id.
"');\" ");
 
  606                                                        $tpl->setVariable(
"LINK",
 
  607                                                                $this->ctrl->getLinkTarget($this, 
"setMedPoolFolder"));
 
  609                                                $tpl->parseCurrentBlock();
 
  610                                                $tpl->setCurrentBlock(
"row");
 
  611                                                $tpl->parseCurrentBlock();
 
  613                                        foreach($objs as $obj)
 
  615                                                if($obj[
"type"] == 
"fold")
 
  617                                                        $css_row = ($css_row == 
"tblrow2")
 
  620                                                        $tpl->setCurrentBlock(
"icon");
 
  622                                                        $tpl->parseCurrentBlock();
 
  623                                                        $tpl->setCurrentBlock(
"link_row");
 
  624                                                        $tpl->setVariable(
"ROWCLASS", $css_row);
 
  625                                                        $tpl->setVariable(
"TXT_CHAPTER", $obj[
"title"]);
 
  626                                                        $this->ctrl->setParameter($this, 
"mep_fold", $obj[
"child"]);
 
  629                                                                $tpl->setVariable(
"LINK", 
"#");
 
  630                                                                $tpl->setVariable(
"LR_ONCLICK",
 
  631                                                                        " onclick=\"return il.IntLink.setMepPoolFolder('".$obj[
"child"].
"');\" ");
 
  636                                                                $tpl->setVariable(
"LINK",
 
  637                                                                        $this->ctrl->getLinkTarget($this, 
"setMedPoolFolder"));
 
  639                                                        $tpl->parseCurrentBlock();
 
  647                                                                        "MediaObject", 
"mob", 
"media");
 
  650                                                $tpl->setCurrentBlock(
"row");
 
  651                                                $tpl->parseCurrentBlock();
 
  653                                        $tpl->setCurrentBlock(
"chapter_list");
 
  654                                        $tpl->parseCurrentBlock();
 
  661                                require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
 
  665                                $tpl->setCurrentBlock(
"chapter_list");
 
  666                                $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"obj_wiki"));
 
  668                                $tpl->setVariable(
"THEAD", $this->lng->txt(
"link_wpages"));
 
  669                                $tpl->setCurrentBlock(
"change_cont_obj");
 
  670                                $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  671                                $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  672                                $tpl->parseCurrentBlock();
 
  674                                foreach($wpages as $wpage)
 
  677                                                "WikiPage", 
"wpage", 
"wpage");
 
  680                                $tpl->setCurrentBlock(
"chapter_list");
 
  681                                $tpl->parseCurrentBlock();
 
  685                        case "RepositoryItem":
 
  691                                if (!is_object($this->uploaded_file))
 
  704                if ($ilCtrl->isAsynch())
 
  721                if (!is_object($this->uploaded_file))
 
  723                        $tpl = 
new ilTemplate(
"tpl.link_file.html", 
true, 
true, 
"Services/Link");
 
  724                        $tpl->setCurrentBlock(
"form");
 
  725                        $tpl->setVariable(
"FORM_ACTION",
 
  726                                $ilCtrl->getFormAction($this, 
"saveFileLink", 
"", 
true));
 
  727                        $tpl->setVariable(
"TXT_SELECT_FILE", 
$lng->txt(
"cont_select_file"));
 
  728                        $tpl->setVariable(
"TXT_SAVE_LINK", 
$lng->txt(
"cont_create_link"));
 
  729                        $tpl->setVariable(
"CMD_SAVE_LINK", 
"saveFileLink");
 
  730                        include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
 
  733                        $tpl->setVariable(
"INPUT", $fi->getToolbarHTML());
 
  734                        $tpl->parseCurrentBlock();
 
  739                        $tpl = 
new ilTemplate(
"tpl.link_file.html", 
true, 
true, 
"Services/Link");
 
  740                        $tpl->setCurrentBlock(
"link_js");
 
  744                        $tpl->setVariable(
"TAG_B",
 
  745                                '[iln dfile=\x22'.$this->uploaded_file->getId().
'\x22]');
 
  746                        $tpl->setVariable(
"TAG_E",
 
  748                        $tpl->setVariable(
"TXT_FILE",
 
  749                                $this->uploaded_file->getTitle());
 
  760                if ($_FILES[
"link_file"][
"name"] != 
"")
 
  762                        include_once(
"./Modules/File/classes/class.ilObjFile.php");
 
  764                        $fileObj->setType(
"file");
 
  765                        $fileObj->setTitle($_FILES[
"link_file"][
"name"]);
 
  766                        $fileObj->setDescription(
"");
 
  767                        $fileObj->setFileName($_FILES[
"link_file"][
"name"]);
 
  768                        $fileObj->setFileType($_FILES[
"link_file"][
"type"]);
 
  769                        $fileObj->setFileSize($_FILES[
"link_file"][
"size"]);
 
  770                        $fileObj->setMode(
"filelist");
 
  773                        $fileObj->createDirectory();
 
  774                        $fileObj->raiseUploadError(
false);
 
  775                        $fileObj->getUploadFile($_FILES[
"link_file"][
"tmp_name"],
 
  776                                $_FILES[
"link_file"][
"name"]);
 
  777                        $this->uploaded_file = $fileObj;
 
  790                $med =& $mob->getMediaItem(
"Standard");
 
  791                $target = $med->getThumbnailTarget(
"small");
 
  795                        $tpl->setCurrentBlock(
"thumbnail_link");
 
  800                        $tpl->setCurrentBlock(
"thumbnail_js");
 
  805                        $tpl->setCurrentBlock(
"thumbnail");
 
  810                        $tpl->setCurrentBlock(
"thumb".$suff);
 
  812                        $tpl->parseCurrentBlock();
 
  816                        $tpl->setVariable(
"NO_THUMB", 
" ");
 
  821                        $tpl->setCurrentBlock(
"thumbnail_link");
 
  826                        $tpl->setCurrentBlock(
"thumbnail_js");
 
  830                        $tpl->setCurrentBlock(
"thumbnail");
 
  832                $tpl->parseCurrentBlock();
 
  863                include_once(
"./Services/Link/classes/class.ilLinkTargetObjectExplorerGUI.php");
 
  871                $white = array(
"root", 
"cat", 
"crs", 
"fold", 
"grp");
 
  877                                $exp->setClickableType(
"glo");
 
  882                                $exp->setClickableType(
"wiki");
 
  887                                $exp->setClickableType(
"mep");
 
  892                                $exp->setClickableType(
"lm");
 
  896                $exp->setTypeWhiteList(
$white);
 
  899                if (!$exp->handleCommand())
 
  901                        return $exp->getHTML();
 
  913                if(
$_GET[
"do"] == 
"set")
 
  915                        switch (
$_GET[
"target_type"])
 
  939                        if (!empty(
$_GET[
"target_type"]))
 
  947                                if ($this->link_type == 
"GlossaryItem")
 
  951                                if ($this->link_type == 
"Media")
 
  955                                if ($this->link_type == 
"WikiPage")
 
  962                $tpl = 
new ilTemplate(
"tpl.link_help_explorer.html", 
true, 
true, 
"Services/Link");
 
  968                        $tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_choose_glossary"));
 
  972                        $tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_choose_wiki"));
 
  976                        $tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_choose_media_source"));
 
  980                        $tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_choose_cont_obj"));
 
  983                $tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this, 
"resetLinkList", 
"", 
true));
 
  984                $tpl->setVariable(
"BTN_RESET", 
"resetLinkList");
 
  985                $tpl->setVariable(
"TXT_RESET", $this->lng->txt(
"back"));
 
  989                        $tpl->setCurrentBlock(
"sel_clipboard");
 
  990                        $this->ctrl->setParameter($this, 
"do", 
"set");
 
  993                                $tpl->setVariable(
"LINK_CLIPBOARD", 
"#");
 
  994                                $tpl->setVariable(
"CLIPBOARD_ONCLICK",
 
  995                                        " onclick=\"return il.IntLink.selectLinkTargetObject('mep', 0);\" ");
 
 1000                                $tpl->setVariable(
"LINK_CLIPBOARD", $this->ctrl->getLinkTarget($this, 
"changeTargetObject"));
 
 1002                        $tpl->setVariable(
"TXT_PERS_CLIPBOARD", $this->lng->txt(
"clipboard"));
 
 1003                        $tpl->parseCurrentBlock();
 
 1006                $tpl->parseCurrentBlock();
 
 1023                include_once(
"./Services/Link/classes/class.ilIntLinkRepItemExplorerGUI.php");
 
 1027                if (!$exp->handleCommand())
 
 1029                        return $exp->getHTML();
 
 1063                include_once(
"./Services/COPage/classes/class.ilPageEditorGUI.php");
 
 1065                if (self::_doJSEditing())
 
 1081                $lng->loadLanguageModule(
"link");
 
 1083                $tpl->addJavaScript(
"./Services/UIComponent/Explorer/js/ilExplorer.js");
 
 1084                include_once(
"./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
 
 1087                include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
 
 1090                $tpl->addJavascript(
"./Services/Link/js/ilIntLink.js");
 
 1093                $tpl->addJavaScript(
"Services/Form/js/Form.js");
 
 1095                include_once(
"./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
 
 1097                $modal->setHeading(
$lng->txt(
"link_link"));
 
 1098                $modal->setId(
"ilIntLinkModal");
 
 1099                $modal->setBody(
"<div id='ilIntLinkModalContent'></div>");
 
 1101                $ltpl = 
new ilTemplate(
"tpl.int_link_panel.html", 
true, 
true, 
"Services/Link");
 
 1102                $ltpl->setVariable(
"MODAL", $modal->getHTML());
 
 1104                $ltpl->setVariable(
"IL_INT_LINK_URL", $a_url);
 
 1106                return $ltpl->get();
 
 1113                $a_anchors = array())
 
 1115                $chapterRowBlock = 
"chapter_row";
 
 1116                $anchor_row_block = 
"anchor_link";
 
 1120                        $chapterRowBlock .= 
"_js";
 
 1121                        $anchor_row_block .= 
"_js";
 
 1124                $target_str = ($this->link_target == 
"")
 
 1126                        : 
" target=\"".$this->link_target.
"\"";
 
 1128                if (count($a_anchors) > 0)
 
 1130                        foreach ($a_anchors as $anchor)
 
 1132                                $tpl->setCurrentBlock($anchor_row_block);
 
 1133                                $tpl->setVariable(
"ALINK_BEGIN",
 
 1135                                $tpl->setVariable(
"ALINK_END", 
"[/iln]");
 
 1136                                $tpl->setVariable(
"TXT_LINK", 
"#".$anchor);
 
 1137                                $tpl->parseCurrentBlock();
 
 1141                $this->css_row = ($this->css_row == 
"tblrow1")
 
 1147                        require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
 
 1148                        require_once(
"./Services/MediaObjects/classes/class.ilImageMapEditorGUI.php");
 
 1154                        $tpl->setCurrentBlock(
"link_row");
 
 1155                        $tpl->setVariable(
"ROWCLASS", $this->css_row);
 
 1156                        $tpl->setVariable(
"TXT_CHAPTER", $a_title);
 
 1158                        $tpl->setVariable(
"LINK",
 
 1161                                "&linktarget=il__".$a_type_short.
"_".$a_obj_id.
 
 1162                                "&linktargetframe=".$this->link_target));
 
 1163                        $tpl->parseCurrentBlock();
 
 1167                        $tpl->setCurrentBlock($chapterRowBlock);
 
 1171                                $tpl->setCurrentBlock($chapterRowBlock);
 
 1173                        $tpl->setVariable(
"ROWCLASS", $this->css_row);
 
 1174                        $tpl->setVariable(
"TXT_CHAPTER", $a_title);
 
 1179                        if (
$a_type == 
"MediaObject" && empty($target_str))
 
 1181                                $tpl->setVariable(
"LINK_BEGIN",
 
 1183                                $tpl->setVariable(
"LINK_END", 
"");
 
 1187                                $tpl->setVariable(
"LINK_BEGIN",
 
 1189                                $tpl->setVariable(
"LINK_END", 
"[/iln]");
 
 1191                        $tpl->parseCurrentBlock();
 
 1194                $tpl->setCurrentBlock(
"row");
 
 1195                $tpl->parseCurrentBlock();
 
An exception for terminatinating execution or to throw for unit testing.
static _recoverParameters()
Recover parameters from session variables (static)
Internal Link: Repository Item Selector Explorer.
filterLinkType($a_link_type)
refreshRepositorySelector()
Refresh Repository Selector.
setMedPoolFolder()
select media pool folder
static getInitHTML($a_url)
Get initialisation HTML to use interna link editing.
saveFileLink()
Save file link.
isEnabledJavaScript()
determine, wether js is used
__construct($a_default_type, $a_default_obj)
renderLink($tpl, $a_title, $a_obj_id, $a_type, $a_type_short, $a_bb_type, $a_anchors=array())
Render internal link item.
selectRepositoryItem()
select repository item explorer
getFileLinkHTML()
Get HTML for file link.
setFilterWhiteList($a_white_list)
Set filter list as white list (per detault it is a black list)
setMode($a_mode="text")
Set mode.
changeTargetObject($a_type="")
Cange target object.
determineLinkType()
Determine current link type.
getTargetExplorer($a_type="")
Cange target object.
initLinkTypes()
Initialize link types.
changeLinkType()
change link type
showLinkHelp()
Show link help list.
outputThumbnail(&$tpl, $a_id, $a_mode="")
output thumbnail
setSetLinkTargetScript($a_script)
prepareJavascriptOutput($str)
Prepare output for JS enabled editing.
static getPageList($lm_id)
static
Internal Link: Repository Item Selector Explorer.
static getInstance()
Get instance.
Class ilObjLearningModule.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
static _readAnchors($a_parent_type, $a_page_id, $a_page_lang="-")
Read anchors of a page.
static _doJSEditing()
checks if current user has activated js editing and if browser is js capable
special template class to simplify handling of ITX/PEAR
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static redirect($a_script)
http redirect to other script
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getAllWikiPages($a_wiki_id)
Get all pages of wiki
static initConnection()
Init YUI Connection module.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output