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 ilSearchResultExplorer extends ilExplorer
00036 {
00037
00043 var $root_id;
00044 var $user_id;
00045 var $output;
00046
00053 function ilSearchResultExplorer($a_target,$a_user_id)
00054 {
00055 define("TABLE_SEARCH_DATA","search_data");
00056 define("TABLE_SEARCH_TREE","search_tree");
00057
00058 parent::ilExplorer($a_target);
00059
00060 $this->user_id = $a_user_id;
00061
00062 $this->__setRootId();
00063 $this->tree = new ilTree($this->getUserId(),ROOT_ID);
00064 $this->tree->setTableNames(TABLE_SEARCH_TREE,TABLE_SEARCH_DATA);
00065
00066 $this->root_id = ROOT_ID;
00067 $this->order_column = "title";
00068 $this->setSessionExpandVariable("sea_expand");
00069
00070 $this->setFilterMode(IL_FM_POSITIV);
00071 $this->addFilter("seaf");
00072 #$this->addFilter("sea");
00073 $this->setFiltered(true);
00074
00075 }
00076
00077 function getUserId()
00078 {
00079 return $this->user_id;
00080 }
00081
00082 function buildLinkTarget($a_node_id, $a_type)
00083 {
00084 switch($a_type)
00085 {
00086 case "seaf":
00087 return "search_administration.php?viewmode=flat&folder_id=".$a_node_id;
00088 }
00089 }
00090
00091 function buildFrameTarget($a_type)
00092 {
00093 switch($a_type)
00094 {
00095 case "seaf":
00096
00097 return "";
00098 }
00099 }
00100
00101 function isClickable($a_type, $a_ref_id)
00102 {
00103 global $rbacsystem;
00104
00105 return true;
00106 switch ($a_type)
00107 {
00108
00109
00110 case "grp":
00111 return true;
00112 break;
00113
00114
00115 default:
00116 if ($rbacsystem->checkAccess("read", $a_ref_id))
00117 {
00118 return true;
00119 }
00120 else
00121 {
00122 return false;
00123 }
00124 break;
00125 }
00126 }
00127
00128 function showChilds($a_ref_id)
00129 {
00130 global $rbacsystem;
00131
00132 return true;
00133
00134 if ($a_ref_id == 0)
00135 {
00136 return true;
00137 }
00138
00139 if ($rbacsystem->checkAccess("read", $a_ref_id))
00140 {
00141 return true;
00142 }
00143 else
00144 {
00145 return false;
00146 }
00147 }
00148
00149
00157 function formatHeader($a_obj_id,$a_option)
00158 {
00159 global $lng, $ilias;
00160
00161 $tpl = new ilTemplate("tpl.tree.html", true, true);
00162
00163 $lng->loadLanguageModule("search");
00164
00165 $tpl->setCurrentBlock("link");
00166 $tpl->setVariable("TITLE", $lng->txt("search_my_search_results"));
00167 $tpl->setVariable("LINK_TARGET", "search_administration.php");
00168 $tpl->parseCurrentBlock();
00169
00170 $tpl->setCurrentBlock("row");
00171 $tpl->parseCurrentBlock();
00172
00173 $this->output[] = $tpl->get();
00174 }
00175
00176 function __setRootId()
00177 {
00178 $query = "SELECT * FROM search_tree ".
00179 "WHERE tree = '".$this->user_id."' ".
00180 "AND parent = '0'";
00181
00182 $res = $this->ilias->db->query($query);
00183 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00184 {
00185 define(ROOT_ID,$row->child);
00186 }
00187 return true;
00188 }
00189
00190 }
00191 ?>