ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilResourceStorageInfoGUI.php
Go to the documentation of this file.
1 <?php
2 
21 
27 {
29  protected \ILIAS\ResourceStorage\Services $storage;
30  protected \ILIAS\ResourceStorage\Resource\StorableResource $resource;
31  protected ilLanguage $language;
32  protected bool $is_storage = true;
33 
38  public function __construct(?ResourceIdentification $identification = null)
39  {
40  global $DIC;
41  $this->storage = $DIC->resourceStorage();
45  if (!$identification instanceof ResourceIdentification) {
46  $this->is_storage = false;
47  } else {
48  $this->is_storage = true;
49  $this->identification = $identification;
50  $this->resource = $this->storage->manage()->getResource($this->identification);
51  }
52 
53  $this->language = $DIC->language();
54  $this->language->loadLanguageModule('irss');
55  }
56 
57  public function append(ilInfoScreenGUI $info): void
58  {
59  if ($this->is_storage) {
60  $info->addSection($this->language->txt("storage_info"));
61  $info->addProperty($this->language->txt("resource_id"), $this->identification->serialize());
62  $info->addProperty($this->language->txt("storage_id"), $this->resource->getStorageID());
63  $info->addProperty($this->language->txt("max_revision"), $this->resource->getMaxRevision());
64  $info->addProperty($this->language->txt("stakeholders"), count($this->resource->getStakeholders()));
65  }
66  }
67 }
Class ilInfoScreenGUI.
ILIAS ResourceStorage Resource StorableResource $resource
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
Class ilResourceStorageInfoGUI.
global $DIC
Definition: feed.php:28
ILIAS ResourceStorage Services $storage
addSection(string $a_title)
__construct(Container $dic, ilPlugin $plugin)