• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

adm_object.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 
00036 require_once "include/inc.header.php";
00037 
00038 // for security
00039 unset($id);
00040 
00041 $ilCtrl->setTargetScript("adm_object.php");
00042 
00043 //determine call mode for object classes
00044 //TODO: don't use same var $id for both
00045 if ($_GET["obj_id"] != "")
00046 {
00047         $call_by_reference = false;
00048         $id = $_GET["obj_id"];
00049 }
00050 else
00051 {
00052         $call_by_reference = true;
00053         $id = $_GET["ref_id"];
00054 }
00055 
00056 // exit if no valid ID was given
00057 if (!isset($_GET["ref_id"]))
00058 {
00059         $ilias->raiseError("No valid ID given! Action aborted",$this->ilias->error_obj->MESSAGE);
00060 }
00061 
00062 if (!isset($_GET["type"]))
00063 {
00064         if ($call_by_reference)
00065         {
00066                 $obj = $ilias->obj_factory->getInstanceByRefId($_GET["ref_id"]);
00067         }
00068         else
00069         {
00070                 $obj = $ilias->obj_factory->getInstanceByObjId($_GET["obj_id"]);
00071         }
00072 
00073         $_GET["type"] = $obj->getType();
00074 }
00075 
00076 // determine command
00077 if ($_GET["cmd"] == "gateway" or $_GET["cmd"] == "post")
00078 {
00079         // surpress warning if POST is not set
00080         @$cmd = key($_POST["cmd"]);
00081 }
00082 else
00083 {
00084         $cmd = $_GET["cmd"];
00085 }
00086 
00087 if (empty($cmd)) // if no cmd is given default to first property
00088 {
00089         $cmd = $_GET["cmd"] = $objDefinition->getFirstProperty($_GET["type"]);
00090 }
00091 
00092 if ($_GET["cmd"] == "post")
00093 {
00094         $cmd = key($_POST["cmd"]);
00095         unset($_GET["cmd"]);
00096 }
00097 
00098 // determine object type
00099 if ($_POST["new_type"] && (($cmd == "create") || ($cmd == "import") || ($cmd == "save")))
00100 {
00101         $obj_type = $_POST["new_type"];
00102 }
00103 elseif ($_GET["new_type"])
00104 {
00105         $obj_type = $_GET["new_type"];
00106 }
00107 else
00108 {
00109         $obj_type = $_GET["type"];
00110 }
00111 
00112 // call gui object method
00113 $method = $cmd."Object";
00114 $class_name = $objDefinition->getClassName($obj_type);
00115 $module = $objDefinition->getModule($obj_type);
00116 $module_dir = ($module == "")
00117         ? ""
00118         : $module."/";
00119 
00120 $class_constr = "ilObj".$class_name."GUI";
00121 require_once("./".$module_dir."classes/class.ilObj".$class_name."GUI.php");
00122 $ilCtrl->getCallStructure(strtolower("ilObj".$class_name."GUI"));
00123 //echo $class_constr.":".$method;
00124 $obj = new $class_constr($data, $id, $call_by_reference);
00125 $obj->$method();
00126 $tpl->show();
00127 ?>

Generated on Fri Dec 13 2013 09:06:31 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1