19 declare(strict_types=1);
40 string $certificatePath,
51 if (null === $objectHelper) {
56 if (null === $utilHelper) {
74 $type = $this->objectHelper->lookupType($this->objectId);
77 $exportPath = $this->certificatePath . $time .
'__' . $installationId .
'__' .
$type .
'__' . $certificateId .
'__certificate/';
81 $template = $this->templateRepository->fetchCurrentlyUsedCertificate($this->objectId);
83 $xslContent = $template->getCertificateContent();
85 $this->
filesystem->put($exportPath .
'certificate.xml', $xslContent);
87 $backgroundImagePath = $template->getBackgroundImagePath();
88 if ($backgroundImagePath !==
'' &&
true === $this->
filesystem->has($backgroundImagePath)) {
89 $this->
filesystem->copy($backgroundImagePath, $exportPath .
'background.jpg');
92 $thumbnailImagePath = $template->getThumbnailImagePath();
93 if ($thumbnailImagePath !==
'' &&
true === $this->
filesystem->has($backgroundImagePath)) {
94 $this->
filesystem->copy($thumbnailImagePath, $exportPath .
'thumbnail.svg');
97 $objectType = $this->objectHelper->lookupType($this->objectId);
99 $zipFileName = $time .
'__' . $installationId .
'__' . $objectType .
'__' . $this->objectId .
'__certificate.zip';
101 $zipPath = $rootDir . $this->certificatePath . $zipFileName;
102 $this->utilHelper->zip($exportPath, $zipPath);
105 $this->utilHelper->deliverFile($zipPath, $zipFileName,
'application/zip');
export(string $rootDir=CLIENT_WEB_DIR, string $installationId=IL_INST_ID)
Creates a downloadable file via the browser.
ilCertificateTemplateRepository $templateRepository
ilCertificateUtilHelper $utilHelper
Just a wrapper class to create Unit Test for other classes.
__construct(int $objectId, string $certificatePath, ilCertificateTemplateRepository $templateRepository, Filesystem $filesystem, ?ilCertificateObjectHelper $objectHelper=null, ?ilCertificateUtilHelper $utilHelper=null)
Class FlySystemFileAccessTest disabled disabled disabled.
ilCertificateObjectHelper $objectHelper