ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilInternalLinkGUI Class Reference

Class ilInternalLinkGUI. More...

+ Collaboration diagram for ilInternalLinkGUI:

Public Member Functions

 ilInternalLinkGUI ($a_default_type, $a_default_obj)
 
 initLinkTypes ()
 Initialize link types. More...
 
 determineLinkType ()
 Determine current link type. More...
 
 setMode ($a_mode="text")
 Set mode. More...
 
 setSetLinkTargetScript ($a_script)
 
 setReturn ($a_return)
 
 getSetLinkTargetScript ()
 
 filterLinkType ($a_link_type)
 
 setFilterWhiteList ($a_white_list)
 Set filter list as white list (per detault it is a black list) More...
 
executeCommand ()
 
 resetSessionVars ()
 
 resetLinkList ()
 
 closeLinkHelp ()
 
 prepareJavascriptOutput ($str)
 Prepare output for JS enabled editing. More...
 
 showLinkHelp ()
 Show link help list. More...
 
 getFileLinkHTML ()
 Get HTML for file link. More...
 
 saveFileLink ()
 Save file link. More...
 
 outputThumbnail (&$tpl, $a_id, $a_mode="")
 output thumbnail More...
 
 changeLinkType ()
 change link type More...
 
 setMedPoolFolder ()
 select media pool folder More...
 
 getTargetExplorer ($a_type="")
 Cange target object. More...
 
 changeTargetObject ($a_type="")
 Cange target object. More...
 
 selectRepositoryItem ()
 select repository item explorer More...
 
 refreshRepositorySelector ()
 Refresh Repository Selector. More...
 
 isEnabledJavaScript ()
 determine, wether js is used More...
 
 getInitHTML ($a_url, $a_move_to_body=false)
 Get initialisation HTML to use interna link editing. More...
 
 renderLink ($tpl, $a_title, $a_obj_id, $a_type, $a_type_short, $a_bb_type, $a_anchors=array())
 Render internal link item. More...
 

Static Public Member Functions

static _doJSEditing ()
 

Data Fields

 $default_type
 
 $default_obj
 
 $link_type
 
 $link_target
 
 $lng
 
 $mode
 
 $set_link_script
 
 $ctrl
 
 $tree
 
 $ltypes = array()
 

Detailed Description

Class ilInternalLinkGUI.

Some gui methods to handle internal links

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 17 of file class.ilInternalLinkGUI.php.

Member Function Documentation

◆ _doJSEditing()

static ilInternalLinkGUI::_doJSEditing ( )
static
Parameters

return

Definition at line 1057 of file class.ilInternalLinkGUI.php.

1058 {
1059 return true;
1061 }
_doJSEditing()
checks if current user has activated js editing and if browser is js capable

References ilPageEditorGUI\_doJSEditing().

+ Here is the call graph for this function:

◆ changeLinkType()

ilInternalLinkGUI::changeLinkType ( )

change link type

Definition at line 847 of file class.ilInternalLinkGUI.php.

848 {
849 $_SESSION["il_link_type"] = $_POST["ltype"];
850 $this->determineLinkType();
851 $this->showLinkHelp();
852 }
$_SESSION["AccountId"]
determineLinkType()
Determine current link type.
showLinkHelp()
Show link help list.
$_POST['username']
Definition: cron.php:12

References $_POST, $_SESSION, determineLinkType(), and showLinkHelp().

+ Here is the call graph for this function:

◆ changeTargetObject()

ilInternalLinkGUI::changeTargetObject (   $a_type = "")

Cange target object.

Definition at line 916 of file class.ilInternalLinkGUI.php.

917 {
918 global $ilCtrl;
919
920 $_SESSION["il_link_mep_obj"] = "";
921 if($_GET["do"] == "set")
922 {
923 switch ($_GET["target_type"])
924 {
925 case "glo":
926 $_SESSION["il_link_glossary"] = $_GET["sel_id"];
927 break;
928
929 case "mep":
930 $_SESSION["il_link_mep"] = $_GET["sel_id"];
931 break;
932
933 case "wiki":
934 $_SESSION["il_link_wiki"] = $_GET["sel_id"];
935 break;
936
937 default:
938 $_SESSION["il_link_cont_obj"] = $_GET["sel_id"];
939 break;
940 }
941 $this->showLinkHelp();
942 return;
943 }
944
945 if(empty($a_type))
946 {
947 if (!empty($_GET["target_type"]))
948 {
949 $a_type = $_GET["target_type"];
950 }
951 else
952 {
953 $this->determineLinkType();
954 $a_type = "lm";
955 if ($this->link_type == "GlossaryItem")
956 {
957 $a_type = "glo";
958 }
959 if ($this->link_type == "Media")
960 {
961 $a_type = "mep";
962 }
963 if ($this->link_type == "WikiPage")
964 {
965 $a_type = "wiki";
966 }
967 }
968 }
969
970 $tpl =& new ilTemplate("tpl.link_help_explorer.html", true, true, "Services/Link");
971
972 $output = $this->getTargetExplorer($a_type);
973
974 if ($a_type == "glo")
975 {
976 $tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_choose_glossary"));
977 }
978 else if ($a_type == "wiki")
979 {
980 $tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_choose_wiki"));
981 }
982 else if ($a_type == "mep")
983 {
984 $tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_choose_media_source"));
985 }
986 else
987 {
988 $tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_choose_cont_obj"));
989 }
990 $tpl->setVariable("EXPLORER",$output);
991 $tpl->setVariable("ACTION", $this->ctrl->getFormAction($this, "resetLinkList", "", true));
992 $tpl->setVariable("BTN_RESET", "resetLinkList");
993 $tpl->setVariable("TXT_RESET", $this->lng->txt("back"));
994
995 if ($a_type == "mep")
996 {
997 $tpl->setCurrentBlock("sel_clipboard");
998 $this->ctrl->setParameter($this, "do", "set");
999 if ($ilCtrl->isAsynch())
1000 {
1001 $tpl->setVariable("LINK_CLIPBOARD", "#");
1002 $tpl->setVariable("CLIPBOARD_ONCLICK",
1003 " onclick=\"return il.IntLink.selectLinkTargetObject('mep', 0);\" ");
1004
1005 }
1006 else
1007 {
1008 $tpl->setVariable("LINK_CLIPBOARD", $this->ctrl->getLinkTarget($this, "changeTargetObject"));
1009 }
1010 $tpl->setVariable("TXT_PERS_CLIPBOARD", $this->lng->txt("clipboard"));
1011 $tpl->parseCurrentBlock();
1012 }
1013
1014 $tpl->parseCurrentBlock();
1015
1016 echo $tpl->get();
1017 exit;
1018 }
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
getTargetExplorer($a_type="")
Cange target object.
special template class to simplify handling of ITX/PEAR
global $ilCtrl
Definition: ilias.php:18
exit
Definition: login.php:54

