4require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
 
    5require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
 
   91    public function __construct($a_default_link_type, $a_default_parent_id, $a_is_ref = 
true)
 
   94        $this->tree = 
$DIC->repositoryTree();
 
   95        $this->lng = 
$DIC->language();
 
   96        $this->ctrl = 
$DIC->ctrl();
 
   97        $this->
user = $DIC->user();
 
   99        $this->lng->loadLanguageModule(
"link");
 
  100        $this->lng->loadLanguageModule(
"content");
 
  103        $this->ctrl->saveParameter($this, array(
"linkmode", 
"link_par_ref_id", 
"link_par_obj_id",
 
  104            "link_par_fold_id", 
"link_type"));
 
  107        $this->default_link_type = $a_default_link_type;
 
  109            $this->default_parent_ref_id = $a_default_parent_id;
 
  112            $this->default_parent_ref_id = 0;
 
  113            $this->default_parent_obj_id = $a_default_parent_id;
 
  115        $this->default_parent_obj_type = ($this->default_parent_obj_id > 0)
 
  120        $this->parent_ref_id = (int) 
$_GET[
"link_par_ref_id"];
 
  121        $this->parent_fold_id = (int) 
$_GET[
"link_par_fold_id"];                
 
  122        if ($this->parent_ref_id > 0) {
 
  125            $this->parent_obj_id = (int) 
$_GET[
"link_par_obj_id"];
 
  138        if ($this->parent_ref_id > 0 && !
$tree->isInTree($this->parent_ref_id)) {
 
  142        $this->parent_type = array(
 
  143            "StructureObject" => 
"lm",
 
  144            "PageObject" => 
"lm",
 
  145            "GlossaryItem" => 
"glo",
 
  147            "WikiPage" => 
"wiki",
 
  148            "PortfolioPage" => 
"prtf",
 
  149            "PortfolioTemplatePage" => 
"prtt",
 
  151            "RepositoryItem" => 
"",
 
  156        $this->ltypes = array(
 
  157            "StructureObject" => 
$lng->txt(
"cont_lk_chapter"),
 
  158            "StructureObject_New" => 
$lng->txt(
"cont_lk_chapter_new"),
 
  159            "PageObject" => 
$lng->txt(
"cont_lk_page"),
 
  160            "PageObject_FAQ" => 
$lng->txt(
"cont_lk_page_faq"),
 
  161            "PageObject_New" => 
$lng->txt(
"cont_lk_page_new"),
 
  162            "GlossaryItem" => 
$lng->txt(
"cont_lk_term"),
 
  163            "GlossaryItem_New" => 
$lng->txt(
"cont_lk_term_new"),
 
  164            "Media" => 
$lng->txt(
"cont_lk_media_inline"),
 
  165            "Media_Media" => 
$lng->txt(
"cont_lk_media_media"),
 
  166            "Media_FAQ" => 
$lng->txt(
"cont_lk_media_faq"),
 
  167            "Media_New" => 
$lng->txt(
"cont_lk_media_new"),
 
  168            "WikiPage" => 
$lng->txt(
"cont_wiki_page"),
 
  169            "PortfolioPage" => 
$lng->txt(
"cont_prtf_page"),
 
  170            "PortfolioTemplatePage" => 
$lng->txt(
"cont_prtt_page"),
 
  171            "File" => 
$lng->txt(
"cont_lk_file"),
 
  172            "RepositoryItem" => 
$lng->txt(
"cont_repository_item"),
 
  173            "User" => 
$lng->txt(
"cont_user")
 
  175        if (!$this->filter_white_list) {
 
  176            foreach ($this->filter_link_types as 
$link_type) {
 
  181            foreach ($this->ltypes as $k => 
$l) {
 
  182                if (in_array($k, $this->filter_link_types)) {
 
  189        $this->link_type = (
$_GET[
"link_type"] == 
"")
 
  190            ? $this->default_link_type
 
  191            : 
$_GET[
"link_type"];
 
  192        $ltype_arr = explode(
"_", $this->link_type);
 
  193        $this->base_link_type = $ltype_arr[0];
 
  194        $this->link_target = $ltype_arr[1];
 
  200        switch ($this->base_link_type) {
 
  202            case "StructureObject":
 
  206            case "PortfolioPage":
 
  207            case "PortfolioTemplatePage":
 
  208                if ($this->parent_ref_id == 0 && $this->parent_obj_id == 0
 
  209                    && $def_type == $this->parent_type[$this->base_link_type]) {
 
  212                    $ctrl->setParameter($this, 
"link_par_obj_id", $this->parent_obj_id);
 
  213                    $ctrl->setParameter($this, 
"link_par_ref_id", $this->parent_ref_id);
 
  230        $this->set_link_script = $a_script;
 
  235        $this->
return = $a_return;
 
  245        $this->filter_link_types[] = $a_link_type;
 
  255        $this->filter_white_list = $a_white_list;
 
  262        $next_class = $this->ctrl->getNextClass($this);
 
  264        $cmd = $this->ctrl->getCmd(
"showLinkHelp");
 
  265        switch ($next_class) {
 
  267                $ret = $this->$cmd();
 
  278        $ctrl->setParameter($this, 
"link_par_ref_id", 
"");
 
  279        $ctrl->setParameter($this, 
"link_par_obj_id", 
"");
 
  280        $ctrl->setParameter($this, 
"link_par_fold_id", 
"");
 
  281        $ctrl->setParameter($this, 
"link_type", 
"");
 
  283        $ctrl->redirect($this, 
"showLinkHelp", 
"", 
true);
 
  288        if ($this->
return == 
"") {
 
  289            $this->ctrl->returnToParent($this);
 
  300        return htmlspecialchars($str, ENT_QUOTES);
 
  314        if ((in_array($this->base_link_type, array(
"GlossaryItem", 
"WikiPage", 
"PageObject", 
"StructureObject")) &&
 
  315            ($this->parent_ref_id == 0))
 
  317            (($this->parent_ref_id > 0) &&
 
  324            $tpl = 
new ilTemplate(
"tpl.link_help_asynch.html", 
true, 
true, 
"Services/Link");
 
  325            $tpl->setVariable(
"NEW_LINK_URL", $this->ctrl->getLinkTarget(
 
  333            $tpl = 
new ilTemplate(
"tpl.link_help.html", 
true, 
true, 
"Services/Link");
 
  337        $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this, 
"changeLinkType", 
"", 
true));
 
  338        $tpl->setVariable(
"FORMACTION2", $this->ctrl->getFormAction($this));
 
  339        $tpl->setVariable(
"TXT_HELP_HEADER", $this->lng->txt(
"cont_link_select"));
 
  340        $tpl->setVariable(
"TXT_TYPE", $this->lng->txt(
"cont_link_type"));
 
  351            array(
"id" => 
"ilIntLinkTypeSelector")
 
  353        $tpl->setVariable(
"SELECT_TYPE", $select_ltype);
 
  354        $tpl->setVariable(
"CMD_CHANGETYPE", 
"changeLinkType");
 
  355        $tpl->setVariable(
"BTN_CHANGETYPE", $this->lng->txt(
"cont_change_type"));
 
  357        $tpl->setVariable(
"CMD_CLOSE", 
"closeLinkHelp");
 
  358        $tpl->setVariable(
"BTN_CLOSE", $this->lng->txt(
"close"));
 
  360        $chapterRowBlock = 
"chapter_row_js";
 
  363        switch ($this->base_link_type) {
 
  366                require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
 
  367                include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
 
  372                $ctree = $cont_obj->getLMTree();
 
  373                $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
 
  374                $tpl->setCurrentBlock(
"chapter_list");
 
  375                $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"obj_lm"));
 
  376                $tpl->setVariable(
"TXT_CONT_TITLE", $cont_obj->getTitle());
 
  377                $tpl->setVariable(
"THEAD", $this->lng->txt(
"pages"));
 
  380                $tpl->setCurrentBlock(
"change_cont_obj");
 
  381                $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  382                $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  383                $tpl->parseCurrentBlock();
 
  385                foreach (
$nodes as $node) {
 
  386                    if ($node[
"type"] == 
"st") {
 
  387                        $tpl->setCurrentBlock(
"header_row");
 
  388                        $tpl->setVariable(
"TXT_HEADER", $node[
"title"]);
 
  389                        $tpl->parseCurrentBlock();
 
  390                        $tpl->setCurrentBlock(
"row");
 
  391                        $tpl->parseCurrentBlock();
 
  394                    if ($node[
"type"] == 
"pg") {
 
  395                        include_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
 
  410                $free_pages = array();
 
  411                foreach ($pages as $page) {
 
  412                    if (!$ctree->isInTree($page[
"obj_id"])) {
 
  413                        $free_pages[] = $page;
 
  416                if (count($free_pages) > 0) {
 
  417                    $tpl->setCurrentBlock(
"header_row");
 
  418                    $tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"cont_free_pages"));
 
  419                    $tpl->parseCurrentBlock();
 
  421                    foreach ($free_pages as $node) {
 
  422                        include_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
 
  435                $tpl->setCurrentBlock(
"chapter_list");
 
  436                $tpl->parseCurrentBlock();
 
  441            case "StructureObject":
 
  451                require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
 
  455                $ctree = &$cont_obj->getLMTree();
 
  456                $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
 
  457                $tpl->setCurrentBlock(
"chapter_list");
 
  458                $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"obj_lm"));
 
  459                $tpl->setVariable(
"TXT_CONT_TITLE", $cont_obj->getTitle());
 
  460                $tpl->setVariable(
"THEAD", $this->lng->txt(
"link_chapters"));
 
  461                $tpl->setCurrentBlock(
"change_cont_obj");
 
  462                $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  463                $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  464                $tpl->parseCurrentBlock();
 
  466                foreach (
$nodes as $node) {
 
  467                    if ($node[
"type"] == 
"st") {
 
  478                $tpl->setCurrentBlock(
"chapter_list");
 
  479                $tpl->parseCurrentBlock();
 
  484                require_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
 
  488                $terms = $glossary->getTermList();
 
  489                $tpl->setCurrentBlock(
"chapter_list");
 
  490                $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"glossary"));
 
  491                $tpl->setVariable(
"TXT_CONT_TITLE", $glossary->getTitle());
 
  492                $tpl->setVariable(
"THEAD", $this->lng->txt(
"link_terms"));
 
  493                $tpl->setCurrentBlock(
"change_cont_obj");
 
  494                $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  495                $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  496                $tpl->parseCurrentBlock();
 
  498                foreach ($terms as $term) {
 
  509                $tpl->setCurrentBlock(
"chapter_list");
 
  510                $tpl->parseCurrentBlock();
 
  515                include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
 
  518                if ($this->parent_ref_id == 0) {
 
  519                    $tpl->setCurrentBlock(
"change_cont_obj");
 
  520                    $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  521                    $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  522                    $tpl->parseCurrentBlock();
 
  523                    $mobjs = 
$ilUser->getClipboardObjects(
"mob");
 
  526                    foreach ($mobjs as $obj) {
 
  527                        $objs[$obj[
"title"] . 
":" . $obj[
"id"]] = $obj;
 
  530                    $tpl->setCurrentBlock(
"chapter_list");
 
  531                    $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"cont_media_source"));
 
  532                    $tpl->setVariable(
"TXT_CONT_TITLE", $this->lng->txt(
"cont_personal_clipboard"));
 
  533                    $tpl->setVariable(
"THEAD", $this->lng->txt(
"link_mobs"));
 
  534                    $tpl->setVariable(
"COLSPAN", 
"2");
 
  536                    foreach ($objs as $obj) {
 
  546                    $tpl->setCurrentBlock(
"chapter_list");
 
  547                    $tpl->parseCurrentBlock();
 
  549                    require_once(
"./Modules/MediaPool/classes/class.ilObjMediaPool.php");
 
  552                    $fobjs = $med_pool->getChilds($this->parent_fold_id, 
"fold");
 
  554                    foreach ($fobjs as $obj) {
 
  555                        $f2objs[$obj[
"title"] . 
":" . $obj[
"child"]] = $obj;
 
  559                    $mobjs = $med_pool->getChilds($this->parent_fold_id, 
"mob");
 
  561                    foreach ($mobjs as $obj) {
 
  562                        $m2objs[$obj[
"title"] . 
":" . $obj[
"child"]] = $obj;
 
  567                    $objs = array_merge($f2objs, $m2objs);
 
  569                    $tpl->setCurrentBlock(
"chapter_list");
 
  570                    $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"mep"));
 
  571                    $tpl->setVariable(
"TXT_CONT_TITLE", $med_pool->getTitle());
 
  572                    $tpl->setVariable(
"THEAD", $this->lng->txt(
"link_mobs"));
 
  573                    $tpl->setCurrentBlock(
"change_cont_obj");
 
  574                    $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  575                    $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  576                    $tpl->setVariable(
"COLSPAN", 
"2");
 
  577                    $tpl->parseCurrentBlock();
 
  578                    if ($parent_id = $med_pool->getParentId($this->parent_fold_id)) {
 
  579                        $css_row = 
"tblrow1";
 
  580                        $tpl->setCurrentBlock(
"icon");
 
  582                        $tpl->parseCurrentBlock();
 
  583                        $tpl->setCurrentBlock(
"link_row");
 
  584                        $tpl->setVariable(
"ROWCLASS", $css_row);
 
  585                        $tpl->setVariable(
"TXT_CHAPTER", 
"..");
 
  586                        $this->ctrl->setParameter($this, 
"mep_fold", $parent_id);
 
  588                            $tpl->setVariable(
"LINK", 
"#");
 
  591                                " onclick=\"return il.IntLink.setMepPoolFolder('" . $parent_id . 
"');\" " 
  596                                $this->ctrl->getLinkTarget($this, 
"setMedPoolFolder")
 
  599                        $tpl->parseCurrentBlock();
 
  600                        $tpl->setCurrentBlock(
"row");
 
  601                        $tpl->parseCurrentBlock();
 
  603                    foreach ($objs as $obj) {
 
  604                        if ($obj[
"type"] == 
"fold") {
 
  605                            $css_row = ($css_row == 
"tblrow2")
 
  608                            $tpl->setCurrentBlock(
"icon");
 
  610                            $tpl->parseCurrentBlock();
 
  611                            $tpl->setCurrentBlock(
"link_row");
 
  612                            $tpl->setVariable(
"ROWCLASS", $css_row);
 
  613                            $tpl->setVariable(
"TXT_CHAPTER", $obj[
"title"]);
 
  614                            $this->ctrl->setParameter($this, 
"mep_fold", $obj[
"child"]);
 
  616                                $tpl->setVariable(
"LINK", 
"#");
 
  619                                    " onclick=\"return il.IntLink.setMepPoolFolder('" . $obj[
"child"] . 
"');\" " 
  624                                    $this->ctrl->getLinkTarget($this, 
"setMedPoolFolder")
 
  627                            $tpl->parseCurrentBlock();
 
  641                        $tpl->setCurrentBlock(
"row");
 
  642                        $tpl->parseCurrentBlock();
 
  644                    $tpl->setCurrentBlock(
"chapter_list");
 
  645                    $tpl->parseCurrentBlock();
 
  652                require_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
 
  656                $tpl->setCurrentBlock(
"chapter_list");
 
  657                $tpl->setVariable(
"TXT_CONTENT_OBJECT", $this->lng->txt(
"obj_wiki"));
 
  659                $tpl->setVariable(
"THEAD", $this->lng->txt(
"link_wpages"));
 
  660                $tpl->setCurrentBlock(
"change_cont_obj");
 
  661                $tpl->setVariable(
"CMD_CHANGE_CONT_OBJ", 
"changeTargetObject");
 
  662                $tpl->setVariable(
"BTN_CHANGE_CONT_OBJ", $this->lng->txt(
"change"));
 
  663                $tpl->parseCurrentBlock();
 
  665                foreach ($wpages as $wpage) {
 
  676                $tpl->setCurrentBlock(
"chapter_list");
 
  677                $tpl->parseCurrentBlock();
 
  681            case "PortfolioPage":
 
  682            case "PortfolioTemplatePage":
 
  684                require_once(
"./Modules/Portfolio/classes/class.ilPortfolioPage.php");
 
  688                $tpl->setCurrentBlock(
"chapter_list");
 
  691                $tpl->setVariable(
"THEAD", $this->lng->txt(
"pages"));
 
  693                foreach ($ppages as $ppage) {
 
  706                $tpl->setCurrentBlock(
"chapter_list");
 
  707                $tpl->parseCurrentBlock();
 
  711            case "RepositoryItem":
 
  717                if (!is_object($this->uploaded_file)) {
 
  727                $tpl->setVariable(
"LINK_HELP_CONTENT", $this->
addUser());
 
  749        if (!is_object($this->uploaded_file)) {
 
  750            $tpl = 
new ilTemplate(
"tpl.link_file.html", 
true, 
true, 
"Services/Link");
 
  751            $tpl->setCurrentBlock(
"form");
 
  754                $ilCtrl->getFormAction($this, 
"saveFileLink", 
"", 
true)
 
  756            $tpl->setVariable(
"TXT_SELECT_FILE", 
$lng->txt(
"cont_select_file"));
 
  757            $tpl->setVariable(
"TXT_SAVE_LINK", 
$lng->txt(
"cont_create_link"));
 
  758            $tpl->setVariable(
"CMD_SAVE_LINK", 
"saveFileLink");
 
  759            include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
 
  762            $tpl->setVariable(
"INPUT", $fi->getToolbarHTML());
 
  763            $tpl->parseCurrentBlock();
 
  766            $tpl = 
new ilTemplate(
"tpl.link_file.html", 
true, 
true, 
"Services/Link");
 
  767            $tpl->setCurrentBlock(
"link_js");
 
  773                '[iln dfile=\x22' . $this->uploaded_file->getId() . 
'\x22]' 
  781                $this->uploaded_file->getTitle()
 
  793        if ($_FILES[
"link_file"][
"name"] != 
"") {
 
  794            include_once(
"./Modules/File/classes/class.ilObjFile.php");
 
  796            $fileObj->setType(
"file");
 
  797            $fileObj->setTitle($_FILES[
"link_file"][
"name"]);
 
  798            $fileObj->setDescription(
"");
 
  799            $fileObj->setFileName($_FILES[
"link_file"][
"name"]);
 
  800            $fileObj->setFileType($_FILES[
"link_file"][
"type"]);
 
  801            $fileObj->setFileSize($_FILES[
"link_file"][
"size"]);
 
  802            $fileObj->setMode(
"filelist");
 
  805            $fileObj->createDirectory();
 
  806            $fileObj->raiseUploadError(
false);
 
  807            $fileObj->getUploadFile(
 
  808                $_FILES[
"link_file"][
"tmp_name"],
 
  809                $_FILES[
"link_file"][
"name"]
 
  811            $this->uploaded_file = $fileObj;
 
  823        $med = &$mob->getMediaItem(
"Standard");
 
  824        $target = $med->getThumbnailTarget(
"small");
 
  827            $tpl->setCurrentBlock(
"thumbnail_link");
 
  830            $tpl->setCurrentBlock(
"thumbnail_js");
 
  835            $tpl->setCurrentBlock(
"thumb" . $suff);
 
  837            $tpl->parseCurrentBlock();
 
  839            $tpl->setVariable(
"NO_THUMB", 
" ");
 
  843            $tpl->setCurrentBlock(
"thumbnail_link");
 
  845            $tpl->setCurrentBlock(
"thumbnail_js");
 
  847        $tpl->parseCurrentBlock();
 
  858        $ctrl->setParameter($this, 
"link_type", 
$_GET[
"link_type"]);
 
  859        $base_type = explode(
"_", 
$_GET[
"link_type"])[0];
 
  861            $ctrl->setParameter($this, 
"link_par_ref_id", 0);
 
  862            $ctrl->setParameter($this, 
"link_par_obj_id", 0);
 
  865        $ctrl->redirect($this, 
"showLinkHelp", 
"", 
true);
 
  874        $ctrl->setParameter($this, 
"link_par_fold_id", 
$_GET[
"mep_fold"]);
 
  875        $ctrl->redirect($this, 
"showLinkHelp", 
"", 
true);
 
  884        include_once(
"./Services/Link/classes/class.ilLinkTargetObjectExplorerGUI.php");
 
  889        $white = array(
"root", 
"cat", 
"crs", 
"fold", 
"grp");
 
  892        $exp->setClickableType(
$a_type);
 
  895            $exp->setClickableType(
"prtt");
 
  898        $exp->setTypeWhiteList(
$white);
 
  901        if (!$exp->handleCommand()) {
 
  902            return $exp->getHTML();
 
  913        $ilCtrl->setParameter($this, 
"link_par_fold_id", 
"");
 
  914        if (
$_GET[
"do"] == 
"set") {
 
  915            $ilCtrl->setParameter($this, 
"link_par_ref_id", 
$_GET[
"sel_id"]);
 
  916            $ilCtrl->redirect($this, 
"showLinkHelp", 
"", 
true);
 
  920        $ilCtrl->setParameter($this, 
"link_type", $this->link_type);
 
  922        $tpl = 
new ilTemplate(
"tpl.link_help_explorer.html", 
true, 
true, 
"Services/Link");
 
  926        $tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_choose_" . $this->parent_type[$this->base_link_type]));
 
  929        $tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this, 
"resetLinkList", 
"", 
true));
 
  930        $tpl->setVariable(
"BTN_RESET", 
"resetLinkList");
 
  931        $tpl->setVariable(
"TXT_RESET", $this->lng->txt(
"back"));
 
  933        if ($this->parent_type[$this->base_link_type] == 
"mep") {
 
  934            $tpl->setCurrentBlock(
"sel_clipboard");
 
  935            $this->ctrl->setParameter($this, 
"do", 
"set");
 
  937                $tpl->setVariable(
"LINK_CLIPBOARD", 
"#");
 
  940                    " onclick=\"return il.IntLink.selectLinkTargetObject('mep', 0, '" . $this->link_type . 
"');\" " 
  943                $tpl->setVariable(
"LINK_CLIPBOARD", $this->ctrl->getLinkTarget($this, 
"changeTargetObject"));
 
  945            $tpl->setVariable(
"TXT_PERS_CLIPBOARD", $this->lng->txt(
"clipboard"));
 
  946            $tpl->parseCurrentBlock();
 
  949        $tpl->parseCurrentBlock();
 
  963        $ilCtrl->setParameter($this, 
"link_par_fold_id", 
"");
 
  966        include_once(
"./Services/Link/classes/class.ilIntLinkRepItemExplorerGUI.php");
 
  970        if (!$exp->handleCommand()) {
 
  971            return $exp->getHTML();
 
  996        $lng->loadLanguageModule(
"link");
 
  998        $tpl->addJavaScript(
"./Services/UIComponent/Explorer/js/ilExplorer.js");
 
  999        include_once(
"./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
 
 1002        include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
 
 1005        $tpl->addJavascript(
"./Services/Link/js/ilIntLink.js");
 
 1008        $tpl->addJavaScript(
"Services/Form/js/Form.js");
 
 1010        include_once(
"./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
 
 1012        $modal->setHeading(
$lng->txt(
"link_link"));
 
 1013        $modal->setId(
"ilIntLinkModal");
 
 1014        $modal->setBody(
"<div id='ilIntLinkModalContent'></div>");
 
 1016        $ltpl = 
new ilTemplate(
"tpl.int_link_panel.html", 
true, 
true, 
"Services/Link");
 
 1017        $ltpl->setVariable(
"MODAL", $modal->getHTML());
 
 1019        $ltpl->setVariable(
"IL_INT_LINK_URL", $a_url);
 
 1021        return $ltpl->get();
 
 1034        $a_anchors = array(),
 
 1035        $a_link_content = 
"" 
 1037        $chapterRowBlock = 
"chapter_row_js";
 
 1038        $anchor_row_block = 
"anchor_link_js";
 
 1040        $target_str = ($this->link_target == 
"")
 
 1042            : 
" target=\"" . $this->link_target . 
"\"";
 
 1044        if (count($a_anchors) > 0) {
 
 1045            foreach ($a_anchors as $anchor) {
 
 1059                    $tpl->setCurrentBlock($anchor_row_block);
 
 1062                        $this->
prepareJavascriptOutput(
"[iln " . $a_bb_type . 
"=\"" . $a_obj_id . 
"\"" . $target_str . 
" anchor=\"$anchor\"]")
 
 1064                    $tpl->setVariable(
"ALINK_END", 
"[/iln]");
 
 1065                    $tpl->setVariable(
"TXT_LINK", 
"#" . $anchor);
 
 1066                    $tpl->parseCurrentBlock();
 
 1071        $this->css_row = ($this->css_row == 
"tblrow1")
 
 1076            require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
 
 1077            require_once(
"./Services/MediaObjects/classes/class.ilImageMapEditorGUI.php");
 
 1079            if (
$a_type == 
"MediaObject") {
 
 1082            $tpl->setCurrentBlock(
"link_row");
 
 1083            $tpl->setVariable(
"ROWCLASS", $this->css_row);
 
 1084            $tpl->setVariable(
"TXT_CHAPTER", $a_title);
 
 1090                "&linktarget=il__" . $a_type_short . 
"_" . $a_obj_id .
 
 1091                "&linktargetframe=" . $this->link_target
 
 1094            $tpl->parseCurrentBlock();
 
 1096            $tpl->setCurrentBlock($chapterRowBlock);
 
 1097            if (
$a_type == 
"MediaObject") {
 
 1099                $tpl->setCurrentBlock($chapterRowBlock);
 
 1101            $tpl->setVariable(
"ROWCLASS", $this->css_row);
 
 1102            $tpl->setVariable(
"TXT_CHAPTER", $a_title);
 
 1103            if (
$a_type == 
"MediaObject" && empty($target_str)) {
 
 1108                $tpl->setVariable(
"LINK_END", 
"");
 
 1114                $tpl->setVariable(
"LINK_CONTENT", $a_link_content);
 
 1115                $tpl->setVariable(
"LINK_END", 
"[/iln]");
 
 1117            $tpl->parseCurrentBlock();
 
 1120        $tpl->setCurrentBlock(
"row");
 
 1121        $tpl->parseCurrentBlock();
 
 1141        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1143        $form->setId(
"link_user_search_form");
 
 1146        $ti = 
new ilTextInputGUI($this->lng->txt(
"obj_user"), 
"usr_search_str");
 
 1147        $ti->setValue(
$_POST[
"usr_search_str"]);
 
 1148        $form->addItem($ti);
 
 1150        $form->addCommandButton(
"searchUser", $this->lng->txt(
"search"));
 
 1168        if (strlen(
$_POST[
"usr_search_str"]) < 3) {
 
 1169            if (strlen(
$_POST[
"usr_search_str"]) > 0) {
 
 1170                $lng->loadLanguageModule(
"search");
 
 1171                return $tpl->getMessageHTML(
$lng->txt(
"search_minimum_three"), 
"info");
 
 1178        $form->checkInput();
 
 1181        if (count(
$users) == 0) {
 
 1182            return $tpl->getMessageHTML(
$lng->txt(
"cont_user_search_did_not_match"), 
"info");
 
 1185        $f = 
$DIC->ui()->factory();
 
 1186        $r = 
$DIC->ui()->renderer();
 
 1190            $b = 
$f->button()->standard(
$lng->txt(
"insert"), 
"#")
 
 1191                ->withOnLoadCode(
function (
$id) use (
$user) {
 
 1193                    '$("#' . 
$id . 
"\").click(function(ev) { il.IntLink.addInternalLink('[iln user=\"" .
 
 1197            $cards[] = 
$f->card()->standard(
$name, 
$f->image()->responsive(ilObjUser::_getPersonalPicturePath(
$user, 
"small"), 
$name))
 
 1198                ->withSections(array($b));
 
 1200        $deck = 
$f->deck($cards)->withLargeCardsSize();
 
 1202        return $r->renderAsync($deck);
 
An exception for terminatinating execution or to throw for unit testing.
static init($a_main_tpl=null)
Init JS.
static _recoverParameters()
Recover parameters from session variables (static)
Internal Link: Repository Item Selector Explorer.
__construct($a_default_link_type, $a_default_parent_id, $a_is_ref=true)
filterLinkType($a_link_type)
refreshRepositorySelector()
Refresh Repository Selector.
setMedPoolFolder()
select media pool folder
getTargetExplorer()
Cange target object.
static getInitHTML($a_url)
Get initialisation HTML to use interna link editing.
saveFileLink()
Save file link.
renderLink( $tpl, $a_title, $a_obj_id, $a_type, $a_type_short, $a_bb_type, $a_anchors=array(), $a_link_content="")
Render internal link item.
selectRepositoryItem()
select repository item explorer
getUserSearchResult()
Search user.
getFileLinkHTML()
Get HTML for file link.
setFilterWhiteList($a_white_list)
Set filter list as white list (per detault it is a black list)
initUserSearchForm()
Init user search form.
setMode($a_mode="text")
Set mode.
changeTargetObject($a_type="")
Cange target object.
changeLinkType()
change link type
showLinkHelp()
Show link help list.
init()
Init (first in execute command)
outputThumbnail(&$tpl, $a_id, $a_mode="")
output thumbnail
setSetLinkTargetScript($a_script)
prepareJavascriptOutput($str)
Prepare output for JS enabled editing.
static searchUsers($a_search_str)
Search users.
static getPageList($lm_id)
static
Internal Link: Repository Item Selector Explorer.
static getInstance()
Get instance.
Class ilObjLearningModule.
static _lookupLogin($a_user_id)
lookup login
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 getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
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 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)
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(ilTemplate $a_main_tpl=null)
Init YUI Connection module.
if(!array_key_exists('StateId', $_REQUEST)) $id
if(isset($_POST['submit'])) $form