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

Public Member Functions

 __construct ()
 
 executeCommand ()
 

Data Fields

const CMD_INDEX = 'index'
 
const CMD_REMOVE = 'remove'
 
const CMD_DOWNLOAD = 'download'
 
const CMD_SHOW_REVISIONS = 'showRevisions'
 
const CMD_GOTO_RESOURCE = 'gotoResource'
 
const P_RESOURCE_ID = 'irss_resource_id'
 

Protected Member Functions

 initBackTab ()
 

Protected Attributes

ilCtrlInterface $ctrl
 
ilLanguage $language
 
Renderer $ui_renderer
 
ilGlobalTemplateInterface $main_tpl
 
Services $irss
 
FileUpload $upload
 
ILIAS HTTP Services $http
 
Factory $refinery
 
ResourceCollection $collection
 
ResourceStakeholder $stakeholder
 
ArrayBasedRequestWrapper $query
 

Private Member Functions

 index ()
 
 showRevisions ()
 
 download ()
 
 getResourceIdFromRequest ()
 

Private Attributes

WrapperFactory $wrapper
 
ilTabsGUI $tabs
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilResourceOverviewGUI::__construct ( )
final

Definition at line 69 of file class.ilResourceOverviewGUI.php.

References $DIC, ILIAS\Repository\ctrl(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\Repository\refinery(), ILIAS\Repository\tabs(), and ILIAS\Repository\upload().

70  {
71  global $DIC;
72  // Services
73  $this->irss = $DIC->resourceStorage();
74  $this->ctrl = $DIC->ctrl();
75  $this->language = $DIC->language();
76  $this->language->loadLanguageModule('irss');
77  $this->main_tpl = $DIC->ui()->mainTemplate();
78  $this->upload = $DIC->upload();
79  $this->wrapper = $DIC->http()->wrapper();
80  $this->refinery = $DIC->refinery();
81  $this->ui_renderer = $DIC->ui()->renderer();
82  $this->tabs = $DIC->tabs();
83  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ download()

ilResourceOverviewGUI::download ( )
private

Definition at line 179 of file class.ilResourceOverviewGUI.php.

References ILIAS\Repository\ctrl(), getResourceIdFromRequest(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by executeCommand().

179  : void
180  {
181  $rid = $this->getResourceIdFromRequest();
182  if (!$rid instanceof ResourceIdentification) {
183  $this->main_tpl->setOnScreenMessage('failure', $this->language->txt('msg_no_perm_read'), true);
184  $this->ctrl->redirect($this, self::CMD_INDEX);
185  return;
186  }
187  $this->irss->consume()->download($rid)->run();
188  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilResourceOverviewGUI::executeCommand ( )
final

Definition at line 97 of file class.ilResourceOverviewGUI.php.

References ILIAS\Repository\ctrl(), download(), index(), and showRevisions().

97  : void
98  {
99  switch ($this->ctrl->getCmd(self::CMD_INDEX)) {
100  case self::CMD_INDEX:
101  $this->index();
102  break;
103  case self::CMD_DOWNLOAD:
104  $this->download();
105  break;
106  case self::CMD_SHOW_REVISIONS:
107  $this->showRevisions();
108  break;
109  case self::CMD_GOTO_RESOURCE:
110  $this->gotoResource();
111  break;
112  }
113  }
+ Here is the call graph for this function:

◆ getResourceIdFromRequest()

ilResourceOverviewGUI::getResourceIdFromRequest ( )
private

Definition at line 191 of file class.ilResourceOverviewGUI.php.

References ILIAS\Repository\refinery().

Referenced by download(), index(), and showRevisions().

192  {
193  $rid = $this->wrapper->query()->has(self::P_RESOURCE_ID) ? $this->wrapper->query()->retrieve(
194  self::P_RESOURCE_ID,
195  $this->refinery->to()->string()
196  ) : ($this->wrapper->post()->has(self::P_RESOURCE_ID)
197  ? $this->wrapper->post()->retrieve(self::P_RESOURCE_ID, $this->refinery->to()->string())
198  : null);
199 
200  if ($rid === null) {
201  return null;
202  }
203 
204  return $this->irss->manage()->find($rid);
205  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index()

ilResourceOverviewGUI::index ( )
private

Definition at line 115 of file class.ilResourceOverviewGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder\getLocationURIForResourceUsage(), getResourceIdFromRequest(), initBackTab(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by executeCommand().

115  : void
116  {
117  $listing = new ResourceListingUI(
118  new ViewDefinition(
119  self::class,
120  self::CMD_INDEX,
121  $this->language->txt('resource_overview')
122  ),
125  );
126 
127  $this->main_tpl->setContent(
128  $this->ui_renderer->render($listing->getComponents())
129  );
130  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initBackTab()

ilResourceOverviewGUI::initBackTab ( )
protected
Exceptions
ilCtrlException

Definition at line 88 of file class.ilResourceOverviewGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Repository\tabs().

Referenced by index(), and showRevisions().

88  : void
89  {
90  $this->tabs->clearTargets();
91  $this->tabs->setBackTarget(
92  $this->language->txt('back'),
93  $this->ctrl->getLinkTarget($this, self::CMD_INDEX)
94  );
95  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showRevisions()

ilResourceOverviewGUI::showRevisions ( )
private

Definition at line 154 of file class.ilResourceOverviewGUI.php.

References getResourceIdFromRequest(), initBackTab(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Services\ResourceStorage\Resources\Listing\ViewDefinition\setMode().

Referenced by executeCommand().

154  : void
155  {
156  $this->initBackTab();
157 
158  $rid = $this->getResourceIdFromRequest();
159  $resource = $this->irss->manage()->getResource($rid);
160 
161  $view_definition = new ViewDefinition(
162  self::class,
163  self::CMD_SHOW_REVISIONS,
164  $this->language->txt('resource_overview')
165  );
166  $view_definition->setMode(ViewDefinition::MODE_AS_TABLE);
167  $listing = new RevisionListingUI(
168  $view_definition,
169  $resource
170  );
171 
172 
173  $this->main_tpl->setContent(
174  $this->ui_renderer->render($listing->getComponents())
175  );
176  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $collection

ResourceCollection ilResourceOverviewGUI::$collection
protected

Definition at line 63 of file class.ilResourceOverviewGUI.php.

◆ $ctrl

ilCtrlInterface ilResourceOverviewGUI::$ctrl
protected

Definition at line 55 of file class.ilResourceOverviewGUI.php.

◆ $http

ILIAS HTTP Services ilResourceOverviewGUI::$http
protected

Definition at line 61 of file class.ilResourceOverviewGUI.php.

◆ $irss

Services ilResourceOverviewGUI::$irss
protected

Definition at line 59 of file class.ilResourceOverviewGUI.php.

◆ $language

ilLanguage ilResourceOverviewGUI::$language
protected

Definition at line 56 of file class.ilResourceOverviewGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ilResourceOverviewGUI::$main_tpl
protected

Definition at line 58 of file class.ilResourceOverviewGUI.php.

◆ $query

ArrayBasedRequestWrapper ilResourceOverviewGUI::$query
protected

Definition at line 65 of file class.ilResourceOverviewGUI.php.

◆ $refinery

Factory ilResourceOverviewGUI::$refinery
protected

Definition at line 62 of file class.ilResourceOverviewGUI.php.

◆ $stakeholder

ResourceStakeholder ilResourceOverviewGUI::$stakeholder
protected

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

◆ $tabs

ilTabsGUI ilResourceOverviewGUI::$tabs
private

Definition at line 67 of file class.ilResourceOverviewGUI.php.

◆ $ui_renderer

Renderer ilResourceOverviewGUI::$ui_renderer
protected

Definition at line 57 of file class.ilResourceOverviewGUI.php.

◆ $upload

FileUpload ilResourceOverviewGUI::$upload
protected

Definition at line 60 of file class.ilResourceOverviewGUI.php.

◆ $wrapper

WrapperFactory ilResourceOverviewGUI::$wrapper
private

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

◆ CMD_DOWNLOAD

const ilResourceOverviewGUI::CMD_DOWNLOAD = 'download'

◆ CMD_GOTO_RESOURCE

const ilResourceOverviewGUI::CMD_GOTO_RESOURCE = 'gotoResource'

◆ CMD_INDEX

const ilResourceOverviewGUI::CMD_INDEX = 'index'

Definition at line 45 of file class.ilResourceOverviewGUI.php.

◆ CMD_REMOVE

const ilResourceOverviewGUI::CMD_REMOVE = 'remove'

◆ CMD_SHOW_REVISIONS

const ilResourceOverviewGUI::CMD_SHOW_REVISIONS = 'showRevisions'

◆ P_RESOURCE_ID

const ilResourceOverviewGUI::P_RESOURCE_ID = 'irss_resource_id'

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