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

ilinc/classes/class.ilObjiLincCourseGUI.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 
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                 /*if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
00065                 {
00066                         $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
00067                 }
00068                 else*/
00069                 {
00070                         // fill in saved values in case of error
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                 // create and insert forum in objecttree
00120                 $iCrsObj = parent::saveObject();
00121                 
00122                 $iCrsObj->saveID($response->getFirstID());
00123 
00124                 // always send a message
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                 // tabs are defined manually here. The autogeneration via objects.xml will be deprecated in future
00138                 // for usage examples see ilObjGroupGUI or ilObjSystemFolderGUI
00139         }
00140 } // END class.ilObjiLincCourseGUI
00141 ?>

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