44 $this->
setId(self::class);
45 parent::__construct($calling_gui_class, $a_parent_cmd,
"");
46 $this->file = $calling_gui_class->
getFile();
47 $this->current_version = (int) $this->file->getVersion();
48 $this->max_version = (int) $this->file->getMaxVersion();
52 $this->dic->language()->loadLanguageModule(
'file');
55 $this->
setRowTemplate(
"tpl.file_version_row.html",
"Modules/File");
59 $this->
setTitle($this->dic->language()->txt(
"versions"));
62 $this->
setFormAction($this->dic->ctrl()->getFormAction($calling_gui_class));
69 $this->
addColumn($this->dic->language()->txt(
"version"),
"",
"1");
70 $this->
addColumn($this->dic->language()->txt(
"date"));
71 $this->
addColumn($this->dic->language()->txt(
"file_uploaded_by"));
72 $this->
addColumn($this->dic->language()->txt(
"filename"));
73 $this->
addColumn($this->dic->language()->txt(
"filesize"),
"",
"",
false,
"ilRight");
74 $this->
addColumn($this->dic->language()->txt(
"type"));
75 $this->
addColumn($this->dic->language()->txt(
"action"));
84 $versions = $this->file->getVersions();
86 $this->
setMaxCount(is_array($versions) ? count($versions) : 0);
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"]);
105 $directory = LegacyPathHelper::createRelativePath($this->file->getDirectory(
$version));
108 if ($this->dic->filesystem()->storage()->has($filepath)) {
109 $size = $filesize = $this->dic->filesystem()->storage()->getSize($filepath, DataSize::Byte);
110 $filesize =
$size->getSize();
114 $action = $this->dic->language()->txt(
"file_version_" . $a_set[
"action"]);
115 if ($a_set[
"action"] ==
"rollback") {
117 $rollback_username = trim($name[
"title"] .
" " . $name[
"firstname"] .
" " . $name[
"lastname"]);
118 $action = sprintf(
$action, $rollback_version, $rollback_username);
127 $actions->setId($hist_id);
128 $actions->setListTitle($this->dic->language()->txt(
"actions"));
130 if ($this->current_version !== (
int)
$version) {
138 $this->tpl->setVariable(
"TXT_VERSION",
$version);
140 $this->tpl->setVariable(
"TXT_UPLOADED_BY", $username);
141 $this->tpl->setVariable(
"DL_LINK", $link);
142 $this->tpl->setVariable(
"TXT_FILENAME",
$filename);
147 $this->tpl->setCurrentBlock(
"version_selection");
148 $this->tpl->setVariable(
"OBJ_ID", $hist_id);
149 $this->tpl->parseCurrentBlock();
151 $this->tpl->setCurrentBlock(
"version_txt_actions");
152 $this->tpl->setVariable(
"TXT_ACTION",
$action);
153 $this->tpl->parseCurrentBlock();
155 $this->tpl->setCurrentBlock(
"version_actions");
156 $this->tpl->setVariable(
"ACTIONS", $actions->getHTML());
157 $this->tpl->parseCurrentBlock();
static _lookupName($a_user_id)
lookup user name
const CMD_DELETE_VERSIONS
Exercise XML Parser which completes/updates a given file by an xml string.
__construct(ilFileVersionsGUI $calling_gui_class, $a_parent_cmd=ilFileVersionsGUI::CMD_DEFAULT)
ilFileVersionsTableGUI constructor.
const CMD_DOWNLOAD_VERSION
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
Class ilFileVersionsTableGUI.
addMultiCommand($a_cmd, $a_text)
Add Command button.
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
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.
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.
const CMD_ROLLBACK_VERSION
setMaxCount($a_max_count)
set max.
static getValidFilename($a_filename)
Get valid filename.
setLimit($a_limit=0, $a_default_limit=0)