121 $database =
$DIC->database();
124 if (
null === $logger) {
125 $logger = $logger =
$DIC->logger()->cert();
144 $DIC->filesystem()->web()
154 if (
null === $filesystem) {
155 $filesystem =
$DIC->filesystem()->web();
158 if (
null === $backgroundImageFileService) {
164 $this->backGroundImageFileService = $backgroundImageFileService;
181 $certificateTemplate = $this->templateRepository->fetchCurrentlyUsedCertificate($this->objectId);
183 $command = $this->controller->getCmd();
186 $form->setPreventDoubleSubmission(
false);
187 $form->setFormAction($this->controller->getFormAction($certificateGUI));
188 $form->setTitle($this->
language->txt(
"cert_form_sec_availability"));
189 $form->setMultipart(
true);
190 $form->setTableWidth(
"100%");
191 $form->setId(
"certificate");
194 $form->addItem($active);
197 $import->setRequired(
false);
198 $import->setSuffixes(array(
"zip"));
201 if (strlen($_FILES[
"certificate_import"][
"name"])) {
202 if ($import->checkInput()) {
203 $result = $this->importAction->import($_FILES[
"certificate_import"][
"tmp_name"], $_FILES[
"certificate_import"][
"name"]);
205 $import->setAlert($this->
language->txt(
"certificate_error_import"));
207 $this->controller->redirect($certificateGUI,
"certificateEditor");
211 $form->addItem($import);
213 $formSection = new \ilFormSectionHeaderGUI();
214 $formSection->setTitle($this->
language->txt(
"cert_form_sec_layout"));
215 $form->addItem($formSection);
218 $pageformats = $this->pageFormats->fetchPageFormats();
220 foreach ($pageformats as
$format) {
223 if (strcmp(
$format[
"value"],
"custom") == 0) {
225 $pageheight->setSize(6);
226 $pageheight->setValidationRegexp(
'/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*)))(cm|mm|in|pt|pc|px|em)$/is');
227 $pageheight->setInfo($this->
language->txt(
"certificate_unit_description"));
228 $pageheight->setRequired(
true);
229 $option->addSubitem($pageheight);
232 $pagewidth->setSize(6);
233 $pagewidth->setValidationRegexp(
'/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*)))(cm|mm|in|pt|pc|px|em)$/is');
234 $pagewidth->setInfo($this->
language->txt(
"certificate_unit_description"));
235 $pagewidth->setRequired(
true);
236 $option->addSubitem($pagewidth);
239 $pageformat->addOption($option);
242 $pageformat->setRequired(
true);
244 if (strcmp($command,
"certificateSave") == 0) {
245 $pageformat->checkInput();
248 $form->addItem($pageformat);
251 $bgimage->setRequired(
false);
252 $bgimage->setUseCache(
false);
254 $bgimage->setALlowDeletion(
true);
255 if (!$this->backGroundImageFileService->hasBackgroundImage($certificateTemplate)) {
256 if ($this->globalCertificateSettings->hasBackgroundImage()) {
259 $bgimage->setImage($imagePath);
260 $bgimage->setALlowDeletion(
false);
265 $thumbnailPath = $this->backGroundImageFileService->getBackgroundImageThumbPath();
267 if (!is_file($thumbnailPath)) {
269 $thumbnailPath =
CLIENT_WEB_DIR . $certificateTemplate->getBackgroundImagePath() .
'.thumb.jpg';
270 if (!is_file($thumbnailPath)) {
272 $thumbnailPath = $this->globalCertificateSettings->getDefaultBackgroundImageThumbPath();
273 if (!is_file($thumbnailPath)) {
278 $bgimage->setALlowDeletion(
false);
281 $bgimage->setImage($imagePath);
284 $form->addItem($bgimage);
286 $thumbnailImage =
new ilImageFileInputGUI($this->
language->txt(
'certificate_card_thumbnail_image'),
'certificate_card_thumbnail_image');
287 $thumbnailImage->setRequired(
false);
288 $thumbnailImage->setUseCache(
false);
289 $thumbnailImage->setSuffixes(array(
'svg'));
291 $allowThumbnailDeletion =
false;
293 $cardThumbnailImagePath = $certificateTemplate->getThumbnailImagePath();
294 if (
'' !== $cardThumbnailImagePath) {
295 $presentationThumbnailImagePath =
CLIENT_WEB_DIR . $cardThumbnailImagePath;
297 $allowThumbnailDeletion =
true;
300 $thumbnailImage->setAllowDeletion($allowThumbnailDeletion);
302 $form->addItem($thumbnailImage);
305 $rect->setRequired(
true);
306 $rect->setUseUnits(
true);
307 $rect->setInfo($this->
language->txt(
"certificate_unit_description"));
309 if (strcmp($command,
"certificateSave") == 0) {
313 $form->addItem($rect);
316 $certificate->removePlugin(
'ilimgupload');
317 $certificate->setRequired(
true);
318 $certificate->setRows(20);
319 $certificate->setCols(80);
321 $placeholderHtmlDescription = $this->placeholderDescriptionObject->createPlaceholderHtmlDescription();
323 $placeholderDescriptionInHtml = $placeholderHtmlDescription;
325 $certificate->setInfo($placeholderDescriptionInHtml);
327 $certificate->setUseRte(
true,
'3.4.7');
342 $certificate->setRteTags($tags);
344 if (strcmp($command,
"certificateSave") == 0) {
345 $certificate->checkInput();
348 $form->addItem($certificate);
350 if (
true === $this->hasAdditionalElements) {
351 $formSection = new \ilFormSectionHeaderGUI();
352 $formSection->setTitle($this->
language->txt(
"cert_form_sec_add_features"));
353 $form->addItem($formSection);
356 if ($this->access->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
357 if ($certificateTemplate->isCurrentlyActive()) {
358 $this->toolbar->setFormAction($this->controller->getFormAction($certificateGUI));
361 $preview->setCaption(
'certificate_preview');
362 $preview->setCommand(
'certificatePreview');
363 $this->toolbar->addStickyItem(
$preview);
366 $export->setCaption(
'certificate_export');
367 $export->setCommand(
'certificateExportFO');
368 $this->toolbar->addButtonInstance($export);
371 $delete->setCaption(
'delete');
372 $delete->setCommand(
'certificateDelete');
373 $this->toolbar->addButtonInstance($delete);
375 $form->addCommandButton(
"certificateSave", $this->
language->txt(
"save"));
385 public function save(array $formFields)
395 return $this->formFieldParser->fetchDefaultFormFields($content);
An exception for terminatinating execution or to throw for unit testing.
GUI class to create PDF certificates.
This class provides processing control methods.
Component logger with individual log levels by component id.
Class ilObjCertificateSettings.
This class represents an option in a radio group.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static signFile($path_to_file)
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...
Class ChatMainBarProvider \MainMenu\Provider.