Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00037 require_once "./classes/class.ilObjectGUI.php";
00038
00039 class ilObjiLincCourseGUI extends ilObjectGUI
00040 {
00045 function ilObjiLincCourseGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output = true)
00046 {
00047 $this->type = "icrs";
00048 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
00049
00050 $this->ctrl->saveParameter($this,'ref_id');
00051 }
00052
00058 function createObject()
00059 {
00060 global $rbacsystem;
00061
00062 $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
00063
00064
00065
00066
00067
00068
00069 {
00070
00071 $data = array();
00072 $data["fields"] = array();
00073 $data["fields"]["title"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"],true);
00074 $data["fields"]["desc"] = ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]);
00075 $data["fields"]["homepage"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["homepage"],true);
00076 $data["fields"]["download"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["download"],true);
00077
00078 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.icrs_edit.html","ilinc");
00079
00080 $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
00081 $this->tpl->setVariable("TITLE", $data["fields"]["title"]);
00082 $this->tpl->setVariable("TXT_DESC", $this->lng->txt("desc"));
00083 $this->tpl->setVariable("DESC", $data["fields"]["desc"]);
00084 $this->tpl->setVariable("TXT_HOMEPAGE_URL", $this->lng->txt("homepage_url"));
00085 $this->tpl->setVariable("HOMEPAGE_URL", $data["fields"]["homepage"]);
00086 $this->tpl->setVariable("TXT_DOWNLOAD_RESOURCES_URL", $this->lng->txt("download_resources_url"));
00087 $this->tpl->setVariable("DOWNLOAD_RESOURCES_URL", $data["fields"]["download"]);
00088 $this->tpl->setVariable("TXT_NOT_YET", $this->lng->txt("not_implemented_yet"));
00089
00090 $this->tpl->setVariable("FORMACTION", $this->getFormAction("save","adm_object.php?cmd=gateway&ref_id=".
00091 $_GET["ref_id"]."&new_type=".$new_type));
00092 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt($new_type."_new"));
00093 $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
00094 $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt($new_type."_add"));
00095 $this->tpl->setVariable("CMD_SUBMIT", "save");
00096 $this->tpl->setVariable("TARGET", $this->getTargetFrame("save"));
00097 $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
00098 }
00099 }
00100
00105 function saveObject()
00106 {
00107 global $rbacadmin;
00108
00109 include_once "class.ilnetucateXMLAPI.php";
00110 $ilinc = new ilnetucateXMLAPI();
00111 $ilinc->addCourse($_POST["Fobject"]);
00112 $response = $ilinc->sendRequest();
00113
00114 if ($response->isError())
00115 {
00116 $this->ilErr->raiseError($response->getErrorMsg(),$this->ilErr->MESSAGE);
00117 }
00118
00119
00120 $iCrsObj = parent::saveObject();
00121
00122 $iCrsObj->saveID($response->getFirstID());
00123
00124
00125 sendInfo($response->getResultMsg(),true);
00126
00127 ilUtil::redirect($this->getReturnLocation("save",$this->ctrl->getLinkTarget($this,"")));
00128 }
00129
00135 function getTabs(&$tabs_gui)
00136 {
00137
00138
00139 }
00140 }
00141 ?>