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
00025
00026
00027
00028
00029
00030
00031
00032
00033 include_once("./classes/class.ilExplorer.php");
00034
00035 class ilMaterialExplorer extends ilExplorer
00036 {
00037
00043 var $root_id;
00044 var $output;
00045 var $ctrl;
00046
00047 var $selectable_type;
00048 var $ref_id;
00049 var $target_class;
00050
00056 function ilMaterialExplorer($a_target, $a_target_class)
00057 {
00058 global $tree,$ilCtrl;
00059
00060 $this->ctrl = $ilCtrl;
00061 $this->target_class = $a_target_class;
00062 parent::ilExplorer($a_target);
00063 $this->tree = $tree;
00064 $this->root_id = $this->tree->readRootId();
00065 $this->order_column = "title";
00066
00067 $this->setSessionExpandVariable("expand");
00068
00069
00070 $this->addFilter("root");
00071 $this->addFilter("cat");
00072 $this->addFilter("grp");
00073 $this->addFilter("fold");
00074 $this->addFilter("crs");
00075
00076 $this->setFilterMode(IL_FM_POSITIVE);
00077 $this->setFiltered(true);
00078 }
00079
00080 function setSelectableType($a_type)
00081 {
00082 $this->selectable_type = $a_type;
00083 }
00084 function setRefId($a_ref_id)
00085 {
00086 $this->ref_id = $a_ref_id;
00087 }
00088
00089
00090 function buildLinkTarget($a_node_id, $a_type)
00091 {
00092 if($a_type == $this->selectable_type)
00093 {
00094 $this->ctrl->setParameterByClass($this->target_class,'source_id',$a_node_id);
00095 return $this->ctrl->getLinkTargetByClass($this->target_class,'linkChilds');
00096 }
00097 else
00098 {
00099 $this->ctrl->setParameterByClass($this->target_class,"ref_id",$this->ref_id);
00100 return $this->ctrl->getLinkTargetByClass($this->target_class,'addSolutionHint');
00101 }
00102
00103 }
00104
00105 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
00106 {
00107 return '';
00108 }
00109
00110 function isClickable($a_type, $a_ref_id)
00111 {
00112 return $a_type == $this->selectable_type and $a_ref_id != $this->ref_id;
00113 }
00114
00115 function showChilds($a_ref_id)
00116 {
00117 global $rbacsystem;
00118
00119 if ($a_ref_id == 0)
00120 {
00121 return true;
00122 }
00123
00124 if ($rbacsystem->checkAccess("read", $a_ref_id))
00125 {
00126 return true;
00127 }
00128 else
00129 {
00130 return false;
00131 }
00132 }
00133
00134
00142 function formatHeader($a_obj_id,$a_option)
00143 {
00144 global $lng, $ilias;
00145
00146 include_once "./classes/class.ilTemplate.php";
00147 $tpl = new ilTemplate("tpl.tree.html", true, true);
00148
00149 $tpl->setCurrentBlock("text");
00150 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
00151 $tpl->parseCurrentBlock();
00152
00153 $tpl->setCurrentBlock("row");
00154 $tpl->parseCurrentBlock();
00155
00156 $this->output[] = $tpl->get();
00157 }
00158
00159 }
00160 ?>