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

classes/class.ilObjExerciseGUIAdapter.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 
00035 require_once "class.ilObjectGUIAdapter.php";
00036 
00037 class ilObjExerciseGUIAdapter extends ilObjectGUIAdapter
00038 {
00043         function ilObjExerciseGUIAdapter($a_ref_id,$a_cmd = '')
00044         {
00045                 parent::ilObjectGUIAdapter($a_ref_id,true,false,$a_cmd);
00046                 $this->gui_obj->setTabTargetScript("exercise.php");
00047                 $this->__setReturnLocation();
00048                 $this->__setFormAction();
00049                 $this->__prepareOutput();
00050 
00051                 // FINALLY PERFORM ACTION
00052                 $this->performAction();
00053         }
00054 
00055         
00056         // PRIVATE METHODS
00057         function __prepareOutput()
00058         {
00059                 $this->tpl->addBlockFile("CONTENT", "content", "tpl.exercise.html");
00060                 $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
00061 
00062                 $title = $this->gui_obj->object->getTitle();
00063 
00064                 // catch feedback message
00065                 sendInfo();
00066 
00067                 if (!empty($title))
00068                 {
00069                         $this->tpl->setVariable("HEADER", $title);
00070                 }
00071 
00072                 $this->setAdminTabs();
00073                 $this->__showLocator();
00074         }
00075 
00076         function __setReturnLocation()
00077         {
00078                 
00079                 $this->gui_obj->setReturnLocation("permSave","exercise.php?cmd=perm&ref_id=".$this->getId());
00080                 $this->gui_obj->setReturnLocation("addRole","exercise.php?cmd=perm&ref_id=".$this->getId());
00081                 $this->gui_obj->setReturnLocation("addRole","exercise.php?cmd=perm&ref_id=".$this->getId());
00082                 $this->gui_obj->setReturnLocation("cancel","exercise.php?cmd=view&ref_id=".$this->getId());
00083                 $this->gui_obj->setReturnLocation("update","exercise.php?cmd=edit&ref_id=".$this->getId());
00084                 $this->gui_obj->setReturnLocation("uploadFile","exercise.php?cmd=edit&ref_id=".$this->getId());
00085                 $this->gui_obj->setReturnLocation("members","exercise.php?cmd=members&ref_id=".$this->getId());
00086 
00087                 $this->gui_obj->setReturnLocation("save","exercise.php?cmd=view&ref_id=".$current_ref_id);
00088                 $this->gui_obj->setReturnLocation("cut","exercise.php?cmd=view&ref_id=".$this->getId());
00089                 $this->gui_obj->setReturnLocation("clear","exercise.php?cmd=view&ref_id=".$this->getId());
00090                 $this->gui_obj->setReturnLocation("copy","exercise.php?cmd=view&ref_id=".$this->getId());
00091                 $this->gui_obj->setReturnLocation("link","exercise.php?cmd=view&ref_id=".$this->getId());
00092                 $this->gui_obj->setReturnLocation("paste","exercise.php?cmd=view&ref_id=".$this->getId());
00093                 $this->gui_obj->setReturnLocation("cancelDelete","exercise.php?cmd=view&ref_id=".$this->getId());
00094                 $this->gui_obj->setReturnLocation("confirmedDelete","exercise.php?cmd=view&ref_id=".$this->getId());
00095                 $this->gui_obj->setReturnLocation("removeFromSystem","exercise.php?cmd=view&ref_id=".$this->getId());
00096                 $this->gui_obj->setReturnLocation("undelete","exercise.php?cmd=view&ref_id=".$this->getId());
00097         }
00098 
00099         function __setFormAction()
00100         {
00101                 $this->gui_obj->setFormAction("permSave","exercise.php?cmd=permSave&ref_id=".$this->getId());
00102                 $this->gui_obj->setFormAction("addRole","exercise.php?cmd=addRole&ref_id=".$this->getId());
00103                 $this->gui_obj->setFormAction("gateway","exercise.php?cmd=gateway&ref_id=".$this->getId());
00104                 $this->gui_obj->setFormAction("updateMembers","exercise.php?cmd=updateMembers&ref_id=".$this->getId());
00105                 $this->gui_obj->setFormAction("newMembers","exercise.php?cmd=newMembers&ref_id=".$this->getId());
00106                 $this->gui_obj->setFormAction("downloadFile","exercise.php?cmd=downloadFile&ref_id=".$this->getId());
00107         }
00108         function __showLocator()
00109         {
00110                 $path_info = $this->gui_obj->tree->getPathFull($this->getId());
00111 
00112                 $this->tpl->addBlockFile("LOCATOR","locator","tpl.locator.html");
00113 
00114                 $this->tpl->setCurrentBlock("locator_item");
00115                 $this->tpl->setVariable("LINK_ITEM","./repository.php");
00116                 $this->tpl->setVariable("ITEM",$this->lng->txt("repository"));
00117                 $this->tpl->parseCurrentBlock();
00118 
00119                 $repository_link = true;
00120                 for($i = 1; $i < count($path_info); ++$i)
00121                 {
00122                         if($path_info[$i]["child"] == $this->getId())
00123                         {
00124                                 $repository_link = false;
00125                         }
00126                         $this->tpl->touchBlock("locator_separator_prefix");
00127                         $this->tpl->setCurrentBlock("locator_item");
00128                         if($repository_link)
00129                         {
00130                                 $this->tpl->setVariable("LINK_ITEM","./repository.php?ref_id=".$path_info[$i]["child"]);
00131                         }
00132                         else
00133                         {
00134                                 $this->tpl->setVariable("LINK_ITEM","./exercise.php?ref_id=".$path_info[$i]["child"]);
00135                         }
00136                         $this->tpl->setVariable("ITEM",$path_info[$i]["title"]);
00137                         $this->tpl->parseCurrentBlock();
00138                 }
00139                 $this->tpl->setCurrentBlock("locator");
00140                 $this->tpl->setVariable("TXT_LOCATOR",$this->lng->txt("locator"));
00141                 $this->tpl->parseCurrentBlock();
00142         }
00143                 
00144 } // END class.ilExerciseGUIAdapter
00145 ?>

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