6 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
38 parent::__construct($a_parent_obj, $a_parent_cmd);
40 $this->current_version = $a_parent_obj->object->getVersion();
43 $lng->loadLanguageModule(
"file");
46 $this->
setRowTemplate(
"tpl.file_version_row.html",
"Modules/File");
53 if (!$this->confirmDelete) {
59 if (!$this->confirmDelete) {
68 $this->
addColumn(
$lng->txt(
"filesize"),
"",
"",
false,
"ilRight");
70 if (!$this->confirmDelete) {
77 if (!$this->confirmDelete) {
91 protected function fillRow($a_set)
96 $ilAccess = $DIC[
'ilAccess'];
98 $hist_id = $a_set[
"hist_entry_id"];
103 $rollback_version = $a_set[
"rollback_version"];
104 $rollback_user_id = $a_set[
"rollback_user_id"];
108 $username = trim(
$name[
"title"] .
" " .
$name[
"firstname"] .
" " .
$name[
"lastname"]);
114 $object = $this->parent_obj->object;
115 $directory = LegacyPathHelper::createRelativePath($object->getDirectory(
$version));
118 if ($DIC->filesystem()->storage()->has($filepath)) {
119 $size = $filesize = $DIC->filesystem()->storage()->getSize($filepath, \
ILIAS\Data\DataSize::Byte);
120 $filesize =
$size->getSize();
124 $action =
$lng->txt(
"file_version_" . $a_set[
"action"]);
125 if ($a_set[
"action"] ==
"rollback") {
127 $rollback_username = trim($name[
"title"] .
" " . $name[
"firstname"] .
" " . $name[
"lastname"]);
128 $action = sprintf(
$action, $rollback_version, $rollback_username);
132 $ilCtrl->setParameter($this->parent_obj,
"hist_id", $hist_id);
133 $link =
$ilCtrl->getLinkTarget($this->parent_obj,
"sendfile");
136 include_once(
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
138 $actions->setId($hist_id);
139 $actions->setListTitle(
$lng->txt(
"actions"));
140 $actions->addItem(
$lng->txt(
"delete"),
"",
$ilCtrl->getLinkTarget($this->parent_obj,
"deleteVersions"));
141 if ($this->current_version !=
$version) {
142 $actions->addItem(
$lng->txt(
"file_rollback"),
"",
$ilCtrl->getLinkTarget($this->parent_obj,
"rollbackVersion"));
146 $ilCtrl->setParameter($this->parent_obj,
"hist_id",
"");
149 $this->tpl->setVariable(
"TXT_VERSION",
$version);
151 $this->tpl->setVariable(
"TXT_UPLOADED_BY", $username);
152 $this->tpl->setVariable(
"DL_LINK", $link);
153 $this->tpl->setVariable(
"TXT_FILENAME",
$filename);
157 if (!$this->confirmDelete) {
158 $this->tpl->setCurrentBlock(
"version_selection");
159 $this->tpl->setVariable(
"OBJ_ID", $hist_id);
160 $this->tpl->parseCurrentBlock();
162 $this->tpl->setCurrentBlock(
"version_txt_actions");
163 $this->tpl->setVariable(
"TXT_ACTION",
$action);
164 $this->tpl->parseCurrentBlock();
166 $this->tpl->setCurrentBlock(
"version_actions");
167 $this->tpl->setVariable(
"ACTIONS", $actions->getHTML());
168 $this->tpl->parseCurrentBlock();
170 $this->tpl->setCurrentBlock(
"version_id");
171 $this->tpl->setVariable(
"OBJ_ID", $hist_id);
172 $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
__construct(ilFileVersionsGUI $a_parent_obj, $a_parent_cmd, $confirmDelete=false)
ilFileVersionTableGUI constructor.
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.
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.
fillRow($a_set)
Standard Version of Fill Row.
static formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.
Class ilFileVersionTableGUI.
static getValidFilename($a_filename)
Get valid filename.
setLimit($a_limit=0, $a_default_limit=0)