References $_GET, $_SESSION, $ilCtrl, $tpl, determineLinkType(), exit, getTargetExplorer(), and showLinkHelp().

Referenced by showLinkHelp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ closeLinkHelp()

ilInternalLinkGUI::closeLinkHelp ( )

Definition at line 174 of file class.ilInternalLinkGUI.php.

175 {
176 if ($this->return == "")
177 {
178 $this->ctrl->returnToParent($this);
179 }
180 else
181 {
182 ilUtil::redirect($this->return);
183 }
184 }
static redirect($a_script)
http redirect to other script

References ilUtil\redirect().

+ Here is the call graph for this function:

◆ determineLinkType()

ilInternalLinkGUI::determineLinkType ( )

Determine current link type.

Definition at line 84 of file class.ilInternalLinkGUI.php.

85 {
86 // determine link type and target
87 $ltype = ($_SESSION["il_link_type"] == "")
88 ? $this->default_type
89 : $_SESSION["il_link_type"];
90 $ltype_arr = explode("_", $ltype);
91
92 if (!isset($this->ltypes[$ltype_arr[0]]) &&
93 !isset($this->ltypes[$ltype]))
94 {
95 $this->link_type = $this->default_type;
96 }
97 else
98 {
99 $this->link_type = ($ltype_arr[0] == "")
100 ? $this->default_type
101 : $ltype_arr[0];
102 $this->link_target = $ltype_arr[1];
103 }
104 }

References $_SESSION, and $default_type.

Referenced by changeLinkType(), changeTargetObject(), resetLinkList(), and showLinkHelp().

+ Here is the caller graph for this function:

◆ executeCommand()

& ilInternalLinkGUI::executeCommand ( )

Definition at line 145 of file class.ilInternalLinkGUI.php.

146 {
147 $next_class = $this->ctrl->getNextClass($this);
148
149 $cmd = $this->ctrl->getCmd("showLinkHelp");
150 switch($next_class)
151 {
152 default:
153 $ret =& $this->$cmd();
154 break;
155 }
156
157 return $ret;
158 }
$cmd
Definition: sahs_server.php:35

References $cmd, and $ret.

◆ filterLinkType()

ilInternalLinkGUI::filterLinkType (   $a_link_type)

Definition at line 129 of file class.ilInternalLinkGUI.php.

130 {
131 $this->filter_link_types[] = $a_link_type;
132 }

◆ getFileLinkHTML()

ilInternalLinkGUI::getFileLinkHTML ( )

Get HTML for file link.

Returns
string file link html

Definition at line 722 of file class.ilInternalLinkGUI.php.

723 {
724 global $ilCtrl, $lng;
725
726 if (!is_object($this->uploaded_file))
727 {
728 $tpl = new ilTemplate("tpl.link_file.html", true, true, "Services/Link");
729 $tpl->setCurrentBlock("form");
730 $tpl->setVariable("FORM_ACTION",
731 $ilCtrl->getFormAction($this, "saveFileLink", "", true));
732 $tpl->setVariable("TXT_SELECT_FILE", $lng->txt("cont_select_file"));
733 $tpl->setVariable("TXT_SAVE_LINK", $lng->txt("cont_create_link"));
734 $tpl->setVariable("CMD_SAVE_LINK", "saveFileLink");
735 include_once("./Services/Form/classes/class.ilFileInputGUI.php");
736 $fi = new ilFileInputGUI("", "link_file");
737 $fi->setSize(15);
738 $tpl->setVariable("INPUT", $fi->getToolbarHTML());
739 $tpl->parseCurrentBlock();
740 return $tpl->get();
741 }
742 else
743 {
744 $tpl = new ilTemplate("tpl.link_file.html", true, true, "Services/Link");
745 $tpl->setCurrentBlock("link_js");
746// $tpl->setVariable("LINK_FILE",
747// $this->prepareJavascriptOutput("[iln dfile=\"".$this->uploaded_file->getId()."\"] [/iln]")
748// );
749 $tpl->setVariable("TAG_B",
750 '[iln dfile=\x22'.$this->uploaded_file->getId().'\x22]');
751 $tpl->setVariable("TAG_E",
752 "[/iln]");
753 $tpl->setVariable("TXT_FILE",
754 $this->uploaded_file->getTitle());
755// $tpl->parseCurrentBlock();
756 return $tpl->get();
757 }
758 }
This class represents a file property in a property form.

References $ilCtrl, $lng, and $tpl.

Referenced by showLinkHelp().

+ Here is the caller graph for this function:

◆ getInitHTML()

ilInternalLinkGUI::getInitHTML (   $a_url,
  $a_move_to_body = false 
)

Get initialisation HTML to use interna link editing.

Definition at line 1085 of file class.ilInternalLinkGUI.php.

