Class ilFileVersionFormGUI.
More...
◆ __construct()
ilFileVersionFormGUI::__construct |
( |
ilFileVersionsGUI |
$file_version_gui, |
|
|
private int |
$save_mode = self::MODE_ADD |
|
) |
| |
◆ getHTML()
ilFileVersionFormGUI::getHTML |
( |
| ) |
|
◆ initForm()
ilFileVersionFormGUI::initForm |
( |
| ) |
|
|
private |
Definition at line 72 of file class.ilFileVersionFormGUI.php.
References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\form(), ILIAS\Repository\lng(), ilFileVersionsUploadHandlerGUI\MODE_APPEND, ilFileVersionsUploadHandlerGUI\MODE_REPLACE, and ilObject\TITLE_LENGTH.
Referenced by __construct().
74 switch ($this->save_mode) {
75 case self::MODE_REPLACE:
76 $this->global_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'replace_file_info'));
77 $group_title = $this->
lng->txt(
'replace_file');
81 $this->global_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'file_new_version_info'));
82 $group_title = $this->
lng->txt(
'file_new_version');
88 $this->save_mode === self::MODE_REPLACE
94 self::F_TITLE => $this->ui_factory->input()->field()->text(
95 $this->
lng->txt(self::F_TITLE),
96 $this->
lng->txt(
"if_no_title_then_filename")
97 )->withRequired(
false)
99 ->withValue($this->file->getTitle()),
101 self::F_DESCRIPTION => $this->ui_factory->input()->field()->textarea(
102 $this->
lng->txt(self::F_DESCRIPTION)
104 self::F_FILE => $this->ui_factory->input()->field()->file(
106 $this->
lng->txt(self::F_FILE)
108 ->withRequired(
true),
111 $group = $this->ui_factory->input()->field()->group(
$inputs, $group_title);
113 $this->
form = $this->ui_factory->input()->container()->form()->standard($this->post_url, [$group]);
Class ilFileVersionsUploadHandlerGUI.
form( $class_path, string $cmd, string $submit_caption="")
◆ resolveParentCommand()
ilFileVersionFormGUI::resolveParentCommand |
( |
int |
$mode | ) |
|
|
private |
◆ saveObject()
ilFileVersionFormGUI::saveObject |
( |
| ) |
|
Definition at line 116 of file class.ilFileVersionFormGUI.php.
References $data, ensureSuffix(), ILIAS\Repository\form(), ILIAS\Repository\int(), and null.
118 $this->
form = $this->
form->withRequest($this->request);
124 $title = empty(
$data[self::F_TITLE]) ? $this->file->getTitle() :
$data[self::F_TITLE];
125 $description =
$data[self::F_DESCRIPTION] !==
'' ?
$data[self::F_DESCRIPTION] : $this->file->getDescription();
126 $revision_number =
$data[self::F_FILE][0] ??
null;
127 if ($revision_number === null) {
130 $revision_number = (
int) $revision_number;
133 $rid = $this->resource_services->manage()->find($this->file->getResourceId());
134 $resource = $this->resource_services->manage()->getResource($rid);
135 $new_revision = $resource->getSpecificRevision($revision_number);
137 $new_revision->setTitle(
138 $this->
ensureSuffix($title, $new_revision->getInformation()->getSuffix())
140 $this->resource_services->manage()->updateRevision($new_revision);
142 $this->file->setDescription($description);
143 $this->file->updateObjectFromCurrentRevision();
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
form( $class_path, string $cmd, string $submit_caption="")
ensureSuffix(string $title, ?string $suffix=null)
◆ $file
◆ $form
◆ $global_tpl
◆ $lng
◆ $post_url
string ilFileVersionFormGUI::$post_url |
|
private |
◆ $request
RequestInterface ilFileVersionFormGUI::$request |
|
private |
◆ $resource_services
Services ilFileVersionFormGUI::$resource_services |
|
private |
◆ $ui_factory
Factory ilFileVersionFormGUI::$ui_factory |
|
private |
◆ $ui_renderer
Renderer ilFileVersionFormGUI::$ui_renderer |
|
private |
◆ F_DESCRIPTION
const ilFileVersionFormGUI::F_DESCRIPTION = "description" |
◆ F_FILE
const ilFileVersionFormGUI::F_FILE = "file" |
◆ F_SAVE_MODE
const ilFileVersionFormGUI::F_SAVE_MODE = 'save_mode' |
◆ F_TITLE
const ilFileVersionFormGUI::F_TITLE = 'title' |
◆ MODE_ADD
const ilFileVersionFormGUI::MODE_ADD = 1 |
◆ MODE_REPLACE
const ilFileVersionFormGUI::MODE_REPLACE = 2 |
The documentation for this class was generated from the following file: