GUI class to create PDF certificates.
More...
|
| __construct (ilCertificatePlaceholderDescription $placeholderDescriptionObject, ilCertificatePlaceholderValues $placeholderValuesObject, int $objectId, string $certificatePath, ?ilCertificateFormRepository $settingsFormFactory=null, ?ilCertificateDeleteAction $deleteAction=null, ?ilCertificateTemplateRepository $templateRepository=null, ?ilPageFormats $pageFormats=null, ?ilXlsFoParser $xlsFoParser=null, ?ilCertificateTemplateExportAction $exportAction=null, ?ilCertificateBackgroundImageUpload $upload=null, ?ilCertificateTemplatePreviewAction $previewAction=null, ?FileUpload $fileUpload=null, ?ilSetting $settings=null, ?ilCertificateBackgroundImageDelete $backgroundImageDelete=null, ?Filesystem $fileSystem=null, ?ilCertificateBackgroundImageFileService $imageFileService=null, ?Filesystem $tmp_file_system=null) |
|
| executeCommand () |
|
| getCommand ($cmd) |
|
| certificateImport () |
|
| certificatePreview () |
|
| certificateExportFO () |
| Exports the certificate. More...
|
|
| certificateRemoveBackground () |
|
| certificateDelete () |
|
| certificateDeleteConfirm () |
| Deletes the certificate and all its data. More...
|
|
| certificateSave () |
| Saves the certificate. More...
|
|
| certificateUpload () |
|
◆ __construct()
ilCertificateGUI::__construct |
( |
ilCertificatePlaceholderDescription |
$placeholderDescriptionObject, |
|
|
ilCertificatePlaceholderValues |
$placeholderValuesObject, |
|
|
int |
$objectId, |
|
|
string |
$certificatePath, |
|
|
?ilCertificateFormRepository |
$settingsFormFactory = null , |
|
|
?ilCertificateDeleteAction |
$deleteAction = null , |
|
|
?ilCertificateTemplateRepository |
$templateRepository = null , |
|
|
?ilPageFormats |
$pageFormats = null , |
|
|
?ilXlsFoParser |
$xlsFoParser = null , |
|
|
?ilCertificateTemplateExportAction |
$exportAction = null , |
|
|
?ilCertificateBackgroundImageUpload |
$upload = null , |
|
|
?ilCertificateTemplatePreviewAction |
$previewAction = null , |
|
|
?FileUpload |
$fileUpload = null , |
|
|
?ilSetting |
$settings = null , |
|
|
?ilCertificateBackgroundImageDelete |
$backgroundImageDelete = null , |
|
|
?Filesystem |
$fileSystem = null , |
|
|
?ilCertificateBackgroundImageFileService |
$imageFileService = null , |
|
|
?Filesystem |
$tmp_file_system = null |
|
) |
| |
Definition at line 69 of file class.ilCertificateGUI.php.
References $backgroundImageDelete, $certificatePath, $deleteAction, $DIC, $exportAction, $fileSystem, $fileUpload, $logger, $objectId, $pageFormats, $placeholderDescriptionObject, $previewAction, $settings, $settingsFormFactory, $templateRepository, $tmp_file_system, $xlsFoParser, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\refinery(), ILIAS\Repository\settings(), and ILIAS\Repository\toolbar().
90 $this->httpWrapper = $DIC->http()->wrapper();
92 $this->
lng = $DIC[
'lng'];
93 $this->tpl = $DIC[
'tpl'];
94 $this->
ctrl = $DIC[
'ilCtrl'];
95 $this->
ilias = $DIC[
'ilias'];
97 $this->tree = $DIC[
'tree'];
98 $this->
access = $DIC[
'ilAccess'];
99 $this->
toolbar = $DIC[
'ilToolbar'];
103 $this->
lng->loadLanguageModule(
'certificate');
104 $this->
lng->loadLanguageModule(
'cert');
105 $this->
lng->loadLanguageModule(
"trac");
107 $this->ref_id = (
int) $DIC->http()->wrapper()->query()->retrieve(
"ref_id", $DIC->refinery()->kindlyTo()->int());
113 $this->
logger = $DIC->logger()->cert();
124 $placeholderDescriptionObject
149 if (null === $upload) {
157 $this->backgroundImageUpload = $upload;
163 $this->templateRepository,
164 $DIC->filesystem()->web()
192 if (null === $imageFileService) {
194 $this->certificatePath,
201 $this->certificatePath,
ilCertificateTemplateRepository $templateRepository
ilPageFormats $pageFormats
Filesystem $tmp_file_system
Class ilObjCertificateSettings.
ilCertificateTemplatePreviewAction $previewAction
ilCertificateFormRepository $settingsFormFactory
header include for all ilias files.
ilXlsFoParser $xlsFoParser
ilCertificateDeleteAction $deleteAction
ilCertificateTemplateExportAction $exportAction
ilCertificateBackgroundImageDelete $backgroundImageDelete
ilCertificatePlaceholderDescription $placeholderDescriptionObject
◆ certificateDelete()
ilCertificateGUI::certificateDelete |
( |
| ) |
|
Definition at line 290 of file class.ilCertificateGUI.php.
References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().
294 $cgui->setFormAction($this->
ctrl->getFormAction($this,
"certificateEditor"));
295 $cgui->setHeaderText($this->
lng->txt(
"certificate_confirm_deletion_text"));
296 $cgui->setCancel($this->
lng->txt(
"no"),
"certificateEditor");
297 $cgui->setConfirm($this->
lng->txt(
"yes"),
"certificateDeleteConfirm");
299 $this->tpl->setContent($cgui->getHTML());
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ certificateDeleteConfirm()
ilCertificateGUI::certificateDeleteConfirm |
( |
| ) |
|
Deletes the certificate and all its data.
Definition at line 305 of file class.ilCertificateGUI.php.
References ILIAS\Repository\ctrl().
307 $template = $this->templateRepository->fetchCurrentlyUsedCertificate($this->objectId);
308 $templateId = $template->getId();
310 $this->deleteAction->delete($templateId, $this->objectId);
311 $this->
ctrl->redirect($this,
"certificateEditor");
◆ certificateExportFO()
ilCertificateGUI::certificateExportFO |
( |
| ) |
|
Exports the certificate.
- Exceptions
-
FileAlreadyExistsException | |
FileNotFoundException | |
IOException | |
Definition at line 270 of file class.ilCertificateGUI.php.
272 $this->exportAction->export();
◆ certificateImport()
ilCertificateGUI::certificateImport |
( |
| ) |
|
◆ certificatePreview()
ilCertificateGUI::certificatePreview |
( |
| ) |
|
Definition at line 254 of file class.ilCertificateGUI.php.
References ILIAS\Repository\lng().
257 $this->previewAction->createPreviewPdf($this->objectId);
259 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'error_creating_certificate_pdf'));
260 $this->certificateEditor();
◆ certificateRemoveBackground()
ilCertificateGUI::certificateRemoveBackground |
( |
| ) |
|
- Exceptions
-
Definition at line 284 of file class.ilCertificateGUI.php.
286 $this->backgroundImageDelete->deleteBackgroundImage(null);
287 $this->certificateEditor();
◆ certificateSave()
ilCertificateGUI::certificateSave |
( |
| ) |
|
Saves the certificate.
- Exceptions
-
Definition at line 323 of file class.ilCertificateGUI.php.
References $DIC.
327 $form = $this->settingsFormFactory->createForm(
331 $form->setValuesByPost();
333 $request = $DIC->http()->request();
335 $formFields = $request->getParsedBody();
337 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
339 $this->saveCertificate($form, $formFields, $this->objectId);
◆ certificateUpload()
ilCertificateGUI::certificateUpload |
( |
| ) |
|
◆ createFormatArray()
Definition at line 591 of file class.ilCertificateGUI.php.
References $format, $formats, ilPageFormats\DEFAULT_MARGIN_BODY_BOTTOM, ilPageFormats\DEFAULT_MARGIN_BODY_LEFT, ilPageFormats\DEFAULT_MARGIN_BODY_RIGHT, ilPageFormats\DEFAULT_MARGIN_BODY_TOP, ilCertificateTemplate\getCertificateContent(), ilCertificateTemplate\getCertificateHash(), and ILIAS\Repository\settings().
Referenced by getEditorForm().
595 $formats = $this->pageFormats->fetchPageFormats();
599 'pagewidth' =>
$formats[
'width'] ??
'',
600 'pageheight' =>
$formats[
'height'] ??
'',
608 return $this->settingsFormFactory->fetchFormFieldData($certificateTemplate->
getCertificateContent());
const DEFAULT_MARGIN_BODY_TOP
const DEFAULT_MARGIN_BODY_LEFT
const DEFAULT_MARGIN_BODY_BOTTOM
const DEFAULT_MARGIN_BODY_RIGHT
◆ executeCommand()
ilCertificateGUI::executeCommand |
( |
| ) |
|
◆ getCommand()
ilCertificateGUI::getCommand |
( |
|
$cmd | ) |
|
◆ getEditorForm()
ilCertificateGUI::getEditorForm |
( |
| ) |
|
|
private |
- Returns
- ilPropertyFormGUI
- Exceptions
-
Definition at line 365 of file class.ilCertificateGUI.php.
References $DIC, Vendor\Package\$e, $objId, ilObjUserTracking\_enabledLearningProgress(), ilObject\_lookupType(), ilPropertyFormGUI\checkInput(), createFormatArray(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getHTML(), ilPropertyFormGUI\getInput(), ilObjectFactory\getInstanceByObjId(), ilPropertyFormGUI\getItemByPostVar(), ILIAS_VERSION_NUMERIC, ILIAS\Repository\lng(), ILIAS\Repository\logger(), ilLPObjSettings\LP_MODE_DEACTIVATED, ILIAS\Repository\refinery(), and ilPropertyFormGUI\setValuesByPost().
Referenced by executeCommand().
367 $certificateTemplate = $this->templateRepository->fetchCurrentlyUsedCertificate($this->objectId);
369 $form = $this->settingsFormFactory->createForm(
375 $formFields[
'active'] = $certificateTemplate->isCurrentlyActive();
377 $form->setValuesByArray($formFields);
createFormatArray(ilCertificateTemplate $certificateTemplate)
◆ setTemplateContent()
◆ $access
◆ $backgroundImageDelete
◆ $backgroundImageUpload
◆ $certificatePath
string ilCertificateGUI::$certificatePath |
|
private |
◆ $ctrl
◆ $deleteAction
◆ $exportAction
◆ $fileSystem
◆ $fileUpload
◆ $global_certificate_settings
◆ $httpWrapper
◆ $ilias
ILIAS ilCertificateGUI::$ilias |
|
protected |
◆ $lng
◆ $logger
◆ $objectId
int ilCertificateGUI::$objectId |
|
private |
◆ $pageFormats
◆ $placeholderDescriptionObject
◆ $previewAction
◆ $ref_id
int ilCertificateGUI::$ref_id |
|
protected |
◆ $refinery
Factory ilCertificateGUI::$refinery |
|
private |
◆ $settings
◆ $settingsFormFactory
◆ $templateRepository
◆ $tmp_file_system
◆ $toolbar
◆ $tpl
◆ $tree
ilTree ilCertificateGUI::$tree |
|
protected |
◆ $xlsFoParser
The documentation for this class was generated from the following file: