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 ilObjectSelector 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 ilObjectSelector($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("paya_link_expand");
00067
00068
00069 #$this->addFilter("root");
00070 #$this->addFilter("cat");
00071
00072 #$this->setFilterMode(IL_FM_NEGATIVE);
00073 $this->setFiltered(false);
00074 }
00075
00076 function buildLinkTarget($a_node_id, $a_type)
00077 {
00078 if($a_type == $this->selectable_type)
00079 {
00080 $this->ctrl->setParameterByClass('ilpaymentobjectgui','source_id',$a_node_id);
00081 return $this->ctrl->getLinkTargetByClass('ilpaymentobjectgui','linkChilds');
00082 }
00083 else
00084 {
00085 $this->ctrl->setParameterByClass('ilrepositorygui',"ref_id",$this->ref_id);
00086 return $this->ctrl->getLinkTargetByClass('ilrepositorygui','linkSelector');
00087 }
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 $a_type == $this->selectable_type 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 }
00145 ?>