ILIAS  release_8 Revision v8.24
ilWebDAVMountInstructionsUploadGUI Class Reference
+ Collaboration diagram for ilWebDAVMountInstructionsUploadGUI:

Public Member Functions

 __construct (ilGlobalTemplateInterface $tpl, ilObjUser $user, ilCtrlInterface $ctrl, ilLanguage $lng, ilRbacSystem $rbacsystem, ilErrorHandling $error, ilLogger $log, ilToolbarGUI $toolbar, Services $http, RefineryFactory $refinery, UIServices $ui, Filesystems $file_systems, FileUpload $file_upload, ilWebDAVMountInstructionsRepository $mount_instructions_repository)
 
 executeCommand ()
 
 setRefId (int $ref_id)
 
 saveDocumentSorting ()
 

Data Fields

const ACTION_SAVE_ADD_DOCUMENT_FORM = 'saveAddDocumentForm'
 
const ACTION_SAVE_EDIT_DOCUMENT_FORM = 'saveEditDocumentForm'
 

Protected Member Functions

 showDocuments ()
 
 getDocumentForm (ilWebDAVMountInstructionsDocument $a_document)
 
 showAddDocumentForm ()
 
 showEditDocumentForm ()
 
 saveAddDocumentForm ()
 
 saveEditDocumentForm ()
 
 deleteDocument ()
 

Private Attributes

ilGlobalTemplateInterface $tpl
 
ilObjUser $user
 
ilCtrlInterface $ctrl
 
ilLanguage $lng
 
ilRbacSystem $rbacsystem
 
ilErrorHandling $error
 
ilLogger $log
 
ilToolbarGUI $toolbar
 
Services $http
 
RefineryFactory $refinery
 
UIFactory $ui_factory
 
Renderer $ui_renderer
 
Filesystems $file_systems
 
FileUpload $file_upload
 
ilWebDAVMountInstructionsRepository $mount_instructions_repository
 
int $webdav_object_ref_id
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilWebDAVMountInstructionsUploadGUI::__construct ( ilGlobalTemplateInterface  $tpl,
ilObjUser  $user,
ilCtrlInterface  $ctrl,
ilLanguage  $lng,
ilRbacSystem  $rbacsystem,
ilErrorHandling  $error,
ilLogger  $log,
ilToolbarGUI  $toolbar,
Services  $http,
RefineryFactory  $refinery,
UIServices  $ui,
Filesystems  $file_systems,
FileUpload  $file_upload,
ilWebDAVMountInstructionsRepository  $mount_instructions_repository 
)

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

70 {
71 $this->tpl = $tpl;
72 $this->ctrl = $ctrl;
73 $this->lng = $lng;
74 $this->rbacsystem = $rbacsystem;
75 $this->error = $error;
76 $this->user = $user;
77 $this->log = $log;
78 $this->toolbar = $toolbar;
79 $this->http = $http;
80 $this->refinery = $refinery;
81 $this->ui_factory = $ui->factory();
82 $this->ui_renderer = $ui->renderer();
83 $this->file_systems = $file_systems;
84 $this->file_upload = $file_upload;
85 $this->mount_instructions_repository = $mount_instructions_repository;
86
87 $this->lng->loadLanguageModule('meta');
88 }
renderer()
Get a renderer for UI components.
Definition: UIServices.php:43
factory()
Get the factory that crafts UI components.
Definition: UIServices.php:35
error(string $a_errmsg)
ilWebDAVMountInstructionsRepository $mount_instructions_repository
static http()
Fetches the global http state from ILIAS.

