ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjPersistentCertificateVerificationGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 {
30 
31  public function __construct(
32  ?Container $dic = null,
33  ?ilPortfolioCertificateFileService $fileService = null,
34  ?ilLanguage $language = null
35  ) {
36  if (null === $dic) {
37  global $DIC;
38  $dic = $DIC;
39  }
40 
41  if (null === $fileService) {
42  $fileService = new ilPortfolioCertificateFileService();
43  }
44  $this->fileService = $fileService;
45 
46  if (null === $language) {
47  $language = $dic->language();
48  }
49  $this->language = $language;
50  }
51 
59  public function downloadFromPortfolioPage(ilPortfolioPage $a_page, int $objectId, int $userId): void
60  {
61  if (ilPCVerification::isInPortfolioPage($a_page, 'crta', $objectId)) {
62  $this->fileService->deliverCertificate($userId, $objectId);
63  }
64 
65  throw new ilException($this->language->txt('permission_denied'));
66  }
67 }
downloadFromPortfolioPage(ilPortfolioPage $a_page, int $objectId, int $userId)
static isInPortfolioPage(ilPortfolioPage $a_page, string $a_type, int $a_id)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$dic
Definition: result.php:32
__construct(?Container $dic=null, ?ilPortfolioCertificateFileService $fileService=null, ?ilLanguage $language=null)