1086 {
1087 global $tpl, $lng;
1088
1089 $lng->loadLanguageModule("link");
1090
1091 $tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
1092 include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
1094
1095 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
1097
1098 $tpl->addJavascript("./Services/Link/js/ilIntLink.js");
1099
1100 include_once("./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1101 $modal = ilModalGUI::getInstance();
1102 $modal->setHeading($lng->txt("link_link"));
1103 $modal->setId("ilIntLinkModal");
1104 $modal->setBody("<div id='ilIntLinkModalContent'></div>");
1105
1106 $ltpl = new ilTemplate("tpl.int_link_panel.html", true, true, "Services/Link");
1107 $ltpl->setVariable("MODAL", $modal->getHTML());
1108
1109 $ltpl->setVariable("IL_INT_LINK_URL", $a_url);
1110
1111 return $ltpl->get();
1112 }
static getInstance()
Get instance.
static initConnection()
Init YUI Connection module.

References $lng, $tpl, ilModalGUI\getInstance(), ilExplorerBaseGUI\init(), and ilYuiUtil\initConnection().

Referenced by ilPCDataTableGUI\editData(), ilImageMapEditorGUI\editMapArea(), ilPageContentGUI\getBBMenu(), ilLinkInputGUI\getContentOutsideFormTag(), ilObjLinkResourceGUI\manage(), and ilPageObjectGUI\showPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSetLinkTargetScript()

ilInternalLinkGUI::getSetLinkTargetScript ( )

Definition at line 124 of file class.ilInternalLinkGUI.php.

References $set_link_script.

Referenced by outputThumbnail(), renderLink(), and selectRepositoryItem().

+ Here is the caller graph for this function:

◆ getTargetExplorer()

ilInternalLinkGUI::getTargetExplorer (   $a_type = "")

Cange target object.

Definition at line 866 of file class.ilInternalLinkGUI.php.

867 {
868 global $ilCtrl;
869
870 $ilCtrl->setParameter($this, "target_type", $a_type);
871 include_once("./Services/Link/classes/class.ilLinkTargetObjectExplorerGUI.php");
872 $exp = new ilLinkTargetObjectExplorerGUI($this, "getTargetExplorer");
873
874 if ($a_type == "")
875 {
876 $a_type = $_GET["target_type"];
877 }
878
879 $white = array("root", "cat", "crs", "fold", "grp");
880
881 switch ($a_type)
882 {
883 case "glo":
884 $white[] = "glo";
885 $exp->setClickableType("glo");
886 break;
887
888 case "wiki":
889 $white[] = "wiki";
890 $exp->setClickableType("wiki");
891 break;
892
893 case "mep":
894 $white[] = "mep";
895 $exp->setClickableType("mep");
896 break;
897
898 default:
899 $white[] = "lm";
900 $exp->setClickableType("lm");
901 break;
902 }
903
904 $exp->setTypeWhiteList($white);
905
906
907 if (!$exp->handleCommand())
908 {
909 return $exp->getHTML();
910 }
911 }
Internal Link: Repository Item Selector Explorer.
$white
Definition: example_030.php:84

References $_GET, $ilCtrl, and $white.

Referenced by changeTargetObject().

+ Here is the caller graph for this function:

◆ ilInternalLinkGUI()

ilInternalLinkGUI::ilInternalLinkGUI (   $a_default_type,
  $a_default_obj 
)

Definition at line 30 of file class.ilInternalLinkGUI.php.

31 {
32 global $lng, $ilias, $ilCtrl, $tree;
33
34 $lng->loadLanguageModule("link");
35
36 $this->initLinkTypes();
37 if (($_SESSION["il_link_cont_obj"] != "" && !$tree->isInTree($_SESSION["il_link_cont_obj"])) ||
38 ($_SESSION["il_link_glossary"] != "" && !$tree->isInTree($_SESSION["il_link_glossary"])) ||
39 ($_SESSION["il_link_wiki"] != "" && !$tree->isInTree($_SESSION["il_link_wiki"])) ||
40 ($_SESSION["il_link_mep"] != "" && !$tree->isInTree($_SESSION["il_link_mep"])))
41 {
42 $this->resetSessionVars();
43 }
44
45 $this->lng = $lng;
46 $this->tree = $tree;
47 $this->ctrl = $ilCtrl;
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();
52 $this->mode = "text";
53
54 }
initLinkTypes()
Initialize link types.

References $_SESSION, $ilCtrl, $lng, $tree, initLinkTypes(), and resetSessionVars().

+ Here is the call graph for this function:

◆ initLinkTypes()

ilInternalLinkGUI::initLinkTypes ( )

Initialize link types.

Definition at line 59 of file class.ilInternalLinkGUI.php.

60 {
61 global $lng;
62
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")
78 );
79 }

References $lng.

Referenced by ilInternalLinkGUI().

+ Here is the caller graph for this function:

◆ isEnabledJavaScript()

ilInternalLinkGUI::isEnabledJavaScript ( )

determine, wether js is used

Definition at line 1067 of file class.ilInternalLinkGUI.php.

1068 {
1069 global $ilias;
1070
1071 include_once("./Services/COPage/classes/class.ilPageEditorGUI.php");
1072
1073 if (self::_doJSEditing())
1074 {
1075 return true;
1076 }
1077
1078 return false;
1079 }

Referenced by outputThumbnail(), renderLink(), and showLinkHelp().

+ Here is the caller graph for this function:

◆ outputThumbnail()

ilInternalLinkGUI::outputThumbnail ( $tpl,
  $a_id,
  $a_mode = "" 
)

output thumbnail

Definition at line 794 of file class.ilInternalLinkGUI.php.

795 {
796 // output thumbnail
797 $mob =& new ilObjMediaObject($a_id);
798 $med =& $mob->getMediaItem("Standard");
799 $target = $med->getThumbnailTarget("small");
800 $suff = "";
801 if ($this->getSetLinkTargetScript() != "")
802 {
803 $tpl->setCurrentBlock("thumbnail_link");
804 $suff = "_link";
805 }
806 else if ($this->isEnabledJavaScript())
807 {
808 $tpl->setCurrentBlock("thumbnail_js");
809 $suff = "_js";
810 }
811 else
812 {
813 $tpl->setCurrentBlock("thumbnail");
814 }
815
816 if ($target != "")
817 {
818 $tpl->setCurrentBlock("thumb".$suff);
819 $tpl->setVariable("SRC_THUMB", $target);
820 $tpl->parseCurrentBlock();
821 }
822 else
823 {
824 $tpl->setVariable("NO_THUMB", "&nbsp;");
825 }
826
827 if ($this->getSetLinkTargetScript() != "")
828 {
829 $tpl->setCurrentBlock("thumbnail_link");
830 }
831 else if ($this->isEnabledJavaScript())
832
833 {
834 $tpl->setCurrentBlock("thumbnail_js");
835 }
836 else
837 {
838 $tpl->setCurrentBlock("thumbnail");
839 }
840 $tpl->parseCurrentBlock();
841 }
isEnabledJavaScript()
determine, wether js is used
Class ilObjMediaObject.

