ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjFileComponentBuilder Class Reference
+ Collaboration diagram for ilObjFileComponentBuilder:

Public Member Functions

 __construct (protected ilLanguage $lng, protected \ILIAS\DI\UIServices $ui)
 
 buildConfirmDeleteSpecificVersionsModal (string $action, ilObjFile $file, array $version_ids)
 
 buildConfirmDeleteAllVersionsModal (string $action, ilObjFile $file,)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjFileComponentBuilder::__construct ( protected ilLanguage  $lng,
protected \ILIAS\DI\UIServices  $ui 
)

Definition at line 27 of file class.ilObjFileComponentBuilder.php.

30  {
31  }

Member Function Documentation

◆ buildConfirmDeleteAllVersionsModal()

ilObjFileComponentBuilder::buildConfirmDeleteAllVersionsModal ( string  $action,
ilObjFile  $file 
)

Definition at line 64 of file class.ilObjFileComponentBuilder.php.

References ilObject\_getIcon(), ilObject\getId(), ilObject\getRefId(), ilObject\getTitle(), ilObject\getType(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

67  : Interruptive {
68  $icon = $this->ui->factory()->image()->standard(
69  ilObject::_getIcon($file->getId(), "small", $file->getType()),
70  $this->lng->txt("icon") . " " . $this->lng->txt("obj_" . $file->getType())
71  );
72 
73  return $this->ui->factory()->modal()->interruptive(
74  $this->lng->txt('delete'),
75  $this->lng->txt('file_confirm_delete_all_versions'),
76  $action
77  )->withAffectedItems(
78  [
79  $this->ui->factory()->modal()->interruptiveItem()->standard(
80  (string) $file->getRefId(),
81  $file->getTitle(),
82  $icon
83  )
84  ]
85  );
86  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
+ Here is the call graph for this function:

◆ buildConfirmDeleteSpecificVersionsModal()

ilObjFileComponentBuilder::buildConfirmDeleteSpecificVersionsModal ( string  $action,
ilObjFile  $file,
array  $version_ids 
)

Definition at line 33 of file class.ilObjFileComponentBuilder.php.

References $filename, $version, ilObject\_getIcon(), ilObject\getId(), ilObject\getTitle(), ilObject\getType(), ilObjFile\getVersions(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

37  : Interruptive {
38  $icon = $this->ui->factory()->image()->standard(
39  ilObject::_getIcon($file->getId(), "small", $file->getType()),
40  $this->lng->txt("icon") . " " . $this->lng->txt("obj_" . $file->getType())
41  );
42 
43  $modal_items = [];
44  foreach ($file->getVersions($version_ids) as $version) {
45  $filename = $version['filename'] ?? $version->getFilename() ?? $file->getTitle();
46  $version_nr = $version['hist_id'] ?? $version->getVersion();
47  $item_title = $filename . " (v" . $version_nr . ")";
48  $modal_items[] = $this->ui->factory()->modal()->interruptiveItem()->standard(
49  (string) $version['hist_entry_id'],
50  $item_title,
51  $icon
52  );
53  }
54 
55  return $this->ui->factory()->modal()->interruptive(
56  $this->lng->txt('delete'),
57  $this->lng->txt('file_confirm_delete_versions'),
58  $action
59  )->withAffectedItems(
60  $modal_items
61  );
62  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
$filename
Definition: buildRTE.php:78
getVersions($version_ids=null)
$version
Definition: plugin.php:24
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: