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

survey/survey.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 
00033 /*define("ILIAS_MODULE", "survey");
00034 chdir("..");
00035 require_once "./include/inc.header.php";
00036 
00037 // for security
00038 unset($id);
00039 
00040 //determine call mode for object classes
00041 //TODO: don't use same var $id for both
00042 if (isset($_GET["obj_id"]))
00043 {
00044         $call_by_reference = false;
00045         $id = $_GET["obj_id"];
00046 }
00047 else
00048 {
00049         $call_by_reference = true;
00050         $id = $_GET["ref_id"];
00051 }
00052 
00053 // exit if no valid ID was given
00054 if (!isset($_GET["ref_id"]))
00055 {
00056         $ilias->raiseError("No valid ID given! Action aborted", $this->ilias->error_obj->MESSAGE);
00057 }
00058 if (!isset($_GET["type"]))
00059 {
00060         if ($call_by_reference)
00061         {
00062                 $obj = $ilias->obj_factory->getInstanceByRefId($_GET["ref_id"]);
00063         }
00064         else
00065         {
00066                 $obj = $ilias->obj_factory->getInstanceByObjId($_GET["obj_id"]);
00067         }
00068 
00069         $_GET["type"] = $obj->getType();
00070 }
00071 
00072 // determine command
00073 if (($cmd = $_GET["cmd"]) == "gateway")
00074 {
00075         // surpress warning if POST is not set
00076         @$cmd = key($_POST["cmd"]);
00077 
00078 }
00079 
00080 if (empty($cmd)) // if no cmd is given default to first property
00081 {
00082         $cmd = $_GET["cmd"] = $objDefinition->getFirstProperty($_GET["type"]);
00083 }
00084 
00085 if ($_GET["cmd"] == "post")
00086 {
00087         $cmd = key($_POST["cmd"]);
00088         unset($_GET["cmd"]);
00089 }
00090 
00091 // determine object type
00092 if ($_POST["new_type"] && (($cmd == "create") || ($cmd == "import")))
00093 {
00094         $obj_type = $_POST["new_type"];
00095 }
00096 elseif ($_GET["new_type"])
00097 {
00098         $obj_type = $_GET["new_type"];
00099 }
00100 else
00101 {
00102         $obj_type = $_GET["type"];
00103 }
00104 // call gui object method
00105 $method = $cmd."Object";
00106 $class_name = $objDefinition->getClassName($obj_type);
00107 $module = $objDefinition->getModule($obj_type);
00108 $module_dir = ($module == "")
00109         ? ""
00110         : $module."/";
00111 
00112 $class_constr = "ilObj".$class_name."GUI";
00113 require_once("./".$module_dir."classes/class.ilObj".$class_name."GUI.php");
00114 switch ($_GET["cmd"]) 
00115 {
00116         case "run":
00117         case "evaluation":
00118         case "evaluationdetails":
00119         case "evaluationuser":
00120                 $prepare_output = false;
00121                 break;
00122         default:
00123                 $prepare_output = true;
00124                 break;
00125 }
00126 $obj = new $class_constr($data, $id, $call_by_reference, $prepare_output);
00127 $obj->$method();
00128 $tpl->show();*/
00129 define("ILIAS_MODULE", "survey");
00130 chdir("..");
00131 require_once "./include/inc.header.php";
00132 require_once "./survey/classes/class.ilObjSurveyGUI.php";
00133 
00134 unset($id);
00135 
00136 //determine call mode for object classes
00137 //TODO: don't use same var $id for both
00138 if ($_GET["obj_id"] > 0)
00139 {
00140         $call_by_reference = false;
00141         $id = $_GET["obj_id"];
00142 }
00143 else
00144 {
00145         $call_by_reference = true;
00146         $id = $_GET["ref_id"];
00147 }
00148 
00149 // exit if no valid ID was given
00150 if (!isset($_GET["ref_id"]))
00151 {
00152         $ilias->raiseError("No valid ID given! Action aborted", $this->ilias->error_obj->MESSAGE);
00153 }
00154 
00155 switch ($_GET["cmd"]) 
00156 {
00157         case "run":
00158                 $prepare_output = false;
00159                 break;
00160         default:
00161                 $prepare_output = true;
00162                 break;
00163 }
00164 $ilCtrl->setTargetScript("survey.php");
00165 $ilCtrl->getCallStructure("ilobjsurveygui");
00166 $qp_gui =& new ilObjSurveyGUI("", $_GET["ref_id"], true, $prepare_output);
00167 $ilCtrl->forwardCommand($qp_gui);
00168 
00169 $tpl->show();
00170 ?>

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