ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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

Definition at line 25 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 54 of file class.ilInternalLinkGUI.php.

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

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

Member Function Documentation

◆ addUser()

ilInternalLinkGUI::addUser ( )

Add user.

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

References getUserSearchResult(), and initUserSearchForm().

Referenced by showLinkHelp().

1057  : string
1058  {
1059  $form = $this->initUserSearchForm();
1060  return $form->getHTML() . $this->getUserSearchResult();
1061  }
getUserSearchResult()
Search user.
initUserSearchForm()
Init user search form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeLinkType()

ilInternalLinkGUI::changeLinkType ( )

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

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

773  : void
774  {
775  $ctrl = $this->ctrl;
776 
777  $ctrl->setParameter($this, "link_type", $this->request->getLinkType());
778  $base_type = explode("_", $this->request->getLinkType())[0];
779  if ($this->parent_type[$base_type] !== ilObject::_lookupType($this->parent_ref_id, true)) {
780  $ctrl->setParameter($this, "link_par_ref_id", 0);
781  $ctrl->setParameter($this, "link_par_obj_id", 0);
782  }
783 
784  $ctrl->redirect($this, "showLinkHelp", "", true);
785  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ changeTargetObject()

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

Cange target object.

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

References $ctrl, ILIAS\Repository\ctrl(), exit, getTargetExplorer(), ILIAS\Repository\lng(), and ilCtrl\setParameter().

Referenced by showLinkHelp().

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

◆ closeLinkHelp()

ilInternalLinkGUI::closeLinkHelp ( )

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

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

243  : void
244  {
245  if ($this->return === "") {
246  $this->ctrl->returnToParent($this);
247  } else {
248  ilUtil::redirect($this->return);
249  }
250  }
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ executeCommand()

ilInternalLinkGUI::executeCommand ( )

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

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

216  : string
217  {
218  $this->init();
219  $next_class = $this->ctrl->getNextClass($this);
220 
221  $cmd = $this->ctrl->getCmd("showLinkHelp");
222  switch ($next_class) {
223  default:
224  $ret = $this->$cmd();
225  break;
226  }
227 
228  return (string) $ret;
229  }
+ Here is the call graph for this function:

◆ filterLinkType()

ilInternalLinkGUI::filterLinkType ( string  $a_link_type)

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

202  : void
203  {
204  $this->filter_link_types[] = $a_link_type;
205  }

◆ getFileLinkHTML()

ilInternalLinkGUI::getFileLinkHTML ( )

Get HTML for file link.

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

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

Referenced by showLinkHelp().

677  : string
678  {
679  $lng = $this->lng;
680  $ilCtrl = $this->ctrl;
681 
682  $tpl = new ilTemplate("tpl.link_file.html", true, true, "components/ILIAS/COPage/IntLink");
683  if (!is_object($this->uploaded_file)) {
684  $tpl->setCurrentBlock("form");
685  $tpl->setVariable(
686  "FORM_ACTION",
687  $ilCtrl->getFormAction($this, "saveFileLink", "", true)
688  );
689  $tpl->setVariable("TXT_SELECT_FILE", $lng->txt("cont_select_file"));
690  $tpl->setVariable("TXT_SAVE_LINK", $lng->txt("cont_create_link"));
691  $tpl->setVariable("CMD_SAVE_LINK", "saveFileLink");
692  $fi = new ilFileInputGUI("", "link_file");
693  $fi->setSize(15);
694  $tpl->setVariable("INPUT", $fi->getToolbarHTML());
695  $tpl->parseCurrentBlock();
696  } else {
697  $tpl->setCurrentBlock("link_js");
698  // $tpl->setVariable("LINK_FILE",
699  // $this->prepareJavascriptOutput("[iln dfile=\"".$this->uploaded_file->getId()."\"] [/iln]")
700  // );
701  $tpl->setVariable(
702  "TAG_B",
703  '[iln dfile=\x22' . $this->uploaded_file->getId() . '\x22]'
704  );
705  $tpl->setVariable(
706  "TAG_E",
707  "[/iln]"
708  );
709  $tpl->setVariable(
710  "TXT_FILE",
711  $this->uploaded_file->getTitle()
712  );
713  // $tpl->parseCurrentBlock();
714  }
715  return $tpl->get();
716  }
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...
This class represents a file property in a property form.
+ 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 912 of file class.ilInternalLinkGUI.php.

References $DIC, ilExplorerBaseGUI\init(), and ilLanguage\loadLanguageModule().

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

912  : string
913  {
914  global $DIC;
915 
916  $lng = $DIC->language();
917  $tpl = $DIC["tpl"];
918 
919  $tpl->addOnLoadCode(
920  self::getOnloadCode($a_url)
921  );
922 
923  $lng->loadLanguageModule("link");
924 
925  $debug = false;
926 
927  $tpl->addJavaScript("assets/js/ilExplorer.js");
929 
930  if ($debug) {
931  $tpl->addJavascript("../components/ILIAS/COPage/IntLink/resources/ilIntLink.js");
932  } else {
933  $tpl->addJavascript("assets/js/ilIntLink.js");
934  }
935 
936  // #18721
937  $tpl->addJavaScript("assets/js/Form.js");
938 
939  $mt = self::getModalTemplate();
940  $tpl->addOnLoadCode('il.IntLink.setModalTemplate("' . addslashes(json_encode($mt["template"])) . '");');
941 
942  $html = "<div id='ilIntLinkModal' data-show-signal='" . $mt["show"] . "' data-close-signal='" . $mt["close"] . "'></div>";
943 
944  return $html;
945  }
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: shib_login.php:25
static init(ilGlobalTemplateInterface $a_main_tpl=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getModalTemplate()

static ilInternalLinkGUI::getModalTemplate ( )
static

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

References $DIC, and ilLanguage\txt().

947  : array
948  {
949  global $DIC;
950 
951  $lng = $DIC->language();
952 
953  $ui = $DIC->ui();
954  $modal = $ui->factory()->modal()->roundtrip($lng->txt("link_link"), $ui->factory()->legacy("<div id='ilIntLinkModalContent'></div>"));
955  $modalt["show"] = $modal->getShowSignal()->getId();
956  $modalt["close"] = $modal->getCloseSignal()->getId();
957  $modalt["template"] = $ui->renderer()->renderAsync($modal);
958 
959  return $modalt;
960  }
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...
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ getOnloadCode()

static ilInternalLinkGUI::getOnloadCode ( string  $a_url)
static

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

Referenced by ilLinkInputGUI\getOnloadCode().

904  : string
905  {
906  return "il.Util.addOnLoad(function() {il.IntLink.init({url: '$a_url'});});";
907  }
+ Here is the caller graph for this function:

◆ getSetLinkTargetScript()

ilInternalLinkGUI::getSetLinkTargetScript ( )

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

References $set_link_script.

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

197  : string
198  {
199  return $this->set_link_script;
200  }
+ Here is the caller graph for this function:

◆ getTargetExplorer()

ilInternalLinkGUI::getTargetExplorer ( )

Cange target object.

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

References $base_link_type.

Referenced by changeTargetObject().

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

◆ getUserSearchResult()

ilInternalLinkGUI::getUserSearchResult ( )

Search user.

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

References Vendor\Package\$b, $DIC, Vendor\Package\$f, $id, $r, ilObjUser\_getPersonalPicturePath(), ilObjUser\_lookupLogin(), ilUserUtil\getNamePresentation(), ilUtil\getSystemMessageHTML(), initUserSearchForm(), ilLanguage\loadLanguageModule(), ilInternalLink\searchUsers(), ilLanguage\txt(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

Referenced by addUser().

1084  : string
1085  {
1086  global $DIC;
1087 
1088  $lng = $DIC->language();
1089 
1090  if (strlen($this->request->getUserSearchStr()) < 3) {
1091  if (strlen($this->request->getUserSearchStr()) > 0) {
1092  $lng->loadLanguageModule("search");
1093  return ilUtil::getSystemMessageHTML($lng->txt("search_minimum_three"), "info");
1094  }
1095 
1096  return "";
1097  }
1098 
1099  $form = $this->initUserSearchForm();
1100  $form->checkInput();
1101 
1102  $users = ilInternalLink::searchUsers($form->getInput("usr_search_str"));
1103  if (count($users) === 0) {
1104  return ilUtil::getSystemMessageHTML($lng->txt("cont_user_search_did_not_match"), "info");
1105  }
1106 
1107  $f = $DIC->ui()->factory();
1108  $r = $DIC->ui()->renderer();
1109  $lng = $DIC->language();
1110  $cards = array();
1111  foreach ($users as $user) {
1112  $b = $f->button()->standard($lng->txt("insert"), "#")
1113  ->withOnLoadCode(function ($id) use ($user) {
1114  return
1115  '$("#' . $id . "\").click(function(ev) { il.IntLink.addInternalLink('[iln user=\"" .
1116  ilObjUser::_lookupLogin($user) . "\"/]', '', ev); return false;});";
1117  });
1118  $name = ilUserUtil::getNamePresentation($user);
1119  $cards[] = $f->card()->standard($name, $f->image()->responsive(ilObjUser::_getPersonalPicturePath($user, "small"), $name))
1120  ->withSections(array($b));
1121  }
1122  $deck = $f->deck($cards)->withLargeCardsSize();
1123 
1124  return $r->renderAsync($deck);
1125  }
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
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...
loadLanguageModule(string $a_module)
Load language module.
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='ilpublicuserprofilegui')
Default behaviour is:
global $DIC
Definition: shib_login.php:25
static _getPersonalPicturePath(int $a_usr_id, string $a_size='small', bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
initUserSearchForm()
Init user search form.
$r
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

ilInternalLinkGUI::init ( )

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

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

Referenced by executeCommand().

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

References ILIAS\Repository\lng().

Referenced by addUser(), and getUserSearchResult().

1067  {
1068  $form = new ilPropertyFormGUI();
1069  $form->setId("link_user_search_form");
1070 
1071  // user search
1072  $ti = new ilTextInputGUI($this->lng->txt("obj_user"), "usr_search_str");
1073  $ti->setValue($this->request->getUserSearchStr());
1074  $form->addItem($ti);
1075 
1076  $form->addCommandButton("searchUser", $this->lng->txt("search"));
1077 
1078  return $form;
1079  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outputThumbnail()

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

output thumbnail

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

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

Referenced by renderLink().

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

◆ prepareJavascriptOutput()

ilInternalLinkGUI::prepareJavascriptOutput ( string  $str)

Prepare output for JS enabled editing.

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

Referenced by renderLink().

255  : string
256  {
257  return htmlspecialchars($str, ENT_QUOTES);
258  }
+ Here is the caller graph for this function:

◆ refreshRepositorySelector()

ilInternalLinkGUI::refreshRepositorySelector ( )

Refresh Repository Selector.

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

References exit, and selectRepositoryItem().

897  : void
898  {
899  $output = $this->selectRepositoryItem();
900  echo $output;
901  exit;
902  }
selectRepositoryItem()
select repository item explorer
+ Here is the call graph for this function:

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

References ilImageMapEditorGUI\_recoverParameters(), ilUtil\appendUrlParameterString(), getSetLinkTargetScript(), outputThumbnail(), ilGlobalTemplate\parseCurrentBlock(), prepareJavascriptOutput(), ilGlobalTemplate\setCurrentBlock(), and ilGlobalTemplate\setVariable().

Referenced by showLinkHelp().

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

◆ resetLinkList()

ilInternalLinkGUI::resetLinkList ( )

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

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

Referenced by init().

231  : void
232  {
233  $ctrl = $this->ctrl;
234 
235  $ctrl->setParameter($this, "link_par_ref_id", 0);
236  $ctrl->setParameter($this, "link_par_obj_id", 0);
237  $ctrl->setParameter($this, "link_par_fold_id", 0);
238  $ctrl->setParameter($this, "link_type", "");
239 
240  $ctrl->redirect($this, "showLinkHelp", "", true);
241  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ 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 721 of file class.ilInternalLinkGUI.php.

References showLinkHelp().

721  : void
722  {
723  if ($_FILES["link_file"]["name"] != "") {
724  $fileObj = new ilObjFile();
725  $fileObj->setType("file");
726  $fileObj->setTitle($_FILES["link_file"]["name"]);
727  $fileObj->setDescription("");
728  $fileObj->setFileName($_FILES["link_file"]["name"]);
729  $fileObj->setMode("filelist");
730  $fileObj->create();
731  // upload file to filesystem
732  $fileObj->getUploadFile(
733  $_FILES["link_file"]["tmp_name"],
734  $_FILES["link_file"]["name"]
735  );
736  $this->uploaded_file = $fileObj;
737  }
738  $this->showLinkHelp();
739  }
showLinkHelp()
Show link help list.
Class ilObjFile.
+ Here is the call graph for this function:

◆ selectRepositoryItem()

ilInternalLinkGUI::selectRepositoryItem ( )

select repository item explorer

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

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

Referenced by refreshRepositorySelector(), and showLinkHelp().

879  : string
880  {
881  $ilCtrl = $this->ctrl;
882 
883  $ilCtrl->setParameter($this, "link_par_fold_id", "");
884 
885  $exp = new ilIntLinkRepItemExplorerGUI($this, "selectRepositoryItem");
886  $exp->setSetLinkTargetScript($this->getSetLinkTargetScript());
887 
888  if (!$exp->handleCommand()) {
889  return $exp->getHTML();
890  }
891  return "";
892  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:
+ 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 210 of file class.ilInternalLinkGUI.php.

Referenced by ilPageEditorGUI\executeCommand().

210  : void
211  {
212  $this->filter_white_list = $a_white_list;
213  }
+ Here is the caller graph for this function:

◆ setMedPoolFolder()

ilInternalLinkGUI::setMedPoolFolder ( )

select media pool folder

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

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

790  : void
791  {
792  $ctrl = $this->ctrl;
793  $ctrl->setParameter($this, "link_par_fold_id", $this->request->getMediaPoolFolder());
794  $ctrl->redirect($this, "showLinkHelp", "", true);
795  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ setReturn()

ilInternalLinkGUI::setReturn ( string  $a_return)

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

192  : void
193  {
194  $this->return = $a_return;
195  }

◆ setSetLinkTargetScript()

ilInternalLinkGUI::setSetLinkTargetScript ( string  $a_script)

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

187  : void
188  {
189  $this->set_link_script = $a_script;
190  }

◆ showLinkHelp()

ilInternalLinkGUI::showLinkHelp ( )

Show link help list.

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

References $base_link_type, $ctrl, $parent_obj_id, $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().

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

Referenced by getTargetExplorer(), and showLinkHelp().

◆ $ctrl

◆ $default_link_type

string ilInternalLinkGUI::$default_link_type = ""
protected

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

◆ $default_parent_obj_id

int ilInternalLinkGUI::$default_parent_obj_id = 0
protected

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

Referenced by init().

◆ $default_parent_obj_type

string ilInternalLinkGUI::$default_parent_obj_type
protected

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

◆ $default_parent_ref_id

int ilInternalLinkGUI::$default_parent_ref_id = 0
protected

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

Referenced by init().

◆ $filter_link_types

array ilInternalLinkGUI::$filter_link_types = []
protected

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

◆ $filter_white_list

bool ilInternalLinkGUI::$filter_white_list = false
protected

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

◆ $link_target

string ilInternalLinkGUI::$link_target = ""
protected

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

◆ $link_type

string ilInternalLinkGUI::$link_type = ""
protected

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

◆ $lng

ilLanguage ilInternalLinkGUI::$lng
protected

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

Referenced by getFileLinkHTML(), and init().

◆ $ltypes

array ilInternalLinkGUI::$ltypes = []
protected

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

Referenced by init().

◆ $parent_fold_id

int ilInternalLinkGUI::$parent_fold_id
protected

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

◆ $parent_obj_id

int ilInternalLinkGUI::$parent_obj_id = 0
protected

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

Referenced by showLinkHelp().

◆ $parent_ref_id

int ilInternalLinkGUI::$parent_ref_id = 0
protected

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

◆ $parent_type

array ilInternalLinkGUI::$parent_type = []
protected

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

◆ $request

StandardGUIRequest ilInternalLinkGUI::$request
protected

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

◆ $return

string ilInternalLinkGUI::$return
protected

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

◆ $set_link_script

string ilInternalLinkGUI::$set_link_script = ""

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

Referenced by getSetLinkTargetScript().

◆ $thumbs_gui

ILIAS MediaObjects Thumbs ThumbsGUI ilInternalLinkGUI::$thumbs_gui
protected

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

◆ $tree

ilTree ilInternalLinkGUI::$tree
protected

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

Referenced by init().

◆ $uploaded_file

ilObjFile ilInternalLinkGUI::$uploaded_file = null
protected

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

◆ $user

ilObjUser ilInternalLinkGUI::$user
protected

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

Referenced by showLinkHelp().


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