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