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