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
00024 require_once("classes/class.ilExplorer.php");
00025
00034 class ilLMMenuObjectSelector extends ilExplorer
00035 {
00036
00042 var $root_id;
00043 var $output;
00044 var $ctrl;
00045 var $selectable_type;
00046 var $ref_id;
00047
00054 function ilLMMenuObjectSelector($a_target,&$a_gui_obj)
00055 {
00056 global $tree,$ilCtrl;
00057
00058 $this->ctrl = $ilCtrl;
00059
00060 $this->gui_obj = $a_gui_obj;
00061
00062 parent::ilExplorer($a_target);
00063 $this->tree = $tree;
00064 $this->root_id = $this->tree->readRootId();
00065 $this->order_column = "title";
00066 $this->setSessionExpandVariable("lm_menu_expand");
00067 $this->addFilter("rolf");
00068 $this->addFilter("adm");
00069 }
00070
00071 function setSelectableTypes($a_types)
00072 {
00073 $this->selectable_types = $a_types;
00074 }
00075
00076 function setRefId($a_ref_id)
00077 {
00078 $this->ref_id = $a_ref_id;
00079 }
00080
00081
00082 function buildLinkTarget($a_node_id, $a_type)
00083 {
00084 if(in_array($a_type,$this->selectable_types))
00085 {
00086 $this->ctrl->setParameter($this->gui_obj,'link_ref_id',$a_node_id);
00087 return $this->ctrl->getLinkTarget($this->gui_obj,'addMenuEntry');
00088 }
00089 }
00090
00091 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
00092 {
00093 return '';
00094 }
00095
00096 function isClickable($a_type, $a_ref_id)
00097 {
00098 return in_array($a_type,$this->selectable_types) and $a_ref_id != $this->ref_id;
00099 }
00100
00101 function showChilds($a_ref_id)
00102 {
00103 global $rbacsystem;
00104
00105 if ($a_ref_id == 0)
00106 {
00107 return true;
00108 }
00109
00110 if ($rbacsystem->checkAccess("read", $a_ref_id))
00111 {
00112 return true;
00113 }
00114 else
00115 {
00116 return false;
00117 }
00118 }
00119
00120
00128 function formatHeader($a_obj_id,$a_option)
00129 {
00130 global $lng, $ilias;
00131
00132 $tpl = new ilTemplate("tpl.tree.html", true, true);
00133
00134 $tpl->setCurrentBlock("text");
00135 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
00136 $tpl->parseCurrentBlock();
00137
00138 $tpl->setCurrentBlock("row");
00139 $tpl->parseCurrentBlock();
00140
00141 $this->output[] = $tpl->get();
00142 }
00143 }
00144 ?>