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 include_once("classes/class.ilTableGUI.php");
00025 include_once("classes/class.ilTabsGUI.php");
00026
00051 class ilAdministrationGUI
00052 {
00053 var $lng;
00054 var $ilias;
00055 var $tpl;
00056 var $tree;
00057 var $rbacsystem;
00058 var $cur_ref_id;
00059 var $cmd;
00060 var $mode;
00061 var $ctrl;
00062
00067 function ilAdministrationGUI()
00068 {
00069 global $lng, $ilias, $tpl, $tree, $rbacsystem, $objDefinition,
00070 $_GET, $ilCtrl, $ilLog, $ilMainMenu;
00071
00072 $this->lng =& $lng;
00073 $this->ilias =& $ilias;
00074 $this->tpl =& $tpl;
00075 $this->tree =& $tree;
00076 $this->rbacsystem =& $rbacsystem;
00077 $this->objDefinition =& $objDefinition;
00078
00079 $this->ctrl =& $ilCtrl;
00080 $ilMainMenu->setActive("administration");
00081
00082 $this->creation_mode = false;
00083
00084 $this->ctrl->saveParameter($this, array("ref_id", "admin_mode"));
00085
00086 if ($_GET["admin_mode"] != "repository")
00087 {
00088 $_GET["admin_mode"] = "settings";
00089 }
00090
00091 if (!ilUtil::isAPICall())
00092 $this->ctrl->setReturn($this,"");
00093
00094
00095 if (!empty($_GET["ref_id"]) && $tree->isInTree($_GET["ref_id"]))
00096 {
00097 $this->cur_ref_id = $_GET["ref_id"];
00098 }
00099 else
00100 {
00101
00102 $_POST = array();
00103 $_GET["cmd"] = "";
00104 }
00105 }
00106
00107
00111 function &executeCommand()
00112 {
00113 global $tree, $rbacsystem, $ilias, $lng;
00114
00115
00116 include_once './classes/class.ilMainMenuGUI.php';
00117 if(!ilMainMenuGUI::_checkAdministrationPermission())
00118 {
00119 $ilias->raiseError("You are not entitled to access this page!",$ilias->error_obj->WARNING);
00120 }
00121
00122
00123
00124 $new_type = $_POST["new_type"]
00125 ? $_POST["new_type"]
00126 : $_GET["new_type"];
00127 if ($new_type != "" && $this->ctrl->getCmd() == "create")
00128 {
00129 $this->creation_mode = true;
00130 }
00131
00132
00133 if ($this->creation_mode)
00134 {
00135 $obj_type = $new_type;
00136 $class_name = $this->objDefinition->getClassName($obj_type);
00137 $next_class = strtolower("ilObj".$class_name."GUI");
00138 $this->ctrl->setCmdClass($next_class);
00139 }
00140 else
00141 {
00142 $next_class = $this->ctrl->getNextClass($this);
00143 }
00144
00145 if (($next_class == "iladministrationgui" || $next_class == ""
00146 ) && ($this->ctrl->getCmd() == "return"))
00147 {
00148
00149
00150 $obj_type = ilObject::_lookupType($this->cur_ref_id,true);
00151 $class_name = $this->objDefinition->getClassName($obj_type);
00152 $next_class = strtolower("ilObj".$class_name."GUI");
00153 $this->ctrl->setCmdClass($next_class);
00154 $this->ctrl->setCmd("view");
00155 }
00156
00157 $cmd = $this->ctrl->getCmd("frameset");
00158
00159
00160 switch ($next_class)
00161 {
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198 default:
00199
00200
00201 if ($next_class != "" && $next_class != "iladministrationgui")
00202 {
00203 $class_path = $this->ctrl->lookupClassPath($next_class);
00204
00205
00206 include_once($class_path);
00207 $class_name = $this->ctrl->getClassForClasspath($class_path);
00208
00209 if (($next_class == "ilobjrolegui" || $next_class == "ilobjusergui"
00210 || $next_class == "ilobjroletemplategui"
00211 || $next_class == "ilobjstylesheetgui"))
00212 {
00213 if ($_GET["obj_id"] != "")
00214 {
00215 $this->gui_obj = new $class_name("", $_GET["obj_id"], false, false);
00216 $this->gui_obj->setCreationMode(false);
00217 }
00218 else
00219 {
00220 $this->gui_obj = new $class_name("", $this->cur_ref_id, true, false);
00221 $this->gui_obj->setCreationMode(true);
00222 }
00223 }
00224 else
00225 {
00226 $this->gui_obj = new $class_name("", $this->cur_ref_id, true, false);
00227 $this->gui_obj->setCreationMode($this->creation_mode);
00228 }
00229 $tabs_out = ($new_type == "")
00230 ? true
00231 : false;
00232
00233 $this->ctrl->setReturn($this, "return");
00234 $ret =& $this->ctrl->forwardCommand($this->gui_obj);
00235 $html = $this->gui_obj->getHTML();
00236 if ($html != "")
00237 {
00238 $this->tpl->setVariable("OBJECTS", $html);
00239 }
00240 $this->tpl->show();
00241 }
00242 else
00243 {
00244 $cmd = $this->ctrl->getCmd("frameset");
00245 $this->$cmd();
00246 }
00247 break;
00248 }
00249 }
00250
00254 function frameset()
00255 {
00256 global $tree;
00257
00258 include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
00259 $fs_gui = new ilFramesetGUI();
00260
00261 $fs_gui->setMainFrameName("content");
00262 $fs_gui->setSideFrameName("tree");
00263 $fs_gui->setFrameSetTitle($this->lng->txt("administration"));
00264
00265 if ($_GET["admin_mode"] != "repository")
00266 {
00267 $this->ctrl->setParameter($this, "ref_id", SYSTEM_FOLDER_ID);
00268 $this->ctrl->setParameterByClass("iladministrationgui", "admin_mode", "settings");
00269 $fs_gui->setMainFrameSource(
00270 $this->ctrl->getLinkTargetByClass("ilobjsystemfoldergui", "view"));
00271 $this->ctrl->setParameter($this, "expand", "1");
00272 $fs_gui->setSideFrameSource(
00273 $this->ctrl->getLinkTarget($this, "showTree"));
00274 }
00275 else
00276 {
00277 $this->ctrl->setParameter($this, "ref_id", ROOT_FOLDER_ID);
00278 $this->ctrl->setParameterByClass("iladministrationgui", "admin_mode", "repository");
00279 $fs_gui->setMainFrameSource(
00280 $this->ctrl->getLinkTargetByClass("ilobjrootfoldergui", "view"));
00281 $this->ctrl->setParameter($this, "expand", "1");
00282 $fs_gui->setSideFrameSource(
00283 $this->ctrl->getLinkTarget($this, "showTree"));
00284 }
00285 $fs_gui->show();
00286 exit;
00287 }
00288
00292 function showTree()
00293 {
00294 global $tpl, $tree, $lng;
00295
00296 require_once "classes/class.ilAdministrationExplorer.php";
00297
00298 $tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
00299 $tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.gif", false));
00300
00301 $explorer = new ilAdministrationExplorer("ilias.php?baseClass=ilAdministrationGUI&cmd=view");
00302 $explorer->setExpand($_GET["expand"]);
00303 $explorer->setExpandTarget($this->ctrl->getLinkTarget($this, "showTree"));
00304
00305
00306 if (!$tree->getChilds(RECOVERY_FOLDER_ID))
00307 {
00308 $explorer->addFilter("recf");
00309 }
00310
00311
00312 if ($_GET["admin_mode"] == "settings")
00313 {
00314 $explorer->addFilter("cat");
00315 }
00316 else
00317 {
00318 $explorer->addFilter("adm");
00319 }
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335 $explorer->setOutput(0);
00336 $output = $explorer->getOutput();
00337 $tpl->setCurrentBlock("content");
00338
00339 $tpl->setVariable("EXP_REFRESH", $lng->txt("refresh"));
00340 $tpl->setVariable("EXPLORER",$output);
00341 $this->ctrl->setParameter($this, "expand", $_GET["expand"]);
00342 $tpl->setVariable("ACTION", $this->ctrl->getLinkTarget($this, "showTree"));
00343 $tpl->parseCurrentBlock();
00344
00345 $tpl->show(false);
00346 }
00347
00348 }
00349
00350
00351 ?>