4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
5 include_once(
"Services/Utilities/classes/class.ilFileUtils.php");
29 function __construct($a_parent_obj, $a_parent_cmd, $confirmDelete =
false)
33 parent::__construct($a_parent_obj, $a_parent_cmd);
35 $this->current_version = $a_parent_obj->object->getVersion();
38 $lng->loadLanguageModule(
"file");
41 $this->
setRowTemplate(
"tpl.file_version_row.html",
"Modules/File");
49 if (!$this->confirmDelete)
51 $this->
setTitle($lng->txt(
"versions"));
56 if (!$this->confirmDelete)
59 $this->
addColumn($lng->txt(
"version"),
"",
"1");
61 $this->
addColumn($lng->txt(
"file_uploaded_by"));
63 $this->
addColumn($lng->txt(
"filesize"),
"",
"",
false,
"ilRight");
65 if (!$this->confirmDelete)
72 if (!$this->confirmDelete)
92 $hist_id = $a_set[
"hist_entry_id"];
97 $rollback_version = $a_set[
"rollback_version"];
98 $rollback_user_id = $a_set[
"rollback_user_id"];
102 $username = trim($name[
"title"] .
" " . $name[
"firstname"] .
" " . $name[
"lastname"]);
106 $directory = $this->parent_obj->object->getDirectory(
$version);
108 $filesize = filesize($filepath);
111 $action = $lng->txt(
"file_version_" . $a_set[
"action"]);
112 if ($a_set[
"action"] ==
"rollback")
115 $rollback_username = trim($name[
"title"] .
" " . $name[
"firstname"] .
" " . $name[
"lastname"]);
116 $action = sprintf($action, $rollback_version, $rollback_username);
120 $ilCtrl->setParameter($this->parent_obj,
"hist_id", $hist_id);
121 $link = $ilCtrl->getLinkTarget($this->parent_obj,
"sendfile");
124 include_once(
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
126 $actions->setId($hist_id);
127 $actions->setListTitle($lng->txt(
"actions"));
128 $actions->addItem($lng->txt(
"delete"),
"", $ilCtrl->getLinkTarget($this->parent_obj,
"deleteVersions"));
129 if ($this->current_version !=
$version)
130 $actions->addItem($lng->txt(
"file_rollback"),
"", $ilCtrl->getLinkTarget($this->parent_obj,
"rollbackVersion"));
133 $ilCtrl->setParameter($this->parent_obj,
"hist_id",
"");
136 $this->tpl->setVariable(
"TXT_VERSION",
$version);
138 $this->tpl->setVariable(
"TXT_UPLOADED_BY", $username);
139 $this->tpl->setVariable(
"DL_LINK", $link);
140 $this->tpl->setVariable(
"TXT_FILENAME",
$filename);
144 if (!$this->confirmDelete)
146 $this->tpl->setCurrentBlock(
"version_selection");
147 $this->tpl->setVariable(
"OBJ_ID", $hist_id);
148 $this->tpl->parseCurrentBlock();
150 $this->tpl->setCurrentBlock(
"version_txt_actions");
151 $this->tpl->setVariable(
"TXT_ACTION", $action);
152 $this->tpl->parseCurrentBlock();
154 $this->tpl->setCurrentBlock(
"version_actions");
155 $this->tpl->setVariable(
"ACTIONS", $actions->getHTML());
156 $this->tpl->parseCurrentBlock();
160 $this->tpl->setCurrentBlock(
"version_id");
161 $this->tpl->setVariable(
"OBJ_ID", $hist_id);
162 $this->tpl->parseCurrentBlock();
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static _lookupName($a_user_id)
lookup user name
fillRow($a_set)
Standard Version of Fill Row.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
__construct($a_parent_obj, $a_parent_cmd, $confirmDelete=false)
Creates a new ilFileVersionTableGUI instance.
addMultiCommand($a_cmd, $a_text)
Add Command button.
static formatDate(ilDateTime $date)
Format a date public.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
setEnableHeader($a_enableheader)
Set Enable Header.
static formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
Class ilFileVersionTableGUI.
static getValidFilename($a_filename)
Get valid filename.
setLimit($a_limit=0, $a_default_limit=0)