References $ctrl, $error, $file_systems, $file_upload, $http, $lng, $log, $mount_instructions_repository, $rbacsystem, $refinery, $toolbar, $tpl, $user, ILIAS\Repository\ctrl(), error(), ILIAS\DI\UIServices\factory(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\DI\UIServices\renderer(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ deleteDocument()

ilWebDAVMountInstructionsUploadGUI::deleteDocument ( )
protected

Definition at line 244 of file class.ilWebDAVMountInstructionsUploadGUI.php.

244 : void
245 {
246 if (!$this->rbacsystem->checkAccess('delete', $this->webdav_object_ref_id)) {
247 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
248 }
249
250 $document_id = $this->http->wrapper()->query()->retrieve('document_id', $this->refinery->kindlyTo()->int());
251
252 $this->mount_instructions_repository->deleteMountInstructionsById($document_id);
253 $this->tpl->setOnScreenMessage('success', $this->lng->txt('deleted_successfully'), true);
254 $this->ctrl->redirect($this, 'showDocuments');
255 }

References ILIAS\Repository\ctrl(), error(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ executeCommand()

ilWebDAVMountInstructionsUploadGUI::executeCommand ( )

Definition at line 93 of file class.ilWebDAVMountInstructionsUploadGUI.php.

93 : void
94 {
95 $cmd = $this->ctrl->getCmd();
96
97 if (!$this->rbacsystem->checkAccess('read', $this->webdav_object_ref_id)) {
98 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
99 }
100
101 if ($cmd == 'delete') {
102 $cmd .= 'Document';
103 }
104 if ($cmd == '' || !method_exists($this, $cmd)) {
105 $cmd = 'showDocuments';
106 }
107 $this->$cmd();
108 }

References ILIAS\Repository\ctrl(), error(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getDocumentForm()

ilWebDAVMountInstructionsUploadGUI::getDocumentForm ( ilWebDAVMountInstructionsDocument  $a_document)
protected

Definition at line 145 of file class.ilWebDAVMountInstructionsUploadGUI.php.

146 {
147 if ($a_document->getId() > 0) {
148 $this->ctrl->setParameter($this, 'doc_id', $a_document->getId());
149
150 $form_action = $this->ctrl->getFormAction($this, self::ACTION_SAVE_EDIT_DOCUMENT_FORM);
152 } else {
153 $form_action = $this->ctrl->getFormAction($this, self::ACTION_SAVE_ADD_DOCUMENT_FORM);
155 }
156
158 $a_document,
159 $this->mount_instructions_repository,
161 $this->user,
162 $this->file_systems->temp(),
163 $this->file_upload,
164 $form_action,
165 $save_command,
166 'showDocuments',
167 $this->rbacsystem->checkAccess('write', $this->webdav_object_ref_id)
168 );
169
170 return $form;
171 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ACTION_SAVE_ADD_DOCUMENT_FORM, ACTION_SAVE_EDIT_DOCUMENT_FORM, ILIAS\Repository\ctrl(), ilWebDAVMountInstructionsDocument\getId(), and ILIAS\Repository\user().

Referenced by saveAddDocumentForm(), saveEditDocumentForm(), showAddDocumentForm(), and showEditDocumentForm().

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

◆ saveAddDocumentForm()

ilWebDAVMountInstructionsUploadGUI::saveAddDocumentForm ( )
protected

Definition at line 198 of file class.ilWebDAVMountInstructionsUploadGUI.php.

198 : void
199 {
200 if (!$this->rbacsystem->checkAccess('write', $this->webdav_object_ref_id)) {
201 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
202 }
203
205 if ($form->saveObject()) {
206 $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
207 if ($form->hasTranslatedInfo()) {
208 $this->tpl->setOnScreenMessage('info', $form->getTranslatedInfo(), true);
209 }
210 $this->ctrl->redirect($this, 'showDocuments');
211 } elseif ($form->hasTranslatedError()) {
212 $this->tpl->setOnScreenMessage('failure', $form->getTranslatedError(), true);
213 }
214
215 $html = $form->getHTML();
216 $this->tpl->setContent($html);
217 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDocumentForm(ilWebDAVMountInstructionsDocument $a_document)

References ILIAS\Repository\ctrl(), error(), getDocumentForm(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ saveDocumentSorting()

ilWebDAVMountInstructionsUploadGUI::saveDocumentSorting ( )

Definition at line 257 of file class.ilWebDAVMountInstructionsUploadGUI.php.

257 : void
258 {
259 if (!$this->rbacsystem->checkAccess('write', $this->webdav_object_ref_id)) {
260 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
261 }
262
263 $sorting = $this->http->request()->getParsedBody()['sorting'] ?? [];
264 if (!is_array($sorting) || 0 === count($sorting)) {
265 $this->showDocuments();
266 return;
267 }
268
269 // Sort array by give sort value
270 asort($sorting, SORT_NUMERIC);
271
272 $position = 0;
273 foreach ($sorting as $document_id => $ignored_sort_value) {
274
275 // Only accept numbers
276 if (!is_numeric($document_id)) {
277 continue;
278 }
279
280 $this->mount_instructions_repository->updateSortingValueById((int) $document_id, ++$position);
281 }
282
283 $this->tpl->setOnScreenMessage('success', $this->lng->txt('webdav_saved_sorting'), true);
284 $this->ctrl->redirect($this);
285 }

References ILIAS\Repository\ctrl(), error(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and showDocuments().

+ Here is the call graph for this function:

◆ saveEditDocumentForm()

ilWebDAVMountInstructionsUploadGUI::saveEditDocumentForm ( )
protected

Definition at line 222 of file class.ilWebDAVMountInstructionsUploadGUI.php.

222 : void
223 {
224 if (!$this->rbacsystem->checkAccess('write', $this->webdav_object_ref_id)) {
225 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
226 }
227
228 $document_id = $this->http->wrapper()->query()->retrieve('document_id', $this->refinery->kindlyTo()->int());
229 $form = $this->getDocumentForm($this->mount_instructions_repository->getMountInstructionsDocumentById($document_id));
230 if ($form->updateObject()) {
231 $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
232 if ($form->hasTranslatedInfo()) {
233 $this->tpl->setOnScreenMessage('info', $form->getTranslatedInfo(), true);
234 }
235 $this->ctrl->redirect($this, 'showDocuments');
236 } elseif ($form->hasTranslatedError()) {
237 $this->tpl->setOnScreenMessage('failure', $form->getTranslatedError(), true);
238 }
239
240 $html = $form->getHTML();
241 $this->tpl->setContent($html);
242 }

References ILIAS\Repository\ctrl(), error(), getDocumentForm(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ setRefId()

ilWebDAVMountInstructionsUploadGUI::setRefId ( int  $ref_id)

Definition at line 110 of file class.ilWebDAVMountInstructionsUploadGUI.php.

110 : void
111 {
112 $this->webdav_object_ref_id = $ref_id;
113 }
$ref_id
Definition: ltiauth.php:67

References $ref_id.

◆ showAddDocumentForm()

ilWebDAVMountInstructionsUploadGUI::showAddDocumentForm ( )
protected

Definition at line 173 of file class.ilWebDAVMountInstructionsUploadGUI.php.

173 : void
174 {
175 if (!$this->rbacsystem->checkAccess('write', $this->webdav_object_ref_id)) {
176 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
177 }
178
180 $this->tpl->setContent($form->getHTML());
181 }

References error(), getDocumentForm(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ showDocuments()

ilWebDAVMountInstructionsUploadGUI::showDocuments ( )
protected
Exceptions
ilTemplateException

Definition at line 118 of file class.ilWebDAVMountInstructionsUploadGUI.php.

118 : void
119 {
120 if ($this->rbacsystem->checkAccess('write', $this->webdav_object_ref_id)) {
121 $addDocumentBtn = ilLinkButton::getInstance();
122 $addDocumentBtn->setPrimary(true);
123 $addDocumentBtn->setUrl($this->ctrl->getLinkTarget($this, 'showAddDocumentForm'));
124 $addDocumentBtn->setCaption('webdav_add_instructions_btn_label');
125 $this->toolbar->addStickyItem($addDocumentBtn);
126 }
127
128 $uri_builder = new ilWebDAVUriBuilder($this->http->request());
129
130 $document_tbl_gui = new ilWebDAVMountInstructionsDocumentTableGUI(
131 $this,
132 $uri_builder,
133 'showDocuments',
134 $this->ui_factory,
135 $this->ui_renderer,
136 $this->http->request(),
137 $this->rbacsystem->checkAccess('write', $this->webdav_object_ref_id)
138 );
139 $document_tbl_gui->setProvider(new ilWebDAVMountInstructionsTableDataProvider($this->mount_instructions_repository));
140 $document_tbl_gui->populate();
141
142 $this->tpl->setContent($document_tbl_gui->getHTML());
143 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), ilLinkButton\getInstance(), ILIAS\FileDelivery\http(), and ILIAS\Repository\toolbar().

Referenced by saveDocumentSorting().

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

◆ showEditDocumentForm()

ilWebDAVMountInstructionsUploadGUI::showEditDocumentForm ( )
protected

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

183 : void
184 {
185 if (!$this->rbacsystem->checkAccess('write', $this->webdav_object_ref_id)) {
186 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
187 }
188
189 $document_id = $this->http->wrapper()->query()->retrieve('document_id', $this->refinery->kindlyTo()->int());
190 $document = $this->mount_instructions_repository->getMountInstructionsDocumentById($document_id);
191 $form = $this->getDocumentForm($document);
192 $this->tpl->setContent($form->getHTML());
193 }

References error(), getDocumentForm(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrlInterface ilWebDAVMountInstructionsUploadGUI::$ctrl
private

Definition at line 40 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by __construct().

◆ $error

ilErrorHandling ilWebDAVMountInstructionsUploadGUI::$error
private

Definition at line 43 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by __construct().

◆ $file_systems

Filesystems ilWebDAVMountInstructionsUploadGUI::$file_systems
private

Definition at line 50 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by __construct().

◆ $file_upload

FileUpload ilWebDAVMountInstructionsUploadGUI::$file_upload
private

Definition at line 51 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by __construct().

◆ $http

Services ilWebDAVMountInstructionsUploadGUI::$http
private

Definition at line 46 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by __construct().

◆ $lng

ilLanguage ilWebDAVMountInstructionsUploadGUI::$lng
private

Definition at line 41 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by __construct().

◆ $log

ilLogger ilWebDAVMountInstructionsUploadGUI::$log
private

Definition at line 44 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by __construct().

◆ $mount_instructions_repository

ilWebDAVMountInstructionsRepository ilWebDAVMountInstructionsUploadGUI::$mount_instructions_repository
private

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

Referenced by __construct().

◆ $rbacsystem

ilRbacSystem ilWebDAVMountInstructionsUploadGUI::$rbacsystem
private

Definition at line 42 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by __construct().

◆ $refinery

RefineryFactory ilWebDAVMountInstructionsUploadGUI::$refinery
private

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

Referenced by __construct().

◆ $toolbar

ilToolbarGUI ilWebDAVMountInstructionsUploadGUI::$toolbar
private

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

Referenced by __construct().

◆ $tpl

ilGlobalTemplateInterface ilWebDAVMountInstructionsUploadGUI::$tpl
private

Definition at line 38 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by __construct().

◆ $ui_factory

UIFactory ilWebDAVMountInstructionsUploadGUI::$ui_factory
private

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

◆ $ui_renderer

Renderer ilWebDAVMountInstructionsUploadGUI::$ui_renderer
private

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

◆ $user

ilObjUser ilWebDAVMountInstructionsUploadGUI::$user
private

Definition at line 39 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by __construct().

◆ $webdav_object_ref_id

int ilWebDAVMountInstructionsUploadGUI::$webdav_object_ref_id
private

Definition at line 53 of file class.ilWebDAVMountInstructionsUploadGUI.php.

◆ ACTION_SAVE_ADD_DOCUMENT_FORM

const ilWebDAVMountInstructionsUploadGUI::ACTION_SAVE_ADD_DOCUMENT_FORM = 'saveAddDocumentForm'

Definition at line 35 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by getDocumentForm().

◆ ACTION_SAVE_EDIT_DOCUMENT_FORM

const ilWebDAVMountInstructionsUploadGUI::ACTION_SAVE_EDIT_DOCUMENT_FORM = 'saveEditDocumentForm'

Definition at line 36 of file class.ilWebDAVMountInstructionsUploadGUI.php.

Referenced by getDocumentForm().


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