33     private \ILIAS\ResourceStorage\Services 
$irss;
    36     protected \ILIAS\DI\UIServices 
$ui;
    53         $this->
ui = $DIC->ui();
    54         $this->irss = $DIC->resourceStorage();
    55         $this->
setId(self::class);
    57         $this->file = $calling_gui_class->
getFile();
    58         $this->current_version = $this->file->getVersion(
true);
    59         $rid = $this->irss->manage()->find(
    60             $this->file->getResourceId()
    62         $revision = $this->irss->manage()->getCurrentRevisionIncludingDraft(
    65         $this->amount_of_versions = count(
    66             $this->irss->manage()->getResource($rid)->getAllRevisionsIncludingDraft()
    72         $this->dic->language()->loadLanguageModule(
'file');
    75         $this->
setRowTemplate(
"tpl.file_version_row.html", 
"Modules/File");
    79         $this->
setTitle($this->dic->language()->txt(
"versions"));
    83         $this->
setFormAction($this->dic->ctrl()->getFormAction($calling_gui_class));
    90             $this->dic->language()->txt(
"file_rollback")
    95         $this->
addColumn($this->dic->language()->txt(
"version"), 
"", 
"auto");
    96         $this->
addColumn($this->dic->language()->txt(
"filename"));
    97         $this->
addColumn($this->dic->language()->txt(
"date"));
    98         $this->
addColumn($this->dic->language()->txt(
"file_uploaded_by"));
    99         $this->
addColumn($this->dic->language()->txt(
"versionname"));
   100         $this->
addColumn($this->dic->language()->txt(
"filesize"), 
"", 
"", 
false);
   101         $this->
addColumn($this->dic->language()->txt(
"status"));
   102         $this->
addColumn($this->dic->language()->txt(
"action"));
   111         foreach ($this->file->getVersions() as 
$version) {
   112             $versions[] = 
$version->getArrayCopy();
   114         usort($versions, 
static fn(array $i1, array $i2): 
int => $i2[
'version'] - $i1[
'version']);
   117         $this->
setMaxCount(is_array($versions) ? count($versions) : 0);
   120     protected function fillRow(array $a_set): void
   122         $action_entries = [];
   123         $hist_id = $a_set[
"hist_entry_id"];
   128         $rollback_version = $a_set[
"rollback_version"];
   129         $rollback_user_id = $a_set[
"rollback_user_id"];
   133         $username = trim($name[
"title"] . 
" " . $name[
"firstname"] . 
" " . $name[
"lastname"]);
   137             (
int) ($a_set[
"size"] ?? 0),
   140         $filesize = (string) $data_size;
   143         $action = $this->dic->language()->txt(
   144             "file_version_" . $a_set[
"action"]
   146         if ($a_set[
"action"] == 
"rollback") {
   148             $rollback_username = trim($name[
"title"] . 
" " . $name[
"firstname"] . 
" " . $name[
"lastname"]);
   149             $action = sprintf($action, $rollback_version, $rollback_username);
   157         $pseudo_modal = $this->
ui->factory()->modal()->interruptive(
'', 
'', 
'')->withAsyncRenderUrl(
   158             $this->
ctrl->getLinkTargetByClass(
   159                 ilFileVersionsGUI::class,
   166         $this->modals[] = $pseudo_modal;
   167         $buttons = $this->dic->ui()->factory()->button();
   170         if (!$this->current_version_is_draft) {
   171             $action_entries[
'delete'] = 
$buttons   173                     $this->dic->language()->txt(
"delete"),
   177                     $pseudo_modal->getShowSignal()
   181             if ($this->current_version !== (
int) 
$version) {
   182                 $action_entries[
'file_rollback'] = 
$buttons   184                         $this->dic->language()->txt(
"file_rollback"),
   187             } elseif ($this->amount_of_versions > 1) {
   188                 $action_entries[
'unpublish'] = 
$buttons   190                         $this->dic->language()->txt(
"file_unpublish"),
   194         } elseif ($this->current_version === (
int) 
$version) {
   195             $action_entries[
'publish'] = 
$buttons   197                     $this->dic->language()->txt(
"file_publish"),
   203         $actions = $this->dic->ui()->renderer()->render(
   204             $this->dic->ui()->factory()->dropdown()
   205                       ->standard($action_entries)
   206                       ->withLabel($this->
lng->txt(
'actions'))
   213         $this->tpl->setVariable(
"TXT_VERSION", $version);
   214         $this->tpl->setVariable(
   218         $this->tpl->setVariable(
"TXT_UPLOADED_BY", $username);
   219         $this->tpl->setVariable(
"DL_LINK", $link);
   220         $this->tpl->setVariable(
"TXT_FILENAME", 
$filename);
   221         $this->tpl->setVariable(
"TXT_VERSIONNAME", $a_set[
'title']);
   222         $this->tpl->setVariable(
"TXT_FILESIZE", $data_size);
   225         $this->tpl->setCurrentBlock(
"version_selection");
   226         $this->tpl->setVariable(
"OBJ_ID", $hist_id);
   227         $this->tpl->parseCurrentBlock();
   229         $this->tpl->setCurrentBlock(
"version_txt_actions");
   230         $this->tpl->setVariable(
"TXT_ACTION", $action);
   231         $this->tpl->parseCurrentBlock();
   233         $this->tpl->setCurrentBlock(
"version_actions");
   235         $this->tpl->setVariable(
"ACTIONS", $actions);
   237         $this->tpl->parseCurrentBlock();
   248         return parent::getHTML() . $this->
ui->renderer()->render($this->modals);
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
const CMD_DELETE_VERSIONS
 
getHTML()
Enables rendering modals OUTSIDE of the table. 
 
setFormAction(string $a_form_action, bool $a_multipart=false)
 
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
This class provides the data size with additional information to remove the work to calculate the siz...
 
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
 
static _lookupName(int $a_user_id)
lookup user name 
 
const CMD_DOWNLOAD_VERSION
 
Customizing of pimple-DIC for ILIAS. 
 
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template. 
 
Class ilFileVersionsTableGUI. 
 
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
 
bool $current_version_is_draft
 
ILIAS ResourceStorage Services $irss
 
setLimit(int $a_limit=0, int $a_default_limit=0)
 
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
disable(string $a_module_name)
 
const CMD_ROLLBACK_VERSION
 
addMultiCommand(string $a_cmd, string $a_text)
 
__construct(ilFileVersionsGUI $calling_gui_class, string $a_parent_cmd=ilFileVersionsGUI::CMD_DEFAULT)
ilFileVersionsTableGUI constructor. 
 
setEnableHeader(bool $a_enableheader)
 
setMaxCount(int $a_max_count)
set max. 
 
const CMD_RENDER_DELETE_SELECTED_VERSIONS_MODAL
 
setPrefix(string $a_prefix)