19declare(strict_types=1);
41 private \ILIAS\HTTP\Services
$http;
48 $this->ui_factory =
$DIC[
'ui.factory'];
49 $this->ui_renderer =
$DIC[
'ui.renderer'];
50 $this->
ctrl = $DIC[
'ilCtrl'];
51 $this->
lng = $DIC[
'lng'];
52 $this->
http = $DIC->http();
53 $this->data_factory =
new DataFactory();
70 return $this->ui_renderer->render([$this->
buildTable()]);
75 $file = $this->calling_gui->getFile();
77 $rid = $irss->manage()->find($file->getResourceId());
78 $revision = $irss->manage()->getCurrentRevisionIncludingDraft($rid);
79 $amount_of_versions = count($irss->manage()->getResource($rid)->getAllRevisionsIncludingDraft());
81 $current_version = $file->getVersion(
true);
86 $current_version_is_draft,
94 return $this->ui_factory->table()
95 ->data($data_retrieval, $this->
lng->txt(
'versions'), $this->initColumns())
98 ->withRequest($this->
http->request());
105 [
'file',
'versions'],
117 $col = $this->ui_factory->table()->column();
120 'version' => $col->number($this->
lng->txt(
'version')),
121 'filename' => $col->link($this->
lng->txt(
'filename')),
122 'date' => $col->date($this->
lng->txt(
'date'), $df->dateFormat()->withTime24($df->dateFormat()->germanShort())),
123 'uploaded_by' => $col->text($this->
lng->txt(
'file_uploaded_by')),
124 'versionname' => $col->text($this->
lng->txt(
'versionname')),
125 'filesize' => $col->text($this->
lng->txt(
'filesize'))->withIsSortable(
false),
126 'status' => $col->text($this->
lng->txt(
'status'))->withIsSortable(
false),
135 $a = $this->ui_factory->table()->action();
139 $this->
lng->txt(
'delete'),
144 $this->
lng->txt(
'file_rollback'),
149 $this->
lng->txt(
'file_publish'),
154 $this->
lng->txt(
'file_unpublish'),
164 ILIAS_HTTP_PATH .
'/' . $this->
ctrl->getLinkTarget($this->calling_gui, $command)
171 return $DIC->resourceStorage();
Builds a Color from either hex- or rgb values.
Both the subject and the direction need to be specified when expressing an order.
The scope of this class is split ilias-conform URI's into components.
const string ACTION_PUBLISH
const string ACTION_ROLLBACK
const string ACTION_UNPUBLISH
const string ACTION_DELETE
__construct(private readonly \ilFileVersionsGUI $calling_gui)
URLBuilderToken $id_token
ILIAS HTTP Services $http
DataFactory $data_factory
acquireParameters(array $namespace, string ... $names)
const CMD_RENDER_DELETE_SELECTED_VERSIONS_MODAL
const CMD_ROLLBACK_VERSION
An entity that renders components to a string output.
static http()
Fetches the global http state from ILIAS.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples