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