4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
34 $this->current_version = $a_parent_obj->object->getVersion();
37 $lng->loadLanguageModule(
"file");
40 $this->
setRowTemplate(
"tpl.file_version_row.html",
"Modules/File");
48 if (!$this->confirmDelete)
50 $this->
setTitle($lng->txt(
"versions"));
55 if (!$this->confirmDelete)
58 $this->
addColumn($lng->txt(
"version"),
"",
"1");
60 $this->
addColumn($lng->txt(
"file_uploaded_by"));
62 $this->
addColumn($lng->txt(
"filesize"),
"",
"",
false,
"ilRight");
64 if (!$this->confirmDelete)
71 if (!$this->confirmDelete)
91 $hist_id = $a_set[
"hist_entry_id"];
95 $version = $a_set[
"version"];
96 $rollback_version = $a_set[
"rollback_version"];
97 $rollback_user_id = $a_set[
"rollback_user_id"];
101 $username = trim($name[
"title"] .
" " . $name[
"firstname"] .
" " . $name[
"lastname"]);
104 $filepath = $this->parent_obj->object->getDirectory($version) .
"/" .
$filename;
105 $filesize = filesize($filepath);
108 $action = $lng->txt(
"file_version_" . $a_set[
"action"]);
109 if ($a_set[
"action"] ==
"rollback")
112 $rollback_username = trim($name[
"title"] .
" " . $name[
"firstname"] .
" " . $name[
"lastname"]);
113 $action = sprintf($action, $rollback_version, $rollback_username);
117 $ilCtrl->setParameter($this->parent_obj,
"hist_id", $hist_id);
118 $link = $ilCtrl->getLinkTarget($this->parent_obj,
"sendfile");
121 include_once(
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
123 $actions->setId($hist_id);
124 $actions->setListTitle($lng->txt(
"actions"));
125 $actions->addItem($lng->txt(
"delete"),
"", $ilCtrl->getLinkTarget($this->parent_obj,
"deleteVersions"));
126 if ($this->current_version != $version)
127 $actions->addItem($lng->txt(
"file_rollback"),
"", $ilCtrl->getLinkTarget($this->parent_obj,
"rollbackVersion"));
130 $ilCtrl->setParameter($this->parent_obj,
"hist_id",
"");
133 $this->tpl->setVariable(
"TXT_VERSION", $version);
135 $this->tpl->setVariable(
"TXT_UPLOADED_BY", $username);
136 $this->tpl->setVariable(
"DL_LINK", $link);
137 $this->tpl->setVariable(
"TXT_FILENAME",
$filename);
141 if (!$this->confirmDelete)
143 $this->tpl->setCurrentBlock(
"version_selection");
144 $this->tpl->setVariable(
"OBJ_ID", $hist_id);
145 $this->tpl->parseCurrentBlock();
147 $this->tpl->setCurrentBlock(
"version_txt_actions");
148 $this->tpl->setVariable(
"TXT_ACTION", $action);
149 $this->tpl->parseCurrentBlock();
151 $this->tpl->setCurrentBlock(
"version_actions");
152 $this->tpl->setVariable(
"ACTIONS", $actions->getHTML());
153 $this->tpl->parseCurrentBlock();
157 $this->tpl->setCurrentBlock(
"version_id");
158 $this->tpl->setVariable(
"OBJ_ID", $hist_id);
159 $this->tpl->parseCurrentBlock();