References $tpl, getSetLinkTargetScript(), and isEnabledJavaScript().

Referenced by renderLink().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareJavascriptOutput()

ilInternalLinkGUI::prepareJavascriptOutput (   $str)

Prepare output for JS enabled editing.

Definition at line 189 of file class.ilInternalLinkGUI.php.

190 {
191 global $ilUser;
192
193 include_once("./Services/COPage/classes/class.ilPageEditorGUI.php");
194 if (self::_doJSEditing())
195 {
196 $str = htmlspecialchars($str, ENT_QUOTES);
197 }
198 return($str);
199 }
global $ilUser
Definition: imgupload.php:15

References $ilUser.

Referenced by renderLink().

+ Here is the caller graph for this function:

◆ refreshRepositorySelector()

ilInternalLinkGUI::refreshRepositorySelector ( )

Refresh Repository Selector.

Definition at line 1044 of file class.ilInternalLinkGUI.php.

1045 {
1046 $output = $this->selectRepositoryItem();
1047 echo $output;
1048 exit;
1049 }
selectRepositoryItem()
select repository item explorer

References exit, and selectRepositoryItem().

+ Here is the call graph for this function:

◆ renderLink()

ilInternalLinkGUI::renderLink (   $tpl,
  $a_title,
  $a_obj_id,
  $a_type,
  $a_type_short,
  $a_bb_type,
  $a_anchors = array() 
)

Render internal link item.

Definition at line 1117 of file class.ilInternalLinkGUI.php.

1119 {
1120 $chapterRowBlock = "chapter_row";
1121 $anchor_row_block = "anchor_link";
1122 if ($this->isEnabledJavaScript())
1123 {
1124
1125 $chapterRowBlock .= "_js";
1126 $anchor_row_block .= "_js";
1127 }
1128
1129 $target_str = ($this->link_target == "")
1130 ? ""
1131 : " target=\"".$this->link_target."\"";
1132
1133 if (count($a_anchors) > 0)
1134 {
1135 foreach ($a_anchors as $anchor)
1136 {
1137 $tpl->setCurrentBlock($anchor_row_block);
1138 $tpl->setVariable("ALINK_BEGIN",
1139 $this->prepareJavascriptOutput("[iln ".$a_bb_type."=\"".$a_obj_id."\"".$target_str." anchor=\"$anchor\"]"));
1140 $tpl->setVariable("ALINK_END", "[/iln]");
1141 $tpl->setVariable("TXT_LINK", "#".$anchor);
1142 $tpl->parseCurrentBlock();
1143 }
1144 }
1145
1146 $this->css_row = ($this->css_row == "tblrow1")
1147 ? "tblrow2"
1148 : "tblrow1";
1149
1150 if ($this->getSetLinkTargetScript() != "")
1151 {
1152 require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1153 require_once("./Services/MediaObjects/classes/class.ilImageMapEditorGUI.php");
1155 if ($a_type == "MediaObject")
1156 {
1157 $this->outputThumbnail($tpl, $a_obj_id);
1158 }
1159 $tpl->setCurrentBlock("link_row");
1160 $tpl->setVariable("ROWCLASS", $this->css_row);
1161 $tpl->setVariable("TXT_CHAPTER", $a_title);
1162 //$tpl->setVariable("LINK_TARGET", "content");
1163 $tpl->setVariable("LINK",
1165 "linktype=".$a_type.
1166 "&linktarget=il__".$a_type_short."_".$a_obj_id.
1167 "&linktargetframe=".$this->link_target));
1168 $tpl->parseCurrentBlock();
1169 }
1170 else
1171 {
1172 $tpl->setCurrentBlock($chapterRowBlock);
1173 if ($a_type == "MediaObject")
1174 {
1175 $this->outputThumbnail($tpl, $a_obj_id);
1176 $tpl->setCurrentBlock($chapterRowBlock);
1177 }
1178 $tpl->setVariable("ROWCLASS", $this->css_row);
1179 $tpl->setVariable("TXT_CHAPTER", $a_title);
1180 if ($this->isEnabledJavaScript())
1181 {
1182// $tpl->setVariable("TXT_CHAPTER_JS", htmlspecialchars(str_replace("'", "\'", $a_title)));
1183 }
1184 if ($a_type == "MediaObject" && empty($target_str))
1185 {
1186 $tpl->setVariable("LINK_BEGIN",
1187 $this->prepareJavascriptOutput("[iln ".$a_bb_type."=\"".$a_obj_id."\"/]"));
1188 $tpl->setVariable("LINK_END", "");
1189 }
1190 else
1191 {
1192 $tpl->setVariable("LINK_BEGIN",
1193 $this->prepareJavascriptOutput("[iln ".$a_bb_type."=\"".$a_obj_id."\"".$target_str."]"));
1194 $tpl->setVariable("LINK_END", "[/iln]");
1195 }
1196 $tpl->parseCurrentBlock();
1197 }
1198
1199 $tpl->setCurrentBlock("row");
1200 $tpl->parseCurrentBlock();
1201
1202 }
_recoverParameters()
Recover parameters from session variables (static)
outputThumbnail(&$tpl, $a_id, $a_mode="")
output thumbnail
prepareJavascriptOutput($str)
Prepare output for JS enabled editing.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
if(!file_exists(getcwd().'/ilias.ini.php')) if(isset( $_GET["client_id"]))
registration confirmation script for ilias
Definition: confirmReg.php:20

References $tpl, ilImageMapEditorGUI\_recoverParameters(), ilUtil\appendUrlParameterString(), getSetLinkTargetScript(), if, isEnabledJavaScript(), outputThumbnail(), and prepareJavascriptOutput().

Referenced by showLinkHelp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetLinkList()

