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 ilConditionSelector 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 ilConditionSelector($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("condition_selector_expand");
00067
00068
00069 $this->addFilter("root");
00070 $this->addFilter("cat");
00071 $this->addFilter("grp");
00072 $this->addFilter("fold");
00073 $this->addFilter("crs");
00074 $this->addFilter("exc");
00075 $this->addFilter("tst");
00076
00077 $this->setFilterMode(IL_FM_POSITIVE);
00078 $this->setFiltered(true);
00079 }
00080
00081 function setControlClass(&$class)
00082 {
00083 $this->control_class =& $class;
00084 }
00085 function &getControlClass()
00086 {
00087 return $this->control_class;
00088 }
00089
00090 function setSelectableTypes($a_type)
00091 {
00092 $this->selectable_types = $a_type;
00093 }
00094 function setRefId($a_ref_id)
00095 {
00096 $this->ref_id = $a_ref_id;
00097 }
00098
00099
00100 function buildLinkTarget($a_node_id, $a_type)
00101 {
00102 if(in_array($a_type,$this->selectable_types))
00103 {
00104 #$this->ctrl->setParameterByClass('ilrepositorygui','source_id',$a_node_id);
00105 $this->ctrl->setParameter($this->getControlClass(),'source_id',$a_node_id);
00106
00107 return $this->ctrl->getLinkTarget($this->getControlClass(),'add');
00108 }
00109 else
00110 {
00111 $this->ctrl->setParameterByClass('ilrepositorygui',"ref_id",$this->ref_id);
00112 return $this->ctrl->getLinkTargetByClass('ilrepositorygui','copySelector');
00113 }
00114
00115 }
00116
00117 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
00118 {
00119 return '';
00120 }
00121
00122 function isClickable($a_type, $a_ref_id)
00123 {
00124 return in_array($a_type,$this->selectable_types) and $a_ref_id != $this->ref_id;
00125 }
00126
00127 function showChilds($a_ref_id)
00128 {
00129 global $rbacsystem;
00130
00131 if ($a_ref_id == 0)
00132 {
00133 return true;
00134 }
00135
00136 if ($rbacsystem->checkAccess("read", $a_ref_id))
00137 {
00138 return true;
00139 }
00140 else
00141 {
00142 return false;
00143 }
00144 }
00145
00146
00154 function formatHeader($a_obj_id,$a_option)
00155 {
00156 global $lng, $ilias;
00157
00158 $tpl = new ilTemplate("tpl.tree.html", true, true);
00159
00160 $tpl->setCurrentBlock("text");
00161 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
00162 $tpl->parseCurrentBlock();
00163
00164 $tpl->setCurrentBlock("row");
00165 $tpl->parseCurrentBlock();
00166
00167 $this->output[] = $tpl->get();
00168 }
00169
00170 }
00171 ?>