ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilInternalLinkGUI Class Reference

Internal link selector. More...

+ Collaboration diagram for ilInternalLinkGUI:

Public Member Functions

 __construct (string $a_default_link_type, int $a_default_parent_id, bool $a_is_ref=true)
 
 init ()
 
 setSetLinkTargetScript (string $a_script)
 
 setReturn (string $a_return)
 
 getSetLinkTargetScript ()
 
 filterLinkType (string $a_link_type)
 
 setFilterWhiteList (bool $a_white_list)
 Set filter list as white list (per detault it is a black list) More...
 
 executeCommand ()
 
 resetLinkList ()
 
 closeLinkHelp ()
 
 prepareJavascriptOutput (string $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 (ilGlobalTemplate $tpl, int $a_id, string $a_mode="")
 output thumbnail More...
 
 changeLinkType ()
 
 setMedPoolFolder ()
 select media pool folder More...
 
 getTargetExplorer ()
 Cange target object. More...
 
 changeTargetObject (string $a_type="")
 Cange target object. More...
 
 selectRepositoryItem ()
 select repository item explorer More...
 
 refreshRepositorySelector ()
 Refresh Repository Selector. More...
 
 renderLink (ilGlobalTemplate $tpl, string $a_title, int $a_obj_id, string $a_type, string $a_type_short, string $a_bb_type, array $a_anchors=array(), string $a_link_content="")
 Render internal link item. More...
 
 addUser ()
 Add user. More...
 
 initUserSearchForm ()
 Init user search form. More...
 
 getUserSearchResult ()
 Search user. More...
 

Static Public Member Functions

static getOnloadCode (string $a_url)
 
static getInitHTML (string $a_url)
 Get initialisation HTML to use internal link editing. More...
 
static getModalTemplate ()
 

Data Fields

string $set_link_script = ""
 
ilCtrl $ctrl
 

Protected Attributes

ILIAS MediaObjects Thumbs ThumbsGUI $thumbs_gui
 
ilObjFile $uploaded_file = null
 
int $parent_fold_id
 
string $default_parent_obj_type
 
StandardGUIRequest $request
 
string $return
 
string $default_link_type = ""
 
int $default_parent_ref_id = 0
 
int $default_parent_obj_id = 0
 
int $parent_ref_id = 0
 
int $parent_obj_id = 0
 
string $link_type = ""
 
string $link_target = ""
 
string $base_link_type = ""
 
array $ltypes = []
 
array $parent_type = []
 
bool $filter_white_list = false
 
array $filter_link_types = []
 
ilTree $tree
 
ilLanguage $lng
 
ilObjUser $user
 

Detailed Description

Internal link selector.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Deprecated:
10 This component will be removed with ILIAS 10

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

Constructor & Destructor Documentation

◆ __construct()

ilInternalLinkGUI::__construct ( string  $a_default_link_type,
int  $a_default_parent_id,
bool  $a_is_ref = true 
)

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

59 {
60 global $DIC;
61 if ($a_default_link_type === "PortfolioPage") {
62 $a_is_ref = false;
63 }
64 $this->tree = $DIC->repositoryTree();
65 $this->lng = $DIC->language();
66 $this->ctrl = $DIC->ctrl();
67 $this->user = $DIC->user();
68
69 $this->request = new StandardGUIRequest(
70 $DIC->http(),
71 $DIC->refinery()
72 );
73 $this->thumbs_gui = $DIC->mediaObjects()->internal()->gui()->thumbs();
74
75 $this->lng->loadLanguageModule("link");
76 $this->lng->loadLanguageModule("content");
77 $this->lng->loadLanguageModule("copg");
78 $this->ctrl->saveParameter($this, array("linkmode", "link_par_ref_id", "link_par_obj_id",
79 "link_par_fold_id", "link_type"));
80
81 // default type and parent
82 $this->default_link_type = $a_default_link_type;
83 if ($a_is_ref) {
84 $this->default_parent_ref_id = $a_default_parent_id;
85 $this->default_parent_obj_id = ilObject::_lookupObjId($a_default_parent_id);
86 } else {
87 $this->default_parent_ref_id = 0;
88 $this->default_parent_obj_id = $a_default_parent_id;
89 }
90 $this->default_parent_obj_type = ($this->default_parent_obj_id > 0)
91 ? ilObject::_lookupType($this->default_parent_obj_id)
92 : "";
93
94 // current parent object
95 $this->parent_ref_id = $this->request->getLinkParentRefId();
96 $this->parent_fold_id = $this->request->getLinkParentFolderId(); // e.g. media pool folder
97 if ($this->parent_ref_id > 0) {
98 $this->parent_obj_id = ilObject::_lookupObjId($this->parent_ref_id);
99 } else {
100 $this->parent_obj_id = $this->request->getLinkParentObjId();
101 }
102 }
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
global $DIC
Definition: shib_login.php:26

References $DIC, ilObject\_lookupObjId(), ilObject\_lookupType(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addUser()

ilInternalLinkGUI::addUser ( )

Add user.

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

1061 : string
1062 {
1063 $form = $this->initUserSearchForm();
1064 return $form->getHTML() . $this->getUserSearchResult();
1065 }
initUserSearchForm()
Init user search form.

Referenced by showLinkHelp().

+ Here is the caller graph for this function:

◆ changeLinkType()

ilInternalLinkGUI::changeLinkType ( )

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

777 : void
778 {
780
781 $ctrl->setParameter($this, "link_type", $this->request->getLinkType());
782 $base_type = explode("_", $this->request->getLinkType())[0];
783 if ($this->parent_type[$base_type] !== ilObject::_lookupType($this->parent_ref_id, true)) {
784 $ctrl->setParameter($this, "link_par_ref_id", 0);
785 $ctrl->setParameter($this, "link_par_obj_id", 0);
786 }
787
788 $ctrl->redirect($this, "showLinkHelp", "", true);
789 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc

References ilObject\_lookupType(), ilCtrl\redirect(), and ilCtrl\setParameter().

+ Here is the call graph for this function:

◆ changeTargetObject()

ilInternalLinkGUI::changeTargetObject ( string  $a_type = "")

Cange target object.

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

834 : void {
835 $ilCtrl = $this->ctrl;
836
837 $ilCtrl->setParameter($this, "link_par_fold_id", "");
838 if ($this->request->getDo() === "set") {
839 $ilCtrl->setParameter($this, "link_par_ref_id", $this->request->getSelectedId());
840 $ilCtrl->redirect($this, "showLinkHelp", "", true);
841 return;
842 }
843
844 $ilCtrl->setParameter($this, "link_type", $this->link_type);
845
846 $tpl = new ilTemplate("tpl.link_help_explorer.html", true, true, "components/ILIAS/COPage/IntLink");
847
848 $output = $this->getTargetExplorer();
849
850 $tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_choose_" . ($this->parent_type[$this->base_link_type] ?? "")));
851
852 $tpl->setVariable("EXPLORER", $output);
853 $tpl->setVariable("ACTION", $this->ctrl->getFormAction($this, "resetLinkList", "", true));
854 $tpl->setVariable("BTN_RESET", "resetLinkList");
855 $tpl->setVariable("TXT_RESET", $this->lng->txt("back"));
856
857 if (($this->parent_type[$this->base_link_type] ?? "") === "mep") {
858 $tpl->setCurrentBlock("sel_clipboard");
859 $this->ctrl->setParameter($this, "do", "set");
860 if ($ilCtrl->isAsynch()) {
861 $tpl->setVariable("LINK_CLIPBOARD", "#");
862 $tpl->setVariable(
863 "CLIPBOARD_ONCLICK",
864 " onclick=\"return il.IntLink.selectLinkTargetObject('mep', 0, '" . $this->link_type . "');\" "
865 );
866 } else {
867 $tpl->setVariable("LINK_CLIPBOARD", $this->ctrl->getLinkTarget($this, "changeTargetObject"));
868 }
869 $tpl->setVariable("TXT_PERS_CLIPBOARD", $this->lng->txt("clipboard"));
870 $tpl->parseCurrentBlock();
871 }
872
873 $tpl->parseCurrentBlock();
874
875 echo $tpl->get();
876 exit;
877 }
getTargetExplorer()
Cange target object.
special template class to simplify handling of ITX/PEAR
exit

Referenced by showLinkHelp().

+ Here is the caller graph for this function:

◆ closeLinkHelp()

ilInternalLinkGUI::closeLinkHelp ( )

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

247 : void
248 {
249 if ($this->return === "") {
250 $this->ctrl->returnToParent($this);
251 } else {
252 ilUtil::redirect($this->return);
253 }
254 }
static redirect(string $a_script)

References ILIAS\Repository\ctrl(), and ilUtil\redirect().

+ Here is the call graph for this function:

◆ executeCommand()

ilInternalLinkGUI::executeCommand ( )

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

220 : string
221 {
222 $this->init();
223 $next_class = $this->ctrl->getNextClass($this);
224
225 $cmd = $this->ctrl->getCmd("showLinkHelp");
226 switch ($next_class) {
227 default:
228 $ret = $this->$cmd();
229 break;
230 }
231
232 return (string) $ret;
233 }

References ILIAS\Repository\ctrl(), and init().

+ Here is the call graph for this function:

◆ filterLinkType()

ilInternalLinkGUI::filterLinkType ( string  $a_link_type)

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

206 : void
207 {
208 $this->filter_link_types[] = $a_link_type;
209 }

◆ getFileLinkHTML()

ilInternalLinkGUI::getFileLinkHTML ( )

Get HTML for file link.

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

681 : string
682 {
684 $ilCtrl = $this->ctrl;
685
686 $tpl = new ilTemplate("tpl.link_file.html", true, true, "components/ILIAS/COPage/IntLink");
687 if (!is_object($this->uploaded_file)) {
688 $tpl->setCurrentBlock("form");
689 $tpl->setVariable(
690 "FORM_ACTION",
691 $ilCtrl->getFormAction($this, "saveFileLink", "", true)
692 );
693 $tpl->setVariable("TXT_SELECT_FILE", $lng->txt("cont_select_file"));
694 $tpl->setVariable("TXT_SAVE_LINK", $lng->txt("cont_create_link"));
695 $tpl->setVariable("CMD_SAVE_LINK", "saveFileLink");
696 $fi = new ilFileInputGUI("", "link_file");
697 $fi->setSize(15);
698 $tpl->setVariable("INPUT", $fi->getToolbarHTML());
699 $tpl->parseCurrentBlock();
700 } else {
701 $tpl->setCurrentBlock("link_js");
702 // $tpl->setVariable("LINK_FILE",
703 // $this->prepareJavascriptOutput("[iln dfile=\"".$this->uploaded_file->getId()."\"] [/iln]")
704 // );
705 $tpl->setVariable(
706 "TAG_B",
707 '[iln dfile=\x22' . $this->uploaded_file->getId() . '\x22]'
708 );
709 $tpl->setVariable(
710 "TAG_E",
711 "[/iln]"
712 );
713 $tpl->setVariable(
714 "TXT_FILE",
715 $this->uploaded_file->getTitle()
716 );
717 // $tpl->parseCurrentBlock();
718 }
719 return $tpl->get();
720 }
This class represents a file property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

References $ctrl, $lng, and ilLanguage\txt().

Referenced by showLinkHelp().

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

◆ getInitHTML()

static ilInternalLinkGUI::getInitHTML ( string  $a_url)
static

Get initialisation HTML to use internal link editing.

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

916 : string
917 {
918 global $DIC;
919
920 $lng = $DIC->language();
921 $tpl = $DIC["tpl"];
922
923 $tpl->addOnLoadCode(
924 self::getOnloadCode($a_url)
925 );
926
927 $lng->loadLanguageModule("link");
928
929 $debug = false;
930
931 $tpl->addJavaScript("assets/js/ilExplorer.js");
933
934 if ($debug) {
935 $tpl->addJavascript("../components/ILIAS/COPage/IntLink/resources/ilIntLink.js");
936 } else {
937 $tpl->addJavascript("assets/js/ilIntLink.js");
938 }
939
940 // #18721
941 $tpl->addJavaScript("assets/js/Form.js");
942
944 $tpl->addOnLoadCode('il.IntLink.setModalTemplate("' . addslashes(json_encode($mt["template"])) . '");');
945
946 $html = "<div id='ilIntLinkModal' data-show-signal='" . $mt["show"] . "' data-close-signal='" . $mt["close"] . "'></div>";
947
948 return $html;
949 }
static init(?ilGlobalTemplateInterface $a_main_tpl=null)
loadLanguageModule(string $a_module)
Load language module.

References $DIC, $lng, and ilExplorerBaseGUI\init().

Referenced by ilLinkInputGUI\getContentOutsideFormTag(), ilObjLinkResourceGUI\manage(), and ilPageObjectGUI\showPage().

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

◆ getModalTemplate()

static ilInternalLinkGUI::getModalTemplate ( )
static

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

951 : array
952 {
953 global $DIC;
954
955 $lng = $DIC->language();
956
957 $ui = $DIC->ui();
958 $modal = $ui->factory()->modal()->roundtrip($lng->txt("link_link"), $ui->factory()->legacy()->content("<div id='ilIntLinkModalContent'></div>"));
959 $modalt["show"] = $modal->getShowSignal()->getId();
960 $modalt["close"] = $modal->getCloseSignal()->getId();
961 $modalt["template"] = $ui->renderer()->renderAsync($modal);
962
963 return $modalt;
964 }

References $DIC, and $lng.

◆ getOnloadCode()

static ilInternalLinkGUI::getOnloadCode ( string  $a_url)
static

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

908 : string
909 {
910 return "il.Util.addOnLoad(function() {il.IntLink.init({url: '$a_url'});});";
911 }

Referenced by ilLinkInputGUI\getOnloadCode().

+ Here is the caller graph for this function:

◆ getSetLinkTargetScript()

ilInternalLinkGUI::getSetLinkTargetScript ( )

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

201 : string
202 {
204 }

References $set_link_script.

◆ getTargetExplorer()

ilInternalLinkGUI::getTargetExplorer ( )

Cange target object.

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

804 : string
805 {
806 //$ilCtrl->setParameter($this, "target_type", $a_type);
807 $exp = new ilLinkTargetObjectExplorerGUI($this, "getTargetExplorer", $this->link_type);
808
809 $a_type = $this->parent_type[$this->base_link_type] ?? "";
810
811 $white = array("root", "cat", "crs", "fold", "grp");
812
813 $white[] = $a_type;
814 $exp->setClickableType($a_type);
815 if ($a_type === "prtf") {
816 $white[] = "prtt";
817 $exp->setClickableType("prtt");
818 }
819
820 $exp->setTypeWhiteList($white);
821
822
823 if (!$exp->handleCommand()) {
824 return $exp->getHTML();
825 }
826 return "";
827 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getUserSearchResult()

ilInternalLinkGUI::getUserSearchResult ( )

Search user.

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

1088 : string
1089 {
1090 global $DIC;
1091
1092 $lng = $DIC->language();
1093
1094 if (strlen($this->request->getUserSearchStr()) < 3) {
1095 if (strlen($this->request->getUserSearchStr()) > 0) {
1096 $lng->loadLanguageModule("search");
1097 return ilUtil::getSystemMessageHTML($lng->txt("search_minimum_three"), "info");
1098 }
1099
1100 return "";
1101 }
1102
1103 $form = $this->initUserSearchForm();
1104 $form->checkInput();
1105
1106 $users = ilInternalLink::searchUsers($form->getInput("usr_search_str"));
1107 if (count($users) === 0) {
1108 return ilUtil::getSystemMessageHTML($lng->txt("cont_user_search_did_not_match"), "info");
1109 }
1110
1111 $f = $DIC->ui()->factory();
1112 $r = $DIC->ui()->renderer();
1113 $lng = $DIC->language();
1114 $cards = array();
1115 foreach ($users as $user) {
1116 $b = $f->button()->standard($lng->txt("insert"), "#")
1117 ->withOnLoadCode(function ($id) use ($user) {
1118 return
1119 '$("#' . $id . "\").click(function(ev) { il.IntLink.addInternalLink('[iln user=\"" .
1120 ilObjUser::_lookupLogin($user) . "\"/]', '', ev); return false;});";
1121 });
1123 $cards[] = $f->card()->standard($name, $f->image()->responsive(ilObjUser::_getPersonalPicturePath($user, "small"), $name))
1124 ->withSections(array($b));
1125 }
1126 $deck = $f->deck($cards)->withLargeCardsSize();
1127
1128 return $r->renderAsync($deck);
1129 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _getPersonalPicturePath(int $usr_id, string $size='small', bool $force_pic=false)
static _lookupLogin(int $a_user_id)
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.

References Vendor\Package\$b, $DIC, Vendor\Package\$f, $id, $lng, ilObjUser\_getPersonalPicturePath(), ilObjUser\_lookupLogin(), ilUserUtil\getNamePresentation(), ilUtil\getSystemMessageHTML(), and ilInternalLink\searchUsers().

+ Here is the call graph for this function:

◆ init()

ilInternalLinkGUI::init ( )

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

104 : void
105 {
109
110 if ($this->parent_ref_id > 0 && !$tree->isInTree($this->parent_ref_id)) {
111 $this->resetLinkList();
112 }
113
114 $this->parent_type = array(
115 "StructureObject" => "lm",
116 "PageObject" => "lm",
117 "GlossaryItem" => "glo",
118 "Media" => "mep",
119 "WikiPage" => "wiki",
120 "PortfolioPage" => "prtf",
121 "PortfolioTemplatePage" => "prtt",
122 "File" => "",
123 "RepositoryItem" => "",
124 "User" => ""
125 );
126
127 // filter link types
128 $this->ltypes = array(
129 "StructureObject" => $lng->txt("cont_lk_chapter"),
130 "StructureObject_New" => $lng->txt("cont_lk_chapter_new"),
131 "PageObject" => $lng->txt("cont_lk_page"),
132 "PageObject_FAQ" => $lng->txt("cont_lk_page_faq"),
133 "PageObject_New" => $lng->txt("cont_lk_page_new"),
134 "GlossaryItem" => $lng->txt("cont_lk_term"),
135 "GlossaryItem_New" => $lng->txt("cont_lk_term_new"),
136 "Media" => $lng->txt("cont_lk_media_inline"),
137 "Media_Media" => $lng->txt("cont_lk_media_media"),
138 "Media_FAQ" => $lng->txt("cont_lk_media_faq"),
139 "Media_New" => $lng->txt("cont_lk_media_new"),
140 "WikiPage" => $lng->txt("cont_wiki_page"),
141 "PortfolioPage" => $lng->txt("cont_prtf_page"),
142 "PortfolioTemplatePage" => $lng->txt("cont_prtt_page"),
143 "File" => $lng->txt("cont_lk_file"),
144 "RepositoryItem" => $lng->txt("cont_repository_item"),
145 "User" => $lng->txt("cont_user")
146 );
147 if (!$this->filter_white_list) {
148 foreach ($this->filter_link_types as $link_type) {
149 unset($this->ltypes[$link_type]);
150 }
151 } else {
152 $ltypes = array();
153 foreach ($this->ltypes as $k => $l) {
154 if (in_array($k, $this->filter_link_types, true)) {
155 $ltypes[$k] = $l;
156 }
157 }
158 $this->ltypes = $ltypes;
159 }
160 // determine link type and target
161 $this->link_type = ($this->request->getLinkType() === "")
162 ? $this->default_link_type
163 : $this->request->getLinkType();
164 $ltype_arr = explode("_", $this->link_type);
165 $this->base_link_type = $ltype_arr[0];
166 $this->link_target = $ltype_arr[1] ?? "";
167
168
169 $def_type = ilObject::_lookupType($this->default_parent_obj_id);
170
171 // determine content object id
172 switch ($this->base_link_type) {
173 case "PageObject":
174 case "StructureObject":
175 case "GlossaryItem":
176 case "Media":
177 case "WikiPage":
178 case "PortfolioPage":
179 case "PortfolioTemplatePage":
180 if ($this->parent_ref_id === 0 && $this->parent_obj_id === 0
181 && $def_type === ($this->parent_type[$this->base_link_type] ?? "")) {
182 $this->parent_ref_id = $this->default_parent_ref_id;
183 $this->parent_obj_id = $this->default_parent_obj_id;
184 $ctrl->setParameter($this, "link_par_obj_id", $this->parent_obj_id);
185 $ctrl->setParameter($this, "link_par_ref_id", $this->parent_ref_id);
186 }
187 break;
188 }
189 }
isInTree(?int $a_node_id)
get all information of a node.

References $ctrl, $default_parent_obj_id, $default_parent_ref_id, $link_type, $lng, $ltypes, $tree, ilObject\_lookupType(), ilTree\isInTree(), resetLinkList(), ilCtrl\setParameter(), and ilLanguage\txt().

Referenced by executeCommand().

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

◆ initUserSearchForm()

ilInternalLinkGUI::initUserSearchForm ( )

Init user search form.

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

1071 {
1072 $form = new ilPropertyFormGUI();
1073 $form->setId("link_user_search_form");
1074
1075 // user search
1076 $ti = new ilTextInputGUI($this->lng->txt("obj_user"), "usr_search_str");
1077 $ti->setValue($this->request->getUserSearchStr());
1078 $form->addItem($ti);
1079
1080 $form->addCommandButton("searchUser", $this->lng->txt("search"));
1081
1082 return $form;
1083 }
This class represents a property form user interface.
This class represents a text property in a property form.

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ outputThumbnail()

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

output thumbnail

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

752 : void {
753 // output thumbnail
754 if ($this->getSetLinkTargetScript() !== "") {
755 $tpl->setCurrentBlock("thumbnail_link");
756 $suff = "_link";
757 } else {
758 $tpl->setCurrentBlock("thumbnail_js");
759 $suff = "_js";
760 }
761
762 $tpl->setCurrentBlock("thumb" . $suff);
763 $tpl->setVariable(
764 "THUMB",
765 $this->thumbs_gui->getThumbHtml($a_id)
766 );
767 $tpl->parseCurrentBlock();
768
769 if ($this->getSetLinkTargetScript() !== "") {
770 $tpl->setCurrentBlock("thumbnail_link");
771 } else {
772 $tpl->setCurrentBlock("thumbnail_js");
773 }
774 $tpl->parseCurrentBlock();
775 }
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
parseCurrentBlock(string $part=self::DEFAULT_BLOCK)
setVariable(string $variable, $value='')
Sets the given variable to the given value.

References ilGlobalTemplate\setCurrentBlock().

+ Here is the call graph for this function:

◆ prepareJavascriptOutput()

ilInternalLinkGUI::prepareJavascriptOutput ( string  $str)

Prepare output for JS enabled editing.

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

259 : string
260 {
261 return htmlspecialchars($str, ENT_QUOTES);
262 }

◆ refreshRepositorySelector()

ilInternalLinkGUI::refreshRepositorySelector ( )

Refresh Repository Selector.

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

901 : void
902 {
903 $output = $this->selectRepositoryItem();
904 echo $output;
905 exit;
906 }
selectRepositoryItem()
select repository item explorer

References exit.

◆ renderLink()

ilInternalLinkGUI::renderLink ( ilGlobalTemplate  $tpl,
string  $a_title,
int  $a_obj_id,
string  $a_type,
string  $a_type_short,
string  $a_bb_type,
array  $a_anchors = array(),
string  $a_link_content = "" 
)

Render internal link item.

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

979 : void {
980 $chapterRowBlock = "chapter_row_js";
981 $anchor_row_block = "anchor_link_js";
982
983 $target_str = ($this->link_target === "")
984 ? ""
985 : " target=\"" . $this->link_target . "\"";
986
987 if (count($a_anchors) > 0) {
988 foreach ($a_anchors as $anchor) {
989 if ($this->getSetLinkTargetScript() !== "") {
990 // not implemented yet (anchors that work with map areas)
991
992 /*$tpl->setCurrentBlock("anchor_link");
993 $tpl->setVariable("ALINK",
994 ilUtil::appendUrlParameterString($this->getSetLinkTargetScript(),
995 "linktype=".$a_type.
996 "&linktarget=il__".$a_type_short."_".$a_obj_id.
997 "&linktargetframe=".$this->link_target).
998 "&linkanchor=".$anchor);
999 $tpl->setVariable("TXT_ALINK", "#" . $anchor);
1000 $tpl->parseCurrentBlock();*/
1001 } else {
1002 $tpl->setCurrentBlock($anchor_row_block);
1003 $tpl->setVariable(
1004 "ALINK_BEGIN",
1005 $this->prepareJavascriptOutput("[iln " . $a_bb_type . "=\"" . $a_obj_id . "\"" . $target_str . " anchor=\"$anchor\"]")
1006 );
1007 $tpl->setVariable("ALINK_END", "[/iln]");
1008 $tpl->setVariable("TXT_LINK", "#" . $anchor);
1009 $tpl->parseCurrentBlock();
1010 }
1011 }
1012 }
1013
1014 if ($this->getSetLinkTargetScript() !== "") {
1016 if ($a_type === "MediaObject") {
1017 $this->outputThumbnail($tpl, $a_obj_id);
1018 }
1019 $tpl->setCurrentBlock("link_row");
1020 $tpl->setVariable("TXT_CHAPTER", $a_title);
1021 $tpl->setVariable(
1022 "LINK",
1024 $this->getSetLinkTargetScript(),
1025 "linktype=" . $a_type .
1026 "&linktarget=il__" . $a_type_short . "_" . $a_obj_id .
1027 "&linktargetframe=" . $this->link_target
1028 )
1029 );
1030 } else {
1031 $tpl->setCurrentBlock($chapterRowBlock);
1032 if ($a_type === "MediaObject") {
1033 $this->outputThumbnail($tpl, $a_obj_id);
1034 $tpl->setCurrentBlock($chapterRowBlock);
1035 }
1036 $tpl->setVariable("TXT_CHAPTER", $a_title);
1037 if ($a_type === "MediaObject" && empty($target_str)) {
1038 $tpl->setVariable(
1039 "LINK_BEGIN",
1040 $this->prepareJavascriptOutput("[iln " . $a_bb_type . "=\"" . $a_obj_id . "\"/]")
1041 );
1042 $tpl->setVariable("LINK_END", "");
1043 } else {
1044 $tpl->setVariable(
1045 "LINK_BEGIN",
1046 $this->prepareJavascriptOutput("[iln " . $a_bb_type . "=\"" . $a_obj_id . "\"" . $target_str . "]")
1047 );
1048 $tpl->setVariable("LINK_CONTENT", $a_link_content);
1049 $tpl->setVariable("LINK_END", "[/iln]");
1050 }
1051 }
1052 $tpl->parseCurrentBlock();
1053
1054 $tpl->setCurrentBlock("row");
1055 $tpl->parseCurrentBlock();
1056 }
static _recoverParameters()
Recover parameters from session variables (static)
prepareJavascriptOutput(string $str)
Prepare output for JS enabled editing.
outputThumbnail(ilGlobalTemplate $tpl, int $a_id, string $a_mode="")
output thumbnail
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)

References ilGlobalTemplate\parseCurrentBlock(), ilGlobalTemplate\setCurrentBlock(), and ilGlobalTemplate\setVariable().

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 235 of file class.ilInternalLinkGUI.php.

235 : void
236 {
238
239 $ctrl->setParameter($this, "link_par_ref_id", 0);
240 $ctrl->setParameter($this, "link_par_obj_id", 0);
241 $ctrl->setParameter($this, "link_par_fold_id", 0);
242 $ctrl->setParameter($this, "link_type", "");
243
244 $ctrl->redirect($this, "showLinkHelp", "", true);
245 }

References $ctrl, ilCtrl\redirect(), and ilCtrl\setParameter().

Referenced by init().

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

◆ saveFileLink()

ilInternalLinkGUI::saveFileLink ( )

Save file link.

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

725 : void
726 {
727 if ($_FILES["link_file"]["name"] != "") {
728 $fileObj = new ilObjFile();
729 $fileObj->setType("file");
730 $fileObj->setTitle($_FILES["link_file"]["name"]);
731 $fileObj->setDescription("");
732 $fileObj->setFileName($_FILES["link_file"]["name"]);
733 $fileObj->setMode("filelist");
734 $fileObj->create();
735 // upload file to filesystem
736 $fileObj->getUploadFile(
737 $_FILES["link_file"]["tmp_name"],
738 $_FILES["link_file"]["name"]
739 );
740 $this->uploaded_file = $fileObj;
741 }
742 $this->showLinkHelp();
743 }
showLinkHelp()
Show link help list.
Class ilObjFile.

References showLinkHelp().

+ Here is the call graph for this function:

◆ selectRepositoryItem()

ilInternalLinkGUI::selectRepositoryItem ( )

select repository item explorer

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

883 : string
884 {
885 $ilCtrl = $this->ctrl;
886
887 $ilCtrl->setParameter($this, "link_par_fold_id", "");
888
889 $exp = new ilIntLinkRepItemExplorerGUI($this, "selectRepositoryItem");
890 $exp->setSetLinkTargetScript($this->getSetLinkTargetScript());
891
892 if (!$exp->handleCommand()) {
893 return $exp->getHTML();
894 }
895 return "";
896 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by showLinkHelp().

+ Here is the caller graph for this function:

◆ setFilterWhiteList()

ilInternalLinkGUI::setFilterWhiteList ( bool  $a_white_list)

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

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

214 : void
215 {
216 $this->filter_white_list = $a_white_list;
217 }

◆ setMedPoolFolder()

ilInternalLinkGUI::setMedPoolFolder ( )

select media pool folder

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

794 : void
795 {
797 $ctrl->setParameter($this, "link_par_fold_id", $this->request->getMediaPoolFolder());
798 $ctrl->redirect($this, "showLinkHelp", "", true);
799 }

References ilCtrl\redirect(), and ilCtrl\setParameter().

+ Here is the call graph for this function:

◆ setReturn()

ilInternalLinkGUI::setReturn ( string  $a_return)

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

196 : void
197 {
198 $this->return = $a_return;
199 }

◆ setSetLinkTargetScript()

ilInternalLinkGUI::setSetLinkTargetScript ( string  $a_script)

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

191 : void
192 {
193 $this->set_link_script = $a_script;
194 }

◆ showLinkHelp()

ilInternalLinkGUI::showLinkHelp ( )

Show link help list.

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

268 : void
269 {
270 $ilUser = $this->user;
271 $ilCtrl = $this->ctrl;
272
273
274 $parent_type = $this->parent_type[$this->base_link_type] ?? "";
275 if ((in_array($this->base_link_type, array("GlossaryItem", "WikiPage", "PageObject", "StructureObject"), true) &&
276 ($this->parent_ref_id === 0))
277 ||
278 (($this->parent_ref_id > 0) &&
279 ilObject::_lookupType($this->parent_ref_id, true) !== $parent_type)) {
280 if ($parent_type !== "") {
282 }
283 }
284 if ($ilCtrl->isAsynch()) {
285 $tpl = new ilGlobalTemplate("tpl.link_help_asynch.html", true, true, "components/ILIAS/COPage/IntLink");
286 $tpl->setVariable("NEW_LINK_URL", $this->ctrl->getLinkTarget(
287 $this,
288 "",
289 false,
290 true,
291 false
292 ));
293 } else {
294 $tpl = new ilGlobalTemplate("tpl.link_help.html", true, true, "components/ILIAS/COPage/IntLink");
295 $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
296 }
297
298 $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "changeLinkType", "", true));
299 $tpl->setVariable("FORMACTION2", $this->ctrl->getFormAction($this));
300 $tpl->setVariable("TXT_HELP_HEADER", $this->lng->txt("cont_link_select"));
301 $tpl->setVariable("TXT_TYPE", $this->lng->txt("cont_link_type"));
302
303
305 $this->link_type,
306 "ltype",
307 $this->ltypes,
308 false,
309 true,
310 "0",
311 "",
312 array("id" => "ilIntLinkTypeSelector")
313 );
314 $tpl->setVariable("SELECT_TYPE", $select_ltype);
315 $tpl->setVariable("CMD_CHANGETYPE", "changeLinkType");
316 $tpl->setVariable("BTN_CHANGETYPE", $this->lng->txt("cont_change_type"));
317
318 $tpl->setVariable("CMD_CLOSE", "closeLinkHelp");
319 $tpl->setVariable("BTN_CLOSE", $this->lng->txt("close"));
320
321 $chapterRowBlock = "chapter_row_js";
322
323 // switch link type
324 switch ($this->base_link_type) {
325 // page link
326 case "PageObject":
327 $cont_obj = new ilObjLearningModule($this->parent_ref_id, true);
328
329 // get all chapters
330 $ctree = $cont_obj->getLMTree();
331 $nodes = $ctree->getSubTree($ctree->getNodeData($ctree->getRootId()));
332 $tpl->setCurrentBlock("chapter_list");
333 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("obj_lm"));
334 $tpl->setVariable("TXT_CONT_TITLE", $cont_obj->getTitle());
335 $tpl->setVariable("THEAD", $this->lng->txt("copg_pages"));
336
337
338 $tpl->setCurrentBlock("change_cont_obj");
339 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
340 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
341 $tpl->parseCurrentBlock();
342
343 foreach ($nodes as $node) {
344 if ($node["type"] === "st") {
345 $tpl->setCurrentBlock("header_row");
346 $tpl->setVariable("TXT_HEADER", $node["title"]);
347 $tpl->parseCurrentBlock();
348 $tpl->setCurrentBlock("row");
349 $tpl->parseCurrentBlock();
350 }
351
352 if ($node["type"] === "pg") {
353 $this->renderLink(
354 $tpl,
355 $node["title"],
356 $node["obj_id"],
357 "PageObject",
358 "pg",
359 "page",
360 ilPCParagraph::_readAnchors("lm", $node["obj_id"], "")
361 );
362 }
363 }
364
365 // get all free pages
366 $pages = ilLMPageObject::getPageList($cont_obj->getId());
367 $free_pages = array();
368 foreach ($pages as $page) {
369 if (!$ctree->isInTree($page["obj_id"])) {
370 $free_pages[] = $page;
371 }
372 }
373 if (count($free_pages) > 0) {
374 $tpl->setCurrentBlock("header_row");
375 $tpl->setVariable("TXT_HEADER", $this->lng->txt("cont_free_pages"));
376 $tpl->parseCurrentBlock();
377
378 foreach ($free_pages as $node) {
379 $this->renderLink(
380 $tpl,
381 $node["title"],
382 $node["obj_id"],
383 "PageObject",
384 "pg",
385 "page",
386 ilPCParagraph::_readAnchors("lm", $node["obj_id"], "")
387 );
388 }
389 }
390
391 $tpl->setCurrentBlock("chapter_list");
392 $tpl->parseCurrentBlock();
393
394 break;
395
396 // chapter link
397 case "StructureObject":
398
399 // check whether current object matchs to type
400 if (ilObject::_lookupType($this->parent_ref_id, true) !== "lm") {
401 $this->changeTargetObject("lm");
402 }
403
404 $cont_obj = new ilObjLearningModule($this->parent_ref_id, true);
405
406 // get all chapters
407 $ctree = $cont_obj->getLMTree();
408 $nodes = $ctree->getSubTree($ctree->getNodeData($ctree->getRootId()));
409 $tpl->setCurrentBlock("chapter_list");
410 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("obj_lm"));
411 $tpl->setVariable("TXT_CONT_TITLE", $cont_obj->getTitle());
412 $tpl->setVariable("THEAD", $this->lng->txt("link_chapters"));
413 $tpl->setCurrentBlock("change_cont_obj");
414 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
415 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
416 $tpl->parseCurrentBlock();
417
418 foreach ($nodes as $node) {
419 if ($node["type"] === "st") {
420 $this->renderLink(
421 $tpl,
422 $node["title"],
423 $node["obj_id"],
424 "StructureObject",
425 "st",
426 "chap"
427 );
428 }
429 }
430 $tpl->setCurrentBlock("chapter_list");
431 $tpl->parseCurrentBlock();
432 break;
433
434 // glossary item link
435 case "GlossaryItem":
436 $glossary = new ilObjGlossary($this->parent_ref_id, true);
437
438 // get all glossary items
439 $terms = $glossary->getTermList();
440 $tpl->setCurrentBlock("chapter_list");
441 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("glossary"));
442 $tpl->setVariable("TXT_CONT_TITLE", $glossary->getTitle());
443 $tpl->setVariable("THEAD", $this->lng->txt("link_terms"));
444 $tpl->setCurrentBlock("change_cont_obj");
445 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
446 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
447 $tpl->parseCurrentBlock();
448
449 foreach ($terms as $term) {
450 $this->renderLink(
451 $tpl,
452 $term["term"],
453 $term["id"],
454 "GlossaryItem",
455 "git",
456 "term"
457 );
458 }
459
460 $tpl->setCurrentBlock("chapter_list");
461 $tpl->parseCurrentBlock();
462 break;
463
464 // media object
465 case "Media":
466 //$tpl->setVariable("TARGET2", " target=\"content\" ");
467 // content object id = 0 --> get clipboard objects
468 if ($this->parent_ref_id === 0) {
469 $tpl->setCurrentBlock("change_cont_obj");
470 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
471 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
472 $tpl->parseCurrentBlock();
473 $mobjs = $ilUser->getClipboardObjects("mob");
474 // sort by name
475 $objs = array();
476 foreach ($mobjs as $obj) {
477 $objs[$obj["title"] . ":" . $obj["id"]] = $obj;
478 }
479 ksort($objs);
480 $tpl->setCurrentBlock("chapter_list");
481 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("cont_media_source"));
482 $tpl->setVariable("TXT_CONT_TITLE", $this->lng->txt("cont_personal_clipboard"));
483 $tpl->setVariable("THEAD", $this->lng->txt("link_mobs"));
484 $tpl->setVariable("COLSPAN", "2");
485
486 foreach ($objs as $obj) {
487 $this->renderLink(
488 $tpl,
489 $obj["title"],
490 $obj["id"],
491 "MediaObject",
492 "mob",
493 "media"
494 );
495 }
496 } else {
497 $med_pool = new ilObjMediaPool($this->parent_ref_id, true);
498 // get current folders
499 $fobjs = $med_pool->getChilds($this->parent_fold_id, "fold");
500 $f2objs = array();
501 foreach ($fobjs as $obj) {
502 $f2objs[$obj["title"] . ":" . $obj["child"]] = $obj;
503 }
504 ksort($f2objs);
505 // get current media objects
506 $mobjs = $med_pool->getChilds($this->parent_fold_id, "mob");
507 $m2objs = array();
508 foreach ($mobjs as $obj) {
509 $m2objs[$obj["title"] . ":" . $obj["child"]] = $obj;
510 }
511 ksort($m2objs);
512
513 // merge everything together
514 $objs = array_merge($f2objs, $m2objs);
515
516 $tpl->setCurrentBlock("chapter_list");
517 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("mep"));
518 $tpl->setVariable("TXT_CONT_TITLE", $med_pool->getTitle());
519 $tpl->setVariable("THEAD", $this->lng->txt("link_mobs"));
520 $tpl->setCurrentBlock("change_cont_obj");
521 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
522 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
523 $tpl->setVariable("COLSPAN", "2");
524 $tpl->parseCurrentBlock();
525 if ($parent_id = $med_pool->getParentId($this->parent_fold_id)) {
526 $tpl->setCurrentBlock("icon");
527 $tpl->setVariable("ICON_SRC", ilUtil::getImagePath("standard/icon_fold.svg"));
528 $tpl->parseCurrentBlock();
529 $tpl->setCurrentBlock("link_row");
530 $tpl->setVariable("TXT_CHAPTER", "..");
531 $this->ctrl->setParameter($this, "mep_fold", $parent_id);
532 if ($ilCtrl->isAsynch()) {
533 $tpl->setVariable("LINK", "#");
534 $tpl->setVariable(
535 "LR_ONCLICK",
536 " onclick=\"return il.IntLink.setMepPoolFolder('" . $parent_id . "');\" "
537 );
538 } else {
539 $tpl->setVariable(
540 "LINK",
541 $this->ctrl->getLinkTarget($this, "setMedPoolFolder")
542 );
543 }
544 $tpl->parseCurrentBlock();
545 $tpl->setCurrentBlock("row");
546 $tpl->parseCurrentBlock();
547 }
548 foreach ($objs as $obj) {
549 if ($obj["type"] === "fold") {
550 $tpl->setCurrentBlock("icon");
551 $tpl->setVariable("ICON_SRC", ilUtil::getImagePath("standard/icon_fold.svg"));
552 $tpl->parseCurrentBlock();
553 $tpl->setCurrentBlock("link_row");
554 $tpl->setVariable("TXT_CHAPTER", $obj["title"]);
555 $this->ctrl->setParameter($this, "mep_fold", $obj["child"]);
556 if ($ilCtrl->isAsynch()) {
557 $tpl->setVariable("LINK", "#");
558 $tpl->setVariable(
559 "LR_ONCLICK",
560 " onclick=\"return il.IntLink.setMepPoolFolder('" . $obj["child"] . "');\" "
561 );
562 } else {
563 $tpl->setVariable(
564 "LINK",
565 $this->ctrl->getLinkTarget($this, "setMedPoolFolder")
566 );
567 }
568 $tpl->parseCurrentBlock();
569 } else {
570 $fid = ilMediaPoolItem::lookupForeignId($obj["child"]);
571 if (ilObject::_lookupType($fid) === "mob") {
572 $this->renderLink(
573 $tpl,
574 $obj["title"],
575 $fid,
576 "MediaObject",
577 "mob",
578 "media"
579 );
580 }
581 }
582 $tpl->setCurrentBlock("row");
583 $tpl->parseCurrentBlock();
584 }
585 }
586 $tpl->setCurrentBlock("chapter_list");
587 $tpl->parseCurrentBlock();
588 break;
589
590 // wiki page link
591 case "WikiPage":
592 $wiki_id = ilObject::_lookupObjId($this->parent_ref_id);
593 $wpages = ilWikiPage::getAllWikiPages($wiki_id);
594
595 // get all glossary items
596 $tpl->setCurrentBlock("chapter_list");
597 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("obj_wiki"));
598 $tpl->setVariable("TXT_CONT_TITLE", ilObject::_lookupTitle($wiki_id));
599 $tpl->setVariable("THEAD", $this->lng->txt("link_wpages"));
600 $tpl->setCurrentBlock("change_cont_obj");
601 $tpl->setVariable("CMD_CHANGE_CONT_OBJ", "changeTargetObject");
602 $tpl->setVariable("BTN_CHANGE_CONT_OBJ", $this->lng->txt("change"));
603 $tpl->parseCurrentBlock();
604
605 foreach ($wpages as $wpage) {
606 $this->renderLink(
607 $tpl,
608 $wpage["title"],
609 $wpage["id"],
610 "WikiPage",
611 "wpage",
612 "wpage",
613 ilPCParagraph::_readAnchors("wpg", $wpage["id"], "")
614 );
615 }
616 $tpl->setCurrentBlock("chapter_list");
617 $tpl->parseCurrentBlock();
618 break;
619
620 // Portfolio page link
621 case "PortfolioPage":
622 case "PortfolioTemplatePage":
623 $prtf_id = $this->parent_obj_id;
624 $ppages = ilPortfolioPage::getAllPortfolioPages($prtf_id);
625
626 // get all glossary items
627 $tpl->setCurrentBlock("chapter_list");
628 $tpl->setVariable("TXT_CONTENT_OBJECT", $this->lng->txt("obj_" . ilObject::_lookupType($prtf_id)));
629 $tpl->setVariable("TXT_CONT_TITLE", ilObject::_lookupTitle($prtf_id));
630 $tpl->setVariable("THEAD", $this->lng->txt("copg_pages"));
631
632 foreach ($ppages as $ppage) {
633 $this->renderLink(
634 $tpl,
635 $ppage["title"],
636 $ppage["id"],
637 "PortfolioPage",
638 "ppage",
639 "ppage",
640 array(),
641 $ppage["title"]
642 );
643 }
644
645 $tpl->setCurrentBlock("chapter_list");
646 $tpl->parseCurrentBlock();
647 break;
648
649 // repository item
650 case "RepositoryItem":
651 $tpl->setVariable("LINK_HELP_CONTENT", $this->selectRepositoryItem());
652 break;
653
654 // file download link
655 case "File":
656 if (!isset($this->uploaded_file)) {
657 $tpl->setVariable("LINK_HELP_CONTENT", $this->getFileLinkHTML());
658 } else {
659 echo $this->getFileLinkHTML();
660 exit;
661 }
662 break;
663
664 // file download link
665 case "User":
666 $tpl->setVariable("LINK_HELP_CONTENT", $this->addUser());
667 break;
668 }
669
670 if ($ilCtrl->isAsynch()) {
671 echo $tpl->get();
672 exit;
673 }
674
675 exit;
676 }
special template class to simplify handling of ITX/PEAR
renderLink(ilGlobalTemplate $tpl, string $a_title, int $a_obj_id, string $a_type, string $a_type_short, string $a_bb_type, array $a_anchors=array(), string $a_link_content="")
Render internal link item.
getFileLinkHTML()
Get HTML for file link.
changeTargetObject(string $a_type="")
Cange target object.
static getPageList(int $lm_id)
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
static lookupForeignId(int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTitle(int $obj_id)
static _readAnchors(string $a_parent_type, int $a_page_id, string $a_page_lang="-")
Read anchors of a page.
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
static getAllWikiPages(int $a_wiki_id, string $lang="-")

References $base_link_type, $ctrl, $parent_obj_id, $parent_type, $user, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilPCParagraph\_readAnchors(), addUser(), changeTargetObject(), ILIAS\Repository\ctrl(), exit, ilLegacyFormElementsUtil\formSelect(), ilPortfolioPage\getAllPortfolioPages(), ilWikiPage\getAllWikiPages(), getFileLinkHTML(), ilUtil\getImagePath(), ilLMPageObject\getPageList(), ilUtil\getStyleSheetLocation(), ILIAS\Repository\lng(), ilMediaPoolItem\lookupForeignId(), renderLink(), and selectRepositoryItem().

Referenced by saveFileLink().

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

Field Documentation

◆ $base_link_type

string ilInternalLinkGUI::$base_link_type = ""
protected

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

Referenced by showLinkHelp().

◆ $ctrl

ilCtrl ilInternalLinkGUI::$ctrl

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

Referenced by getFileLinkHTML(), init(), resetLinkList(), and showLinkHelp().

◆ $default_link_type

string ilInternalLinkGUI::$default_link_type = ""
protected

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

◆ $default_parent_obj_id

int ilInternalLinkGUI::$default_parent_obj_id = 0
protected

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

Referenced by init().

◆ $default_parent_obj_type

string ilInternalLinkGUI::$default_parent_obj_type
protected

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

◆ $default_parent_ref_id

int ilInternalLinkGUI::$default_parent_ref_id = 0
protected

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

Referenced by init().

◆ $filter_link_types

array ilInternalLinkGUI::$filter_link_types = []
protected

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

◆ $filter_white_list

bool ilInternalLinkGUI::$filter_white_list = false
protected

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

◆ $link_target

string ilInternalLinkGUI::$link_target = ""
protected

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

◆ $link_type

string ilInternalLinkGUI::$link_type = ""
protected

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

Referenced by init().

◆ $lng

ilLanguage ilInternalLinkGUI::$lng
protected

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

Referenced by getFileLinkHTML(), and init().

◆ $ltypes

array ilInternalLinkGUI::$ltypes = []
protected

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

Referenced by init().

◆ $parent_fold_id

int ilInternalLinkGUI::$parent_fold_id
protected

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

◆ $parent_obj_id

int ilInternalLinkGUI::$parent_obj_id = 0
protected

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

Referenced by showLinkHelp().

◆ $parent_ref_id

int ilInternalLinkGUI::$parent_ref_id = 0
protected

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

◆ $parent_type

array ilInternalLinkGUI::$parent_type = []
protected

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

Referenced by showLinkHelp().

◆ $request

StandardGUIRequest ilInternalLinkGUI::$request
protected

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

◆ $return

string ilInternalLinkGUI::$return
protected

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

◆ $set_link_script

string ilInternalLinkGUI::$set_link_script = ""

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

Referenced by getSetLinkTargetScript().

◆ $thumbs_gui

ILIAS MediaObjects Thumbs ThumbsGUI ilInternalLinkGUI::$thumbs_gui
protected

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

◆ $tree

ilTree ilInternalLinkGUI::$tree
protected

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

Referenced by init().

◆ $uploaded_file

ilObjFile ilInternalLinkGUI::$uploaded_file = null
protected

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

◆ $user

ilObjUser ilInternalLinkGUI::$user
protected

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

Referenced by showLinkHelp().


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