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 ilAdministrationExplorer extends ilExplorer
00036 {
00037
00043 var $root_id;
00044 var $output;
00045 var $ctrl;
00052 function ilAdministrationExplorer($a_target)
00053 {
00054 global $tree,$ilCtrl;
00055
00056 $this->ctrl = $ilCtrl;
00057
00058 parent::ilExplorer($a_target);
00059 $this->tree = $tree;
00060 $this->root_id = $this->tree->readRootId();
00061 $this->order_column = "title";
00062 $this->setSessionExpandVariable("expand");
00063
00064 }
00065
00073 function formatHeader(&$tpl, $a_obj_id,$a_option)
00074 {
00075 global $lng, $ilias, $objDefinition;
00076
00077 if ($_GET["admin_mode"] == "settings")
00078 {
00079 return;
00080 }
00081
00082 $tpl->setCurrentBlock("icon");
00083 $tpl->setVariable("ICON_IMAGE" , ilUtil::getImagePath("icon_root.gif"));
00084 $tpl->setVariable("TXT_ALT_IMG", $lng->txt("repository"));
00085 $tpl->parseCurrentBlock();
00086
00087 $class_name = $objDefinition->getClassName("root");
00088 $class = strtolower("ilObj".$class_name."GUI");
00089 $this->ctrl->setParameterByClass($class, "ref_id", ROOT_FOLDER_ID);
00090 $link = $this->ctrl->getLinkTargetByClass($class, "view");
00091
00092 $tpl->setCurrentBlock("link");
00093 $tpl->setVariable("TITLE", $lng->txt("repository"));
00094 $tpl->setVariable("LINK_TARGET", $link);
00095 $tpl->setVariable("TARGET", " target=\"content\"");
00096 $tpl->parseCurrentBlock();
00097
00098 $tpl->setCurrentBlock("element");
00099 $tpl->parseCurrentBlock();
00100
00101 }
00102
00106 function buildLinkTarget($a_node_id, $a_type)
00107 {
00108 global $ilCtrl, $objDefinition;
00109
00110 if ($_GET["admin_mode"] == "settings" && $a_node_id == ROOT_FOLDER_ID)
00111 {
00112 $this->ctrl->setParameterByClass("iladministrationgui", "ref_id", ROOT_FOLDER_ID);
00113 $this->ctrl->setParameterByClass("iladministrationgui", "admin_mode", "repository");
00114 $link = $this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset");
00115 $this->ctrl->setParameterByClass("iladministrationgui", "admin_mode", "settings");
00116 }
00117 else
00118 {
00119 $class_name = $objDefinition->getClassName($a_type);
00120 $class = strtolower("ilObj".$class_name."GUI");
00121 $this->ctrl->setParameterByClass($class, "ref_id", $a_node_id);
00122 $link = $this->ctrl->getLinkTargetByClass($class, "view");
00123 }
00124 return $link;
00125 }
00126
00130 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
00131 {
00132 if ($_GET["admin_mode"] == "settings" && $a_child == ROOT_FOLDER_ID)
00133 {
00134 return ilFrameTargetInfo::_getFrame("MainContent");
00135 }
00136 else
00137 {
00138 return $this->frame_target;
00139 }
00140 }
00141
00142
00146 function getImage($a_name, $a_type = "", $a_obj_id = "")
00147 {
00148 if ($a_type != "")
00149 {
00150
00151 if ($this->ilias->getSetting("custom_icons") &&
00152 in_array($a_type, array("cat","grp","crs")))
00153 {
00154 require_once("classes/class.ilContainer.php");
00155 if (($path = ilContainer::_lookupIconPath($a_obj_id, "small")) != "")
00156 {
00157 return $path;
00158 }
00159 }
00160 }
00161
00162 return parent::getImage($a_name);
00163 }
00164
00165 function isVisible($a_ref_id,$a_type)
00166 {
00167 global $rbacsystem, $ilBench;
00168
00169 $ilBench->start("Explorer", "setOutput_isVisible");
00170 $visible = $rbacsystem->checkAccess('visible',$a_ref_id);
00171 if ($a_type == "rolf" && $a_ref_id != ROLE_FOLDER_ID)
00172 {
00173 return false;
00174 }
00175 $ilBench->stop("Explorer", "setOutput_isVisible");
00176
00177 return $visible;
00178 }
00179
00183 function modifyChilds($a_parent_id, $a_objects)
00184 {
00185 global $lng;
00186
00187 if ($a_parent_id == SYSTEM_FOLDER_ID)
00188 {
00189 $new_objects = array();
00190 foreach($a_objects as $object)
00191 {
00192 $new_objects[$object["title"].":".$object["child"]]
00193 = $object;
00194 }
00195
00196
00197
00198 $new_objects[$lng->txt("repository_admin").":".ROOT_FOLDER_ID] =
00199 array(
00200 "tree" => 1,
00201 "child" => ROOT_FOLDER_ID,
00202 "ref_id" => ROOT_FOLDER_ID,
00203 "depth" => 3,
00204 "type" => "root",
00205 "title" => $lng->txt("repository_admin"),
00206 "description" => $lng->txt("repository_admin_desc"),
00207 "desc" => $lng->txt("repository_admin_desc"),
00208 );
00209 ksort($new_objects);
00210
00211 return $new_objects;
00212 }
00213
00214 return $a_objects;
00215 }
00216
00217 function showChilds($a_parent_id, $a_obj_id)
00218 {
00219
00220
00221
00222 if ($a_parent_id == ROOT_FOLDER_ID)
00223 {
00224 if ($this->rootfolder_shown == true)
00225 {
00226 return false;
00227 }
00228 $this->rootfolder_shown = true;
00229 }
00230
00231 return true;
00232 }
00233
00237 function forceExpanded($a_obj_id)
00238 {
00239 if ($a_obj_id == SYSTEM_FOLDER_ID)
00240 {
00241 return true;
00242 }
00243 else
00244 {
00245 return false;
00246 }
00247 }
00248
00249
00250 }
00251 ?>