Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00033 include_once("classes/class.ilExplorer.php");
00034
00035 class ilIntLinkRepItemExplorer extends ilExplorer
00036 {
00037 var $mode = "text";
00038
00045 function ilLMMenuObjectSelector($a_target)
00046 {
00047 global $tree,$ilCtrl;
00048
00049 $this->ctrl =& $ilCtrl;
00050 parent::ilExplorer($a_target);
00051 }
00052
00053 function setSelectableTypes($a_types)
00054 {
00055 $this->selectable_types = $a_types;
00056 }
00057
00058 function setMode($a_mode)
00059 {
00060 $this->mode = $a_mode;
00061 }
00062
00063 function setSetLinkTargetScript($a_script)
00064 {
00065 $this->link_target_script = $a_script;
00066 }
00067
00068 function setRefId($a_ref_id)
00069 {
00070 $this->ref_id = $a_ref_id;
00071 }
00072
00073 function buildLinkTarget($a_node_id, $a_type)
00074 {
00075 if ($this->mode != "link")
00076 {
00077 return "#";
00078 }
00079 else
00080 {
00081
00082 $link =
00083 ilUtil::appendUrlParameterString($this->link_target_script,
00084 "linktype=RepositoryItem".
00085 "&linktarget=il__".$a_type."_".$a_node_id);
00086
00087 return ($link);
00088 }
00089 }
00090
00091
00092 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
00093 {
00094 if ($this->mode == "link")
00095 {
00096 return "content";
00097 }
00098 else
00099 {
00100 return '';
00101 }
00102 }
00103
00107 function isClickable($a_type, $a_ref_id)
00108 {
00109 global $ilUser;
00110
00111 if ($ilUser->getPref("ilPageEditor_JavaScript") != "enable"
00112 && $this->mode != "link")
00113 {
00114 return false;
00115 }
00116 else
00117 {
00118 return in_array($a_type,$this->selectable_types);
00119 }
00120 }
00121
00122
00126 function buildTitle($a_title, $a_id, $a_type)
00127 {
00128 return $a_title;
00129 }
00130
00134 function buildDescription($a_desc, $a_id, $a_type)
00135 {
00136 global $ilUser;
00137
00138 if ($ilUser->getPref("ilPageEditor_JavaScript") != "enable")
00139 {
00140 if (in_array($a_type,$this->selectable_types))
00141 {
00142 if ($this->mode != "link")
00143 {
00144 return "[iln ".$a_type."=\"$a_id\"] [/iln]";
00145 }
00146 }
00147 }
00148 return "";
00149 }
00150
00154 function buildOnClick($a_node_id, $a_type, $a_title)
00155 {
00156 return "opener.addInternalLink('[iln ".$a_type."="".$a_node_id.""] [/iln]','".$a_title."');setTimeout('window.close()',300);return(false);";
00157 }
00158
00159
00160
00161 function showChilds($a_ref_id)
00162 {
00163 global $rbacsystem;
00164
00165 if ($a_ref_id == 0)
00166 {
00167 return true;
00168 }
00169
00170 if ($rbacsystem->checkAccess("read", $a_ref_id))
00171 {
00172 return true;
00173 }
00174 else
00175 {
00176 return false;
00177 }
00178 }
00179
00180
00188 function formatHeader(&$tpl, $a_obj_id,$a_option)
00189 {
00190 global $lng, $ilias;
00191
00192 $tpl->setCurrentBlock("icon");
00193 $tpl->setVariable("ICON_IMAGE" , ilUtil::getImagePath("icon_root.gif"));
00194 $tpl->setVariable("TXT_ALT_IMG", $lng->txt("repository"));
00195 $tpl->parseCurrentBlock();
00196
00197 $tpl->setCurrentBlock("text");
00198 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
00199 $tpl->parseCurrentBlock();
00200
00201
00202
00203
00204 $tpl->touchBlock("element");
00205
00206 }
00207 }
00208 ?>