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 ilSearchRootSelector 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 ilSearchRootSelector($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("search_root_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->setFiltered(true);
00076 $this->setFilterMode(IL_FM_POSITIVE);
00077
00078 }
00079
00080 function setTargetClass($a_class)
00081 {
00082 $this->target_class = $a_class;
00083 }
00084 function getTargetClass()
00085 {
00086 return $this->target_class ? $this->target_class : 'ilsearchgui';
00087 }
00088 function setCmd($a_cmd)
00089 {
00090 $this->cmd = $a_cmd;
00091 }
00092 function getCmd()
00093 {
00094 return $this->cmd ? $this->cmd : 'selectRoot';
00095 }
00096
00097 function setSelectableType($a_type)
00098 {
00099 $this->selectable_type = $a_type;
00100 }
00101 function setRefId($a_ref_id)
00102 {
00103 $this->ref_id = $a_ref_id;
00104 }
00105
00106
00107 function buildLinkTarget($a_node_id, $a_type)
00108 {
00109 $this->ctrl->setParameterByClass($this->getTargetClass(),"root_id",$a_node_id);
00110
00111 return $this->ctrl->getLinkTargetByClass($this->getTargetClass(),$this->getCmd());
00112
00113 }
00114
00115 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
00116 {
00117 return '';
00118 }
00119
00120 function showChilds($a_ref_id)
00121 {
00122 global $rbacsystem;
00123
00124 if ($a_ref_id == 0)
00125 {
00126 return true;
00127 }
00128
00129 if ($rbacsystem->checkAccess("read", $a_ref_id))
00130 {
00131 return true;
00132 }
00133 else
00134 {
00135 return false;
00136 }
00137 }
00138
00139
00147 function formatHeader(&$tpl,$a_option)
00148 {
00149 global $lng, $ilias;
00150
00151 #$tpl = new ilTemplate("tpl.tree.html", true, true);
00152
00153 $tpl->setCurrentBlock("link");
00154 $tpl->setVariable("LINK_NAME",$lng->txt('repository'));
00155
00156 $this->ctrl->setParameterByClass($this->getTargetClass(),'root_id',ROOT_FOLDER_ID);
00157 $tpl->setVariable("LINK_TARGET",$this->ctrl->getLinkTargetByClass($this->getTargetClass(),$this->getCmd()));
00158 $tpl->setVariable("TITLE", $lng->txt("repository"));
00159
00160 $tpl->parseCurrentBlock();
00161 $tpl->setCurrentBlock("row");
00162 $tpl->parseCurrentBlock();
00163
00164 #$this->output[] = $tpl->get();
00165
00166 return true;
00167 }
00168
00169 }
00170 ?>