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();
 
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
User interface class for advanced drop-down selection lists.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static getValidFilename($a_filename)
Get valid filename.
const CMD_DELETE_VERSIONS
const CMD_ROLLBACK_VERSION
const CMD_DOWNLOAD_VERSION
Class ilFileVersionsTableGUI.
fillRow($a_set)
Standard Version of Fill Row.
__construct(ilFileVersionsGUI $calling_gui_class, $a_parent_cmd=ilFileVersionsGUI::CMD_DEFAULT)
ilFileVersionsTableGUI constructor.
static _lookupName($a_user_id)
lookup user name
setEnableHeader($a_enableheader)
Set Enable Header.
setPrefix($a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
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.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
addMultiCommand($a_cmd, $a_text)
Add Command 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.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setMaxCount($a_max_count)
set max.
disable($a_module_name)
diesables particular modules of table
static formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.