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->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 }
00145 ?>