• 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.adm_content.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                 $this->tpl->setCurrentBlock("header_image");
00068                 $this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_exc_b.gif"));
00069                 $this->tpl->parseCurrentBlock();
00070                 if (!empty($title))
00071                 {
00072                         $this->tpl->setVariable("HEADER", $title);
00073                 }
00074 
00075                 $this->gui_obj->setTabs();
00076                 //$this->setAdminTabs();
00077                 $this->__showLocator();
00078         }
00079 
00080         function __setReturnLocation()
00081         {
00082                 
00083                 $this->gui_obj->setReturnLocation("permSave","exercise.php?cmd=perm&ref_id=".$this->getId());
00084                 $this->gui_obj->setReturnLocation("addRole","exercise.php?cmd=perm&ref_id=".$this->getId());
00085                 $this->gui_obj->setReturnLocation("addRole","exercise.php?cmd=perm&ref_id=".$this->getId());
00086                 $this->gui_obj->setReturnLocation("cancel","exercise.php?cmd=view&ref_id=".$this->getId());
00087                 $this->gui_obj->setReturnLocation("view","exercise.php?cmd=view&ref_id=".$this->getId());
00088                 $this->gui_obj->setReturnLocation("update","exercise.php?cmd=edit&ref_id=".$this->getId());
00089                 $this->gui_obj->setReturnLocation("uploadFile","exercise.php?cmd=edit&ref_id=".$this->getId());
00090                 $this->gui_obj->setReturnLocation("members","exercise.php?cmd=members&ref_id=".$this->getId());
00091 
00092                 $this->gui_obj->setReturnLocation("save","exercise.php?cmd=view&ref_id=".$current_ref_id);
00093                 $this->gui_obj->setReturnLocation("cut","exercise.php?cmd=view&ref_id=".$this->getId());
00094                 $this->gui_obj->setReturnLocation("clear","exercise.php?cmd=view&ref_id=".$this->getId());
00095                 $this->gui_obj->setReturnLocation("copy","exercise.php?cmd=view&ref_id=".$this->getId());
00096                 $this->gui_obj->setReturnLocation("link","exercise.php?cmd=view&ref_id=".$this->getId());
00097                 $this->gui_obj->setReturnLocation("paste","exercise.php?cmd=view&ref_id=".$this->getId());
00098                 $this->gui_obj->setReturnLocation("cancelDelete","exercise.php?cmd=view&ref_id=".$this->getId());
00099                 $this->gui_obj->setReturnLocation("confirmedDelete","exercise.php?cmd=view&ref_id=".$this->getId());
00100                 $this->gui_obj->setReturnLocation("removeFromSystem","exercise.php?cmd=view&ref_id=".$this->getId());
00101                 $this->gui_obj->setReturnLocation("undelete","exercise.php?cmd=view&ref_id=".$this->getId());
00102         }
00103 
00104         function __setFormAction()
00105         {
00106                 $this->gui_obj->setFormAction("permSave","exercise.php?cmd=permSave&ref_id=".$this->getId());
00107                 $this->gui_obj->setFormAction("addRole","exercise.php?cmd=addRole&ref_id=".$this->getId());
00108                 $this->gui_obj->setFormAction("gateway","exercise.php?cmd=gateway&ref_id=".$this->getId());
00109                 $this->gui_obj->setFormAction("updateMembers","exercise.php?cmd=updateMembers&ref_id=".$this->getId());
00110                 $this->gui_obj->setFormAction("newMembers","exercise.php?cmd=newMembers&ref_id=".$this->getId());
00111                 $this->gui_obj->setFormAction("downloadFile","exercise.php?cmd=downloadFile&ref_id=".$this->getId());
00112         }
00113         function __showLocator()
00114         {
00115                 $path_info = $this->gui_obj->tree->getPathFull($this->getId());
00116 
00117                 $this->tpl->addBlockFile("LOCATOR","locator","tpl.locator.html");
00118 
00119                 $this->tpl->setCurrentBlock("locator_item");
00120                 $this->tpl->setVariable("LINK_ITEM","./repository.php");
00121                 $this->tpl->setVariable("ITEM",$this->lng->txt("repository"));
00122                 $this->tpl->parseCurrentBlock();
00123 
00124                 $repository_link = true;
00125                 for($i = 1; $i < count($path_info); ++$i)
00126                 {
00127                         if($path_info[$i]["child"] == $this->getId())
00128                         {
00129                                 $repository_link = false;
00130                         }
00131                         $this->tpl->touchBlock("locator_separator_prefix");
00132                         $this->tpl->setCurrentBlock("locator_item");
00133                         if($repository_link)
00134                         {
00135                                 $this->tpl->setVariable("LINK_ITEM","./repository.php?ref_id=".$path_info[$i]["child"]);
00136                         }
00137                         else
00138                         {
00139                                 $this->tpl->setVariable("LINK_ITEM","./exercise.php?ref_id=".$path_info[$i]["child"]);
00140                         }
00141                         $this->tpl->setVariable("ITEM",$path_info[$i]["title"]);
00142                         $this->tpl->parseCurrentBlock();
00143                 }
00144                 $this->tpl->setCurrentBlock("locator");
00145                 $this->tpl->setVariable("TXT_LOCATOR",$this->lng->txt("locator"));
00146                 $this->tpl->parseCurrentBlock();
00147         }
00148                 
00149 } // END class.ilExerciseGUIAdapter
00150 ?>

Generated on Fri Dec 13 2013 11:57:54 for ILIAS Release_3_6_x_branch .rev 46809 by  doxygen 1.7.1