ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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
 
Refinery $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.

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: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ download()

ilResourceOverviewGUI::download ( )
private

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

183 : void
184 {
185 $rid = $this->getResourceIdFromRequest();
186 if (!$rid instanceof ResourceIdentification) {
187 $this->main_tpl->setOnScreenMessage('failure', $this->language->txt('msg_no_perm_read'), true);
188 $this->ctrl->redirect($this, self::CMD_INDEX);
189 return;
190 }
191 $this->irss->consume()->download($rid)->run();
192 }

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

Referenced by executeCommand().

+ 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.

97 : void
98 {
99 switch ($this->ctrl->getCmd(self::CMD_INDEX)) {
100 case self::CMD_INDEX:
101 $this->index();
102 break;
104 $this->download();
105 break;
107 $this->showRevisions();
108 break;
110 $this->gotoResource();
111 break;
112 }
113 }

References CMD_DOWNLOAD, CMD_GOTO_RESOURCE, CMD_INDEX, CMD_SHOW_REVISIONS, ILIAS\Repository\ctrl(), download(), index(), and showRevisions().

+ Here is the call graph for this function:

◆ getResourceIdFromRequest()

ilResourceOverviewGUI::getResourceIdFromRequest ( )
private

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

196 {
197 $rid = $this->wrapper->query()->has(self::P_RESOURCE_ID) ? $this->wrapper->query()->retrieve(
198 self::P_RESOURCE_ID,
199 $this->refinery->to()->string()
200 ) : ($this->wrapper->post()->has(self::P_RESOURCE_ID)
201 ? $this->wrapper->post()->retrieve(self::P_RESOURCE_ID, $this->refinery->to()->string())
202 : null);
203
204 if ($rid === null) {
205 return null;
206 }
207
208 return $this->irss->manage()->find($rid);
209 }

References ILIAS\Repository\refinery().

Referenced by download(), and showRevisions().

+ 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.

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 }

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by executeCommand().

+ 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.

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 }

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

Referenced by showRevisions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showRevisions()

ilResourceOverviewGUI::showRevisions ( )
private

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

158 : void
159 {
160 $this->initBackTab();
161
162 $rid = $this->getResourceIdFromRequest();
163 $resource = $this->irss->manage()->getResource($rid);
164
165 $view_definition = new ViewDefinition(
166 self::class,
167 self::CMD_SHOW_REVISIONS,
168 $this->language->txt('resource_overview')
169 );
170 $view_definition->setMode(ViewDefinition::MODE_AS_TABLE);
171 $listing = new RevisionListingUI(
172 $view_definition,
173 $resource
174 );
175
176
177 $this->main_tpl->setContent(
178 $this->ui_renderer->render($listing->getComponents())
179 );
180 }

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

Referenced by executeCommand().

+ 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

Refinery 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'

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

Referenced by executeCommand().

◆ CMD_GOTO_RESOURCE

const ilResourceOverviewGUI::CMD_GOTO_RESOURCE = 'gotoResource'

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

Referenced by executeCommand().

◆ CMD_INDEX

const ilResourceOverviewGUI::CMD_INDEX = 'index'

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

Referenced by executeCommand().

◆ CMD_REMOVE

const ilResourceOverviewGUI::CMD_REMOVE = 'remove'

◆ CMD_SHOW_REVISIONS

const ilResourceOverviewGUI::CMD_SHOW_REVISIONS = 'showRevisions'

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

Referenced by executeCommand().

◆ P_RESOURCE_ID

const ilResourceOverviewGUI::P_RESOURCE_ID = 'irss_resource_id'

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


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