ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilInternalLinkGUI Class Reference

Class ilInternalLinkGUI. More...

+ Collaboration diagram for ilInternalLinkGUI:

Public Member Functions

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

Static Public Member Functions

static _doJSEditing ()
 
static getInitHTML ($a_url)
 Get initialisation HTML to use interna link editing. More...
 

Data Fields

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

Detailed Description

Class ilInternalLinkGUI.

Some gui methods to handle internal links

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

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

Constructor & Destructor Documentation

◆ __construct()

ilInternalLinkGUI::__construct (   $a_default_type,
  $a_default_obj 
)

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

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

31  {
32  global $lng, $ilias, $ilCtrl, $tree;
33 
34  $lng->loadLanguageModule("link");
35 
36  $this->initLinkTypes();
37  if (($_SESSION["il_link_cont_obj"] != "" && !$tree->isInTree($_SESSION["il_link_cont_obj"])) ||
38  ($_SESSION["il_link_glossary"] != "" && !$tree->isInTree($_SESSION["il_link_glossary"])) ||
39  ($_SESSION["il_link_wiki"] != "" && !$tree->isInTree($_SESSION["il_link_wiki"])) ||
40  ($_SESSION["il_link_mep"] != "" && !$tree->isInTree($_SESSION["il_link_mep"])))
41  {
42  $this->resetSessionVars();
43  }
44 
45  $this->lng = $lng;
46  $this->tree = $tree;
47  $this->ctrl = $ilCtrl;
48  $this->ctrl->saveParameter($this, array("linkmode", "target_type"));
49  $this->default_type = $a_default_type;
50  $this->default_obj = $a_default_obj;
51  $this->filter_link_types = array();
52  $this->mode = "text";
53 
54  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
initLinkTypes()
Initialize link types.
+ Here is the call graph for this function:

Member Function Documentation

◆ _doJSEditing()

static ilInternalLinkGUI::_doJSEditing ( )
static
Parameters

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

References ilPageEditorGUI\_doJSEditing().

1050  {
1051  return true;
1053  }
static _doJSEditing()
checks if current user has activated js editing and if browser is js capable
+ Here is the call graph for this function:

◆ changeLinkType()

ilInternalLinkGUI::changeLinkType ( )

change link type

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

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

840  {
841  $_SESSION["il_link_type"] = $_POST["ltype"];
842  $this->determineLinkType();
843  $this->showLinkHelp();
844  }
$_SESSION["AccountId"]
showLinkHelp()
Show link help list.
determineLinkType()
Determine current link type.
$_POST["username"]
+ Here is the call graph for this function:

◆ changeTargetObject()

ilInternalLinkGUI::changeTargetObject (   $a_type = "")

Cange target object.

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

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

Referenced by showLinkHelp().

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

◆ closeLinkHelp()

ilInternalLinkGUI::closeLinkHelp ( )

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

References ilUtil\redirect().

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

◆ determineLinkType()

ilInternalLinkGUI::determineLinkType ( )

Determine current link type.

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

References $_SESSION, and $default_type.

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

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

◆ executeCommand()

ilInternalLinkGUI::executeCommand ( )

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

References $cmd, and $ret.

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

◆ filterLinkType()

ilInternalLinkGUI::filterLinkType (   $a_link_type)

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

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

◆ getFileLinkHTML()

ilInternalLinkGUI::getFileLinkHTML ( )

Get HTML for file link.

Returns
string file link html

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

References $ilCtrl, $lng, and $tpl.

Referenced by showLinkHelp().

718  {
719  global $ilCtrl, $lng;
720 
721  if (!is_object($this->uploaded_file))
722  {
723  $tpl = new ilTemplate("tpl.link_file.html", true, true, "Services/Link");
724  $tpl->setCurrentBlock("form");
725  $tpl->setVariable("FORM_ACTION",
726  $ilCtrl->getFormAction($this, "saveFileLink", "", true));
727  $tpl->setVariable("TXT_SELECT_FILE", $lng->txt("cont_select_file"));
728  $tpl->setVariable("TXT_SAVE_LINK", $lng->txt("cont_create_link"));
729  $tpl->setVariable("CMD_SAVE_LINK", "saveFileLink");
730  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
731  $fi = new ilFileInputGUI("", "link_file");
732  $fi->setSize(15);
733  $tpl->setVariable("INPUT", $fi->getToolbarHTML());
734  $tpl->parseCurrentBlock();
735  return $tpl->get();
736  }
737  else
738  {
739  $tpl = new ilTemplate("tpl.link_file.html", true, true, "Services/Link");
740  $tpl->setCurrentBlock("link_js");
741 // $tpl->setVariable("LINK_FILE",
742 // $this->prepareJavascriptOutput("[iln dfile=\"".$this->uploaded_file->getId()."\"] [/iln]")
743 // );
744  $tpl->setVariable("TAG_B",
745  '[iln dfile=\x22'.$this->uploaded_file->getId().'\x22]');
746  $tpl->setVariable("TAG_E",
747  "[/iln]");
748  $tpl->setVariable("TXT_FILE",
749  $this->uploaded_file->getTitle());
750 // $tpl->parseCurrentBlock();
751  return $tpl->get();
752  }
753  }
This class represents a file property in a property form.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ getInitHTML()

static ilInternalLinkGUI::getInitHTML (   $a_url)
static

Get initialisation HTML to use interna link editing.

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

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

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

1078  {
1079  global $tpl, $lng;
1080 
1081  $lng->loadLanguageModule("link");
1082 
1083  $tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
1084  include_once("./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
1086 
1087  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
1089 
1090  $tpl->addJavascript("./Services/Link/js/ilIntLink.js");
1091 
1092  // #18721
1093  $tpl->addJavaScript("Services/Form/js/Form.js");
1094 
1095  include_once("./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1096  $modal = ilModalGUI::getInstance();
1097  $modal->setHeading($lng->txt("link_link"));
1098  $modal->setId("ilIntLinkModal");
1099  $modal->setBody("<div id='ilIntLinkModalContent'></div>");
1100 
1101  $ltpl = new ilTemplate("tpl.int_link_panel.html", true, true, "Services/Link");
1102  $ltpl->setVariable("MODAL", $modal->getHTML());
1103 
1104  $ltpl->setVariable("IL_INT_LINK_URL", $a_url);
1105 
1106  return $ltpl->get();
1107  }
static initConnection()
Init YUI Connection module.
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
static getInstance()
Get instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSetLinkTargetScript()

ilInternalLinkGUI::getSetLinkTargetScript ( )

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

References $set_link_script.

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

125  {
126  return $this->set_link_script;
127  }
+ Here is the caller graph for this function:

◆ getTargetExplorer()

ilInternalLinkGUI::getTargetExplorer (   $a_type = "")

Cange target object.

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

References $_GET, $a_type, $ilCtrl, $white, and array.

Referenced by changeTargetObject().

859  {
860  global $ilCtrl;
861 
862  $ilCtrl->setParameter($this, "target_type", $a_type);
863  include_once("./Services/Link/classes/class.ilLinkTargetObjectExplorerGUI.php");
864  $exp = new ilLinkTargetObjectExplorerGUI($this, "getTargetExplorer");
865 
866  if ($a_type == "")
867  {
868  $a_type = $_GET["target_type"];
869  }
870 
871  $white = array("root", "cat", "crs", "fold", "grp");
872 
873  switch ($a_type)
874  {
875  case "glo":
876  $white[] = "glo";
877  $exp->setClickableType("glo");
878  break;
879 
880  case "wiki":
881  $white[] = "wiki";
882  $exp->setClickableType("wiki");
883  break;
884 
885  case "mep":
886  $white[] = "mep";
887  $exp->setClickableType("mep");
888  break;
889 
890  default:
891  $white[] = "lm";
892  $exp->setClickableType("lm");
893  break;
894  }
895 
896  $exp->setTypeWhiteList($white);
897 
898 
899  if (!$exp->handleCommand())
900  {
901  return $exp->getHTML();
902  }
903  }
Internal Link: Repository Item Selector Explorer.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:93
Create styles array
The data for the language used.
$white
Definition: example_030.php:84
+ Here is the caller graph for this function:

◆ initLinkTypes()

ilInternalLinkGUI::initLinkTypes ( )

Initialize link types.

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

References $lng, and array.

Referenced by __construct().

60  {
61  global $lng;
62 
63  $this->ltypes = array(
64  "StructureObject" => $lng->txt("cont_lk_chapter"),
65  "StructureObject_New" => $lng->txt("cont_lk_chapter_new"),
66  "PageObject" => $lng->txt("cont_lk_page"),
67  "PageObject_FAQ" => $lng->txt("cont_lk_page_faq"),
68  "PageObject_New" => $lng->txt("cont_lk_page_new"),
69  "GlossaryItem" => $lng->txt("cont_lk_term"),
70  "GlossaryItem_New" => $lng->txt("cont_lk_term_new"),
71  "Media" => $lng->txt("cont_lk_media_inline"),
72  "Media_Media" => $lng->txt("cont_lk_media_media"),
73  "Media_FAQ" => $lng->txt("cont_lk_media_faq"),
74  "Media_New" => $lng->txt("cont_lk_media_new"),
75  "WikiPage" => $lng->txt("cont_wiki_page"),
76  "File" => $lng->txt("cont_lk_file"),
77  "RepositoryItem" => $lng->txt("cont_repository_item")
78  );
79  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ isEnabledJavaScript()

ilInternalLinkGUI::isEnabledJavaScript ( )

determine, wether js is used

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

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

1060  {
1061  global $ilias;
1062 
1063  include_once("./Services/COPage/classes/class.ilPageEditorGUI.php");
1064 
1065  if (self::_doJSEditing())
1066  {
1067  return true;
1068  }
1069 
1070  return false;
1071  }
+ Here is the caller graph for this function:

◆ outputThumbnail()

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

output thumbnail

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

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

Referenced by renderLink().

787  {
788  // output thumbnail
789  $mob = new ilObjMediaObject($a_id);
790  $med =& $mob->getMediaItem("Standard");
791  $target = $med->getThumbnailTarget("small");
792  $suff = "";
793  if ($this->getSetLinkTargetScript() != "")
794  {
795  $tpl->setCurrentBlock("thumbnail_link");
796  $suff = "_link";
797  }
798  else if ($this->isEnabledJavaScript())
799  {
800  $tpl->setCurrentBlock("thumbnail_js");
801  $suff = "_js";
802  }
803  else
804  {
805  $tpl->setCurrentBlock("thumbnail");
806  }
807 
808  if ($target != "")
809  {
810  $tpl->setCurrentBlock("thumb".$suff);
811  $tpl->setVariable("SRC_THUMB", $target);
812  $tpl->parseCurrentBlock();
813  }
814  else
815  {
816  $tpl->setVariable("NO_THUMB", "&nbsp;");
817  }
818 
819  if ($this->getSetLinkTargetScript() != "")
820  {
821  $tpl->setCurrentBlock("thumbnail_link");
822  }
823  else if ($this->isEnabledJavaScript())
824 
825  {
826  $tpl->setCurrentBlock("thumbnail_js");
827  }
828  else
829  {
830  $tpl->setCurrentBlock("thumbnail");
831  }
832  $tpl->parseCurrentBlock();
833  }
global $tpl
Definition: ilias.php:8
Class ilObjMediaObject.
isEnabledJavaScript()
determine, wether js is used
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareJavascriptOutput()

ilInternalLinkGUI::prepareJavascriptOutput (   $str)

Prepare output for JS enabled editing.

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

References $ilUser.

Referenced by renderLink().

190  {
191  global $ilUser;
192 
193  include_once("./Services/COPage/classes/class.ilPageEditorGUI.php");
194  if (self::_doJSEditing())
195  {
196  $str = htmlspecialchars($str, ENT_QUOTES);
197  }
198  return($str);
199  }
$ilUser
Definition: imgupload.php:18
+ Here is the caller graph for this function:

◆ refreshRepositorySelector()

ilInternalLinkGUI::refreshRepositorySelector ( )

Refresh Repository Selector.

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

References $output, exit, and selectRepositoryItem().

1037  {
1038  $output = $this->selectRepositoryItem();
1039  echo $output;
1040  exit;
1041  }
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
selectRepositoryItem()
select repository item explorer
+ Here is the call graph for this function:

◆ renderLink()

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

Render internal link item.

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

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

Referenced by showLinkHelp().

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

◆ resetLinkList()

ilInternalLinkGUI::resetLinkList ( )

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

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

168  {
169  $this->resetSessionVars();
170  $this->determineLinkType();
171  $this->showLinkHelp();
172  }
showLinkHelp()
Show link help list.
determineLinkType()
Determine current link type.
+ Here is the call graph for this function:

◆ resetSessionVars()

ilInternalLinkGUI::resetSessionVars ( )

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

References $_SESSION.

Referenced by __construct(), and resetLinkList().

161  {
162  $_SESSION["il_link_mep"] = "";
163  $_SESSION["il_link_mep_obj"] = "";
164  $_SESSION["il_link_type"] = "";
165  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ saveFileLink()

ilInternalLinkGUI::saveFileLink ( )

Save file link.

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

References showLinkHelp().

759  {
760  if ($_FILES["link_file"]["name"] != "")
761  {
762  include_once("./Modules/File/classes/class.ilObjFile.php");
763  $fileObj = new ilObjFile();
764  $fileObj->setType("file");
765  $fileObj->setTitle($_FILES["link_file"]["name"]);
766  $fileObj->setDescription("");
767  $fileObj->setFileName($_FILES["link_file"]["name"]);
768  $fileObj->setFileType($_FILES["link_file"]["type"]);
769  $fileObj->setFileSize($_FILES["link_file"]["size"]);
770  $fileObj->setMode("filelist");
771  $fileObj->create();
772  // upload file to filesystem
773  $fileObj->createDirectory();
774  $fileObj->raiseUploadError(false);
775  $fileObj->getUploadFile($_FILES["link_file"]["tmp_name"],
776  $_FILES["link_file"]["name"]);
777  $this->uploaded_file = $fileObj;
778 
779  }
780  $this->showLinkHelp();
781  }
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 1016 of file class.ilInternalLinkGUI.php.

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

Referenced by refreshRepositorySelector(), and showLinkHelp().

1017  {
1018  global $ilCtrl;
1019 
1020  $_SESSION["il_link_mep_obj"] = "";
1021 
1022  $ilCtrl->setParameter($this, "target_type", $a_type);
1023  include_once("./Services/Link/classes/class.ilIntLinkRepItemExplorerGUI.php");
1024  $exp = new ilIntLinkRepItemExplorerGUI($this, "selectRepositoryItem");
1025  $exp->setSetLinkTargetScript($this->getSetLinkTargetScript());
1026 
1027  if (!$exp->handleCommand())
1028  {
1029  return $exp->getHTML();
1030  }
1031  }
Internal Link: Repository Item Selector Explorer.
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:93
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFilterWhiteList()

ilInternalLinkGUI::setFilterWhiteList (   $a_white_list)

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

Returns
boolean white list

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

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

◆ setMedPoolFolder()

ilInternalLinkGUI::setMedPoolFolder ( )

select media pool folder

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

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

850  {
851  $_SESSION["il_link_mep_obj"] = $_GET["mep_fold"];
852  $this->showLinkHelp();
853  }
$_SESSION["AccountId"]
$_GET["client_id"]
showLinkHelp()
Show link help list.
+ Here is the call graph for this function:

◆ setMode()

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

Set mode.

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

Referenced by ilPageEditorGUI\executeCommand().

110  {
111  $this->mode = $a_mode;
112  }
+ Here is the caller graph for this function:

◆ setReturn()

ilInternalLinkGUI::setReturn (   $a_return)

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

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

◆ setSetLinkTargetScript()

ilInternalLinkGUI::setSetLinkTargetScript (   $a_script)

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

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

◆ showLinkHelp()

ilInternalLinkGUI::showLinkHelp ( )

Show link help list.

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

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

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

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

Field Documentation

◆ $ctrl

ilInternalLinkGUI::$ctrl

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

◆ $default_obj

ilInternalLinkGUI::$default_obj

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

Referenced by showLinkHelp().

◆ $default_type

ilInternalLinkGUI::$default_type

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

Referenced by determineLinkType().

◆ $link_target

ilInternalLinkGUI::$link_target

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

◆ $link_type

ilInternalLinkGUI::$link_type

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

◆ $lng

ilInternalLinkGUI::$lng

◆ $ltypes

ilInternalLinkGUI::$ltypes = array()

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

Referenced by showLinkHelp().

◆ $mode

ilInternalLinkGUI::$mode

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

◆ $set_link_script

ilInternalLinkGUI::$set_link_script

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

Referenced by getSetLinkTargetScript().

◆ $tree

ilInternalLinkGUI::$tree

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

Referenced by __construct().


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