ilInternalLinkGUI::resetLinkList ( )

Definition at line 167 of file class.ilInternalLinkGUI.php.

168 {
169 $this->resetSessionVars();
170 $this->determineLinkType();
171 $this->showLinkHelp();
172 }

References determineLinkType(), resetSessionVars(), and showLinkHelp().

+ Here is the call graph for this function:

◆ resetSessionVars()

ilInternalLinkGUI::resetSessionVars ( )

Definition at line 160 of file class.ilInternalLinkGUI.php.

161 {
162 $_SESSION["il_link_mep"] = "";
163 $_SESSION["il_link_mep_obj"] = "";
164 $_SESSION["il_link_type"] = "";
165 }

References $_SESSION.

Referenced by ilInternalLinkGUI(), and resetLinkList().

+ Here is the caller graph for this function:

◆ saveFileLink()

ilInternalLinkGUI::saveFileLink ( )

Save file link.

Definition at line 763 of file class.ilInternalLinkGUI.php.

764 {
765 $mtpl =& new ilTemplate("tpl.link_help.html", true, true, "Services/Link");
766 $mtpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
767
768 if ($_FILES["link_file"]["name"] != "")
769 {
770 include_once("./Modules/File/classes/class.ilObjFile.php");
771 $fileObj = new ilObjFile();
772 $fileObj->setType("file");
773 $fileObj->setTitle($_FILES["link_file"]["name"]);
774 $fileObj->setDescription("");
775 $fileObj->setFileName($_FILES["link_file"]["name"]);
776 $fileObj->setFileType($_FILES["link_file"]["type"]);
777 $fileObj->setFileSize($_FILES["link_file"]["size"]);
778 $fileObj->setMode("filelist");
779 $fileObj->create();
780 // upload file to filesystem
781 $fileObj->createDirectory();
782 $fileObj->raiseUploadError(false);
783 $fileObj->getUploadFile($_FILES["link_file"]["tmp_name"],
784 $_FILES["link_file"]["name"]);
785 $this->uploaded_file = $fileObj;
786
787 }
788 $this->showLinkHelp();
789 }
Class ilObjFile.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user

References ilUtil\getStyleSheetLocation(), and showLinkHelp().

+ Here is the call graph for this function:

◆ selectRepositoryItem()

ilInternalLinkGUI::selectRepositoryItem ( )

select repository item explorer

Definition at line 1024 of file class.ilInternalLinkGUI.php.

1025 {
1026 global $ilCtrl;
1027
1028 $_SESSION["il_link_mep_obj"] = "";
1029
1030 $ilCtrl->setParameter($this, "target_type", $a_type);
1031 include_once("./Services/Link/classes/class.ilIntLinkRepItemExplorerGUI.php");
1032 $exp = new ilIntLinkRepItemExplorerGUI($this, "selectRepositoryItem");
1033 $exp->setSetLinkTargetScript($this->getSetLinkTargetScript());
1034
1035 if (!$exp->handleCommand())
1036 {
1037 return $exp->getHTML();
1038 }
1039 }
Internal Link: Repository Item Selector Explorer.

References $_SESSION, $ilCtrl, and getSetLinkTargetScript().

Referenced by refreshRepositorySelector(), and showLinkHelp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFilterWhiteList()

ilInternalLinkGUI::setFilterWhiteList (   $a_white_list)

Set filter list as white list (per detault it is a black list)

Returns
boolean white list

Definition at line 139 of file class.ilInternalLinkGUI.php.

140 {
141 $this->filter_white_list = $a_white_list;
142 }

◆ setMedPoolFolder()

ilInternalLinkGUI::setMedPoolFolder ( )

select media pool folder

Definition at line 857 of file class.ilInternalLinkGUI.php.

858 {
859 $_SESSION["il_link_mep_obj"] = $_GET["mep_fold"];
860 $this->showLinkHelp();
861 }

References $_GET, $_SESSION, and showLinkHelp().

+ Here is the call graph for this function:

◆ setMode()

ilInternalLinkGUI::setMode (   $a_mode = "text")

Set mode.

Definition at line 109 of file class.ilInternalLinkGUI.php.

110 {
111 $this->mode = $a_mode;
112 }

◆ setReturn()

ilInternalLinkGUI::setReturn (   $a_return)

Definition at line 119 of file class.ilInternalLinkGUI.php.

120 {
121 $this->return = $a_return;
122 }

◆ setSetLinkTargetScript()

ilInternalLinkGUI::setSetLinkTargetScript (   $a_script)

Definition at line 114 of file class.ilInternalLinkGUI.php.

115 {
116 $this->set_link_script = $a_script;
117 }

◆ showLinkHelp()

ilInternalLinkGUI::showLinkHelp ( )

Show link help list.

Definition at line 205 of file class.ilInternalLinkGUI.php.

