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 ilRepositoryCopySelector 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 ilRepositoryCopySelector($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_copy_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','copyChilds');
00095 }
00096 else
00097 {
00098 $this->ctrl->setParameterByClass('ilrepositorygui',"ref_id",$this->ref_id);
00099 return $this->ctrl->getLinkTargetByClass('ilrepositorygui','copySelector');
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 return $a_type == $this->selectable_type and $a_ref_id != $this->ref_id;
00112 }
00113
00114 function showChilds($a_ref_id)
00115 {
00116 global $rbacsystem;
00117
00118 if ($a_ref_id == 0)
00119 {
00120 return true;
00121 }
00122
00123 if ($rbacsystem->checkAccess("read", $a_ref_id))
00124 {
00125 return true;
00126 }
00127 else
00128 {
00129 return false;
00130 }
00131 }
00132
00133
00141 function formatHeader($a_obj_id,$a_option)
00142 {
00143 global $lng, $ilias;
00144
00145 $tpl = new ilTemplate("tpl.tree.html", true, true);
00146
00147 $tpl->setCurrentBlock("text");
00148 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
00149 $tpl->parseCurrentBlock();
00150
00151 $tpl->setCurrentBlock("row");
00152 $tpl->parseCurrentBlock();
00153
00154 $this->output[] = $tpl->get();
00155 }
00156
00157 }
00158 ?>