61 protected \ILIAS\HTTP\Services
$http;
73 $this->irss = $DIC->resourceStorage();
74 $this->
ctrl = $DIC->ctrl();
76 $this->
language->loadLanguageModule(
'irss');
77 $this->main_tpl = $DIC->ui()->mainTemplate();
78 $this->
upload = $DIC->upload();
79 $this->wrapper = $DIC->http()->wrapper();
81 $this->ui_renderer = $DIC->ui()->renderer();
82 $this->
tabs = $DIC->tabs();
90 $this->
tabs->clearTargets();
91 $this->
tabs->setBackTarget(
93 $this->
ctrl->getLinkTarget($this, self::CMD_INDEX)
99 switch ($this->
ctrl->getCmd(self::CMD_INDEX)) {
100 case self::CMD_INDEX:
103 case self::CMD_DOWNLOAD:
106 case self::CMD_SHOW_REVISIONS:
109 case self::CMD_GOTO_RESOURCE:
110 $this->gotoResource();
121 $this->
language->txt(
'resource_overview')
127 $this->main_tpl->setContent(
128 $this->ui_renderer->render($listing->getComponents())
133 private function gotoResource():
void 136 $resource = $this->irss->manage()->getResource($rid);
137 $stakeholders = $resource->getStakeholders();
138 if (count($stakeholders) === 1) {
140 $stakeholder = array_shift($stakeholders);
143 $this->
ctrl->redirectToURL($uri);
146 $this->main_tpl->setOnScreenMessage(
'info', $this->
language->txt(
'resource_no_stakeholder_uri'));
149 $this->main_tpl->setOnScreenMessage(
'failure',
'Multiple Stakeholders found, can\'t redirect',
true);
150 $this->
ctrl->redirect($this, self::CMD_INDEX);
159 $resource = $this->irss->manage()->getResource($rid);
163 self::CMD_SHOW_REVISIONS,
164 $this->
language->txt(
'resource_overview')
166 $view_definition->
setMode(ViewDefinition::MODE_AS_TABLE);
173 $this->main_tpl->setContent(
174 $this->ui_renderer->render($listing->getComponents())
183 $this->main_tpl->setOnScreenMessage(
'failure', $this->
language->txt(
'msg_no_perm_read'),
true);
184 $this->
ctrl->redirect($this, self::CMD_INDEX);
187 $this->irss->consume()->download($rid)->run();
193 $rid = $this->wrapper->query()->has(self::P_RESOURCE_ID) ? $this->wrapper->query()->retrieve(
196 ) : ($this->wrapper->post()->has(self::P_RESOURCE_ID)
197 ? $this->wrapper->post()->retrieve(self::P_RESOURCE_ID, $this->
refinery->to()->string())
204 return $this->irss->manage()->find($rid);
ilGlobalTemplateInterface $main_tpl
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ResourceCollection.
ResourceStakeholder $stakeholder
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ArrayBasedRequestWrapper $query
Class ResourceIdentification.
ILIAS HTTP Services $http
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ResourceCollection $collection
Interface ResourceStakeholder.
getLocationURIForResourceUsage(ResourceIdentification $identification)
getResourceIdFromRequest()