206 {
207 global $ilUser, $ilCtrl;
208
209 // filter link types
210 if (!$this->filter_white_list)
211 {
212 foreach($this->filter_link_types as $link_type)
213 {
214 unset($this->ltypes[$link_type]);
215 }
216 }
217 else
218 {
219 $ltypes = array();
220 foreach($this->ltypes as $k => $l)
221 {
222 if (in_array($k, $this->filter_link_types))
223 {
224 $ltypes[$k] = $l;
225 }
226 }
227 $this->ltypes = $ltypes;
228 }
229
230
231 // determine link type and target
232 $this->determineLinkType();
233
234 $ltype = ($this->link_target != "")
235 ? $this->link_type."_".$this->link_target
236 : $this->link_type;
237
238 $def_type = ilObject::_lookupType($this->default_obj, true);
239
240 // determine content object id
241 switch($this->link_type)
242 {
243 case "PageObject":
244 case "StructureObject":
245 if (empty($_SESSION["il_link_cont_obj"]) &&
246 ($def_type != "mep" && $def_type != "glo"))
247 {
248 $_SESSION["il_link_cont_obj"] = $this->default_obj;
249 }
250 break;
251
252 case "GlossaryItem":
253 if (empty($_SESSION["il_link_glossary"]) && $def_type == "glo")
254 {
255 $_SESSION["il_link_glossary"] = $this->default_obj;
256 }
257 break;
258
259 case "Media":
260 if (empty($_SESSION["il_link_mep"]) && $def_type == "mep")
261 {
262 $_SESSION["il_link_mep"] = $this->default_obj;
263 }
264 break;
265
266 case "WikiPage":
267 if (empty($_SESSION["il_link_wiki"]) && $def_type == "wiki")
268 {
269 $_SESSION["il_link_wiki"] = $this->default_obj;
270 }
271 break;
272 }
273
274 /*
275 $target_str = ($link_target == "")
276 ? ""
277 : " target=\"".$link_target."\" ";*/
278
279
280
281 $target_str = ($this->link_target == "")
282 ? ""
283 : " target=\"".$this->link_target."\"";
284//echo "-".$this->link_type."-";
285 if(($this->link_type == "GlossaryItem") &&
286 (empty($_SESSION["il_link_glossary"]) ||
287 !in_array(ilObject::_lookupType($_SESSION["il_link_glossary"], true),
288 array("glo"))))
289 {
290 $this->changeTargetObject("glo");
291 }
292 if(($this->link_type == "WikiPage") &&
293 (empty($_SESSION["il_link_wiki"]) ||
294 !in_array(ilObject::_lookupType($_SESSION["il_link_wiki"], true),
295 array("wiki"))))
296 {
297 $this->changeTargetObject("wiki");
298 }
299 if(($this->link_type == "PageObject" || $this->link_type == "StructureObject") &&
300 (empty($_SESSION["il_link_cont_obj"]) ||
301 !in_array(ilObject::_lookupType($_SESSION["il_link_cont_obj"], true),
302 array("lm", "dbk"))))
303 {
304 $this->changeTargetObject("cont_obj");
305 }
306 if ($ilCtrl->isAsynch())
307 {
308 $tpl = new ilTemplate("tpl.link_help_asynch.html", true, true, "Services/Link");
309 }
310 else
311 {
312 $tpl =& new ilTemplate("tpl.link_help.html", true, true, "Services/Link");
313 $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
314 }
315
316 switch($this->link_type)
317 {
318 case "GlossaryItem":
319 $this->ctrl->setParameter($this, "target_type", "glo");
320 break;
321
322 case "PageObject":
323 case "StructureObject":
324 $this->ctrl->setParameter($this, "target_type", "cont_obj");
325 break;
326
327 case "Media":
328 $this->ctrl->setParameter($this, "target_type", "mep");
329 break;
330
331 case "WikiPage":
332 $this->ctrl->setParameter($this, "target_type", "wiki");
333 break;
334
335 default:
336 break;
337 }
338//echo "<br><br>:".$this->ctrl->getFormAction($this).":";
339//echo "<br>link_type:".$this->link_type;
340//echo "<br>cont_obj:".$_SESSION["il_link_cont_obj"];
341//echo "<br>link_mep".$_SESSION["il_link_mep"];
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"));
346
347
348//echo "<br><br>".$ltype;
349
350 $select_ltype = ilUtil::formSelect ($ltype,
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"));
355
356/* if ($this->isEnabledJavaScript())
357 {
358 $tpl->setVariable("BTN_CLOSE_JS", $this->lng->txt("close"));
359 }
360 else
361 {*/
362 $tpl->setVariable("CMD_CLOSE", "closeLinkHelp");
363 $tpl->setVariable("BTN_CLOSE", $this->lng->txt("close"));
364// }
365
366 $chapterRowBlock = "chapter_row";
367 $anchor_row_block = "anchor_link";
368 if ($this->isEnabledJavaScript())
369 {
370 $chapterRowBlock .= "_js";
371 $anchor_row_block .= "_js";
372 }
373
374 $obj_id = ilObject::_lookupObjId($_SESSION["il_link_cont_obj"]);
375 $type = ilObject::_lookupType($obj_id);
376
377 // switch link type
378 switch($this->link_type)
379 {
380 // page link
381 case "PageObject":
382 require_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
383 include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
384
385 $cont_obj = new ilObjLearningModule($_SESSION["il_link_cont_obj"], true);
386
387 // get all chapters
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"));
394
395
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();
400
401 foreach($nodes as $node)
402 {
403 if($node["type"] == "st")
404 {
405 $tpl->setCurrentBlock("chapter_row");
406 $tpl->setVariable("TXT_CHAPTER", $node["title"]);
407 $tpl->setVariable("ROWCLASS", "tblrow1");
408 //$tpl->setVariable("LINK_CHAPTER",
409 // "[iln chap=\"".$node["obj_id"]."\"".$target_str."] [/iln]");
410 $tpl->parseCurrentBlock();
411 $tpl->setCurrentBlock("row");
412 $tpl->parseCurrentBlock();
413 }
414
415 if($node["type"] == "pg")
416 {
417 include_once("./Services/COPage/classes/class.ilPCParagraph.php");
418 $this->renderLink($tpl, $node["title"], $node["obj_id"],
419 "PageObject", "pg", "page",
420 ilPCParagraph::_readAnchors($type, $node["obj_id"], ""));
421 }
422 }
423
424 // get all free pages
425 $pages = ilLMPageObject::getPageList($cont_obj->getId());
426 $free_pages = array();
427 foreach ($pages as $page)
428 {
429 if (!$ctree->isInTree($page["obj_id"]))
430 {
431 $free_pages[] = $page;
432 }
433 }
434 if(count($free_pages) > 0)
435 {
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();
440
441 foreach ($free_pages as $node)
442 {
443 include_once("./Services/COPage/classes/class.ilPCParagraph.php");
444 $this->renderLink($tpl, $node["title"], $node["obj_id"],
445 "PageObject", "pg", "page",
446 ilPCParagraph::_readAnchors($type, $node["obj_id"], ""));
447 }
448 }
449
450 $tpl->setCurrentBlock("chapter_list");
451 $tpl->parseCurrentBlock();
452
453 break;
454
455 // chapter link
456 case "StructureObject":
457
458 // check whether current object matchs to type
459 if (!in_array(ilObject::_lookupType($_SESSION["il_link_cont_obj"], true),
460 array("lm", "dbk")))
461 {
462 $this->changeTargetObject("lm");
463 }
464
465 if ($type == "lm")
466 {
467 require_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
468 $cont_obj = new ilObjLearningModule($_SESSION["il_link_cont_obj"], true);
469 }
470 else if ($type == "dbk")
471 {
472 require_once("./Modules/LearningModule/classes/class.ilObjDlBook.php");
473 $cont_obj = new ilObjDlBook($_SESSION["il_link_cont_obj"], true);
474 }
475
476 // get all chapters
477 $ctree =& $cont_obj->getLMTree();
478 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
479 $tpl->setCurrentBlock("chapter_list");
480 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("obj_lm"));
481 $tpl->setVariable("TXT_CONT_TITLE", $cont_obj->getTitle());
482 $tpl->setVariable("THEAD", $this->lng->txt("link_chapters"));
483 $tpl->setCurrentBlock("change_cont_obj");
484 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
485 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
486 $tpl->parseCurrentBlock();
487
488 foreach($nodes as $node)
489 {
490 if($node["type"] == "st")
491 {
492 $this->renderLink($tpl, $node["title"], $node["obj_id"],
493 "StructureObject", "st", "chap");
494 }
495 }
496 $tpl->setCurrentBlock("chapter_list");
497 $tpl->parseCurrentBlock();
498 break;
499
500 // glossary item link
501 case "GlossaryItem":
502 require_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
503 $glossary =& new ilObjGlossary($_SESSION["il_link_glossary"], true);
504
505 // get all glossary items
506 $terms = $glossary->getTermList();
507 $tpl->setCurrentBlock("chapter_list");
508 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("glossary"));
509 $tpl->setVariable("TXT_CONT_TITLE", $glossary->getTitle());
510 $tpl->setVariable("THEAD", $this->lng->txt("link_terms"));
511 $tpl->setCurrentBlock("change_cont_obj");
512 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
513 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
514 $tpl->parseCurrentBlock();
515
516 foreach($terms as $term)
517 {
518 $this->renderLink($tpl, $term["term"], $term["id"],
519 "GlossaryItem", "git", "term");
520 }
521
522 $tpl->setCurrentBlock("chapter_list");
523 $tpl->parseCurrentBlock();
524 break;
525
526 // media object
527 case "Media":
528 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
529 //$tpl->setVariable("TARGET2", " target=\"content\" ");
530 // content object id = 0 --> get clipboard objects
531 if ($_SESSION["il_link_mep"] == 0)
532 {
533 $tpl->setCurrentBlock("change_cont_obj");
534 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
535 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
536 $tpl->parseCurrentBlock();
537 $mobjs = $ilUser->getClipboardObjects("mob");
538 // sort by name
539 $objs = array();
540 foreach ($mobjs as $obj)
541 {
542 $objs[$obj["title"].":".$obj["id"]] = $obj;
543 }
544 ksort($objs);
545 $tpl->setCurrentBlock("chapter_list");
546 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("cont_media_source"));
547 $tpl->setVariable("TXT_CONT_TITLE", $this->lng->txt("cont_personal_clipboard"));
548 $tpl->setVariable("THEAD", $this->lng->txt("link_mobs"));
549 $tpl->setVariable("COLSPAN", "2");
550
551 foreach($objs as $obj)
552 {
553 $this->renderLink($tpl, $obj["title"], $obj["id"],
554 "MediaObject", "mob", "media");
555 }
556 $tpl->setCurrentBlock("chapter_list");
557 $tpl->parseCurrentBlock();
558 }
559 else
560 {
561 require_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
562 $med_pool =& new ilObjMediaPool($_SESSION["il_link_mep"], true);
563 // get current folders
564 $fobjs = $med_pool->getChilds($_SESSION["il_link_mep_obj"], "fold");
565 $f2objs = array();
566 foreach ($fobjs as $obj)
567 {
568 $f2objs[$obj["title"].":".$obj["child"]] = $obj;
569 }
570 ksort($f2objs);
571 // get current media objects
572 $mobjs = $med_pool->getChilds($_SESSION["il_link_mep_obj"], "mob");
573 $m2objs = array();
574 foreach ($mobjs as $obj)
575 {
576 $m2objs[$obj["title"].":".$obj["child"]] = $obj;
577 }
578 ksort($m2objs);
579
580 // merge everything together
581 $objs = array_merge($f2objs, $m2objs);
582
583 $tpl->setCurrentBlock("chapter_list");
584 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("mep"));
585 $tpl->setVariable("TXT_CONT_TITLE", $med_pool->getTitle());
586 $tpl->setVariable("THEAD", $this->lng->txt("link_mobs"));
587 $tpl->setCurrentBlock("change_cont_obj");
588 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
589 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
590 $tpl->setVariable("COLSPAN", "2");
591 $tpl->parseCurrentBlock();
592 if ($parent_id = $med_pool->getParentId($_SESSION["il_link_mep_obj"]))
593 {
594 $css_row = "tblrow1";
595 $tpl->setCurrentBlock("icon");
596 $tpl->setVariable("ICON_SRC", ilUtil::getImagePath("icon_fold.svg"));
597 $tpl->parseCurrentBlock();
598 $tpl->setCurrentBlock("link_row");
599 $tpl->setVariable("ROWCLASS", $css_row);
600 $tpl->setVariable("TXT_CHAPTER", "..");
601 $this->ctrl->setParameter($this, "mep_fold", $parent_id);
602 if ($ilCtrl->isAsynch())
603 {
604 $tpl->setVariable("LINK", "#");
605 $tpl->setVariable("LR_ONCLICK",
606 " onclick=\"return il.IntLink.setMepPoolFolder('".$parent_id."');\" ");
607
608 }
609 else
610 {
611 $tpl->setVariable("LINK",
612 $this->ctrl->getLinkTarget($this, "setMedPoolFolder"));
613 }
614 $tpl->parseCurrentBlock();
615 $tpl->setCurrentBlock("row");
616 $tpl->parseCurrentBlock();
617 }
618 foreach($objs as $obj)
619 {
620 if($obj["type"] == "fold")
621 {
622 $css_row = ($css_row == "tblrow2")
623 ? "tblrow1"
624 : "tblrow2";
625 $tpl->setCurrentBlock("icon");
626 $tpl->setVariable("ICON_SRC", ilUtil::getImagePath("icon_fold.svg"));
627 $tpl->parseCurrentBlock();
628 $tpl->setCurrentBlock("link_row");
629 $tpl->setVariable("ROWCLASS", $css_row);
630 $tpl->setVariable("TXT_CHAPTER", $obj["title"]);
631 $this->ctrl->setParameter($this, "mep_fold", $obj["child"]);
632 if ($ilCtrl->isAsynch())
633 {
634 $tpl->setVariable("LINK", "#");
635 $tpl->setVariable("LR_ONCLICK",
636 " onclick=\"return il.IntLink.setMepPoolFolder('".$obj["child"]."');\" ");
637
638 }
639 else
640 {
641 $tpl->setVariable("LINK",
642 $this->ctrl->getLinkTarget($this, "setMedPoolFolder"));
643 }
644 $tpl->parseCurrentBlock();
645 }
646 else
647 {
648 $fid = ilMediaPoolItem::lookupForeignId($obj["child"]);
649 if (ilObject::_lookupType($fid) == "mob")
650 {
651 $this->renderLink($tpl, $obj["title"], $fid,
652 "MediaObject", "mob", "media");
653 }
654 }
655 $tpl->setCurrentBlock("row");
656 $tpl->parseCurrentBlock();
657 }
658 $tpl->setCurrentBlock("chapter_list");
659 $tpl->parseCurrentBlock();
660 }
661 break;
662
663 // glossary item link
664 case "WikiPage":
665 $wiki_id = ilObject::_lookupObjId($_SESSION["il_link_wiki"]);
666 require_once("./Modules/Wiki/classes/class.ilWikiPage.php");
667 $wpages = ilWikiPage::getAllPages($wiki_id);
668
669 // get all glossary items
670 $tpl->setCurrentBlock("chapter_list");
671 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("obj_wiki"));
672 $tpl->setVariable("TXT_CONT_TITLE", ilObject::_lookupTitle($wiki_id));
673 $tpl->setVariable("THEAD", $this->lng->txt("link_wpages"));
674 $tpl->setCurrentBlock("change_cont_obj");
675 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
676 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
677 $tpl->parseCurrentBlock();
678
679 foreach($wpages as $wpage)
680 {
681 $this->renderLink($tpl, $wpage["title"], $wpage["id"],
682 "WikiPage", "wpage", "wpage");
683 }
684
685 $tpl->setCurrentBlock("chapter_list");
686 $tpl->parseCurrentBlock();
687 break;
688
689 // repository item
690 case "RepositoryItem":
691 $tpl->setVariable("LINK_HELP_CONTENT", $this->selectRepositoryItem());
692 break;
693
694 // file download link
695 case "File":
696 if (!is_object($this->uploaded_file))
697 {
698 $tpl->setVariable("LINK_HELP_CONTENT", $this->getFileLinkHTML());
699 }
700 else
701 {
702 echo $this->getFileLinkHTML();
703 exit;
704 }
705 break;
706
707 }
708
709 if ($ilCtrl->isAsynch())
710 {
711 echo $tpl->get();
712 exit;
713 }
714
715 exit;
716 }
global $l
Definition: afr.php:30
renderLink($tpl, $a_title, $a_obj_id, $a_type, $a_type_short, $a_bb_type, $a_anchors=array())
Render internal link item.
getFileLinkHTML()
Get HTML for file link.
changeTargetObject($a_type="")
Cange target object.
getPageList($lm_id)
static
static lookupForeignId($a_id)
Lookup Foreign Id.
Class ilObjDlBook.
Class ilObjGlossary.
Class ilObjLearningModule.
Media pool object.
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 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 getAllPages($a_wiki_id)
Get all pages of wiki

