ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjFileComponentBuilder Class Reference
+ Collaboration diagram for ilObjFileComponentBuilder:

Public Member Functions

 __construct (protected ilLanguage $lng, protected 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 UIServices  $ui 
)

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

32  {
33  }

Member Function Documentation

◆ buildConfirmDeleteAllVersionsModal()

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

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

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

69  : Interruptive {
70  $icon = $this->ui->factory()->image()->standard(
71  ilObject::_getIcon($file->getId(), "small", $file->getType()),
72  $this->lng->txt("icon") . " " . $this->lng->txt("obj_" . $file->getType())
73  );
74 
75  return $this->ui->factory()->modal()->interruptive(
76  $this->lng->txt('delete'),
77  $this->lng->txt('file_confirm_delete_all_versions'),
78  $action
79  )->withAffectedItems(
80  [
81  $this->ui->factory()->modal()->interruptiveItem()->standard(
82  (string) $file->getRefId(),
83  $file->getTitle(),
84  $icon
85  )
86  ]
87  );
88  }
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 35 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().

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

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