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