References $_SESSION, $default_obj, $ilCtrl, $ilUser, $l, $link_type, $ltypes, $tpl, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilPCParagraph\_readAnchors(), changeTargetObject(), determineLinkType(), exit, ilUtil\formSelect(), ilWikiPage\getAllPages(), getFileLinkHTML(), ilUtil\getImagePath(), ilLMPageObject\getPageList(), ilUtil\getStyleSheetLocation(), isEnabledJavaScript(), ilMediaPoolItem\lookupForeignId(), renderLink(), and selectRepositoryItem().

Referenced by changeLinkType(), changeTargetObject(), resetLinkList(), saveFileLink(), and setMedPoolFolder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilInternalLinkGUI::$ctrl

Definition at line 26 of file class.ilInternalLinkGUI.php.

◆ $default_obj

ilInternalLinkGUI::$default_obj

Definition at line 20 of file class.ilInternalLinkGUI.php.

Referenced by showLinkHelp().

◆ $default_type

ilInternalLinkGUI::$default_type

Definition at line 19 of file class.ilInternalLinkGUI.php.

Referenced by determineLinkType().

◆ $link_target

ilInternalLinkGUI::$link_target

Definition at line 22 of file class.ilInternalLinkGUI.php.

◆ $link_type

ilInternalLinkGUI::$link_type

Definition at line 21 of file class.ilInternalLinkGUI.php.

Referenced by showLinkHelp().

◆ $lng

ilInternalLinkGUI::$lng

◆ $ltypes

ilInternalLinkGUI::$ltypes = array()

Definition at line 28 of file class.ilInternalLinkGUI.php.

Referenced by showLinkHelp().

◆ $mode

ilInternalLinkGUI::$mode

Definition at line 24 of file class.ilInternalLinkGUI.php.

◆ $set_link_script

ilInternalLinkGUI::$set_link_script

Definition at line 25 of file class.ilInternalLinkGUI.php.

Referenced by getSetLinkTargetScript().

◆ $tree

ilInternalLinkGUI::$tree

Definition at line 27 of file class.ilInternalLinkGUI.php.

Referenced by ilInternalLinkGUI().


The documentation for this class was generated from the following file: