103 $certificateTemplate = $this->templateRepository->fetchCurrentlyUsedCertificate($this->objectId);
105 $command = $this->
ctrl->getCmd();
108 $form->setPreventDoubleSubmission(
false);
109 $form->setFormAction($this->
ctrl->getFormAction($certificateGUI));
110 $form->setTitle($this->
language->txt(
'cert_form_sec_availability'));
111 $form->setMultipart(
true);
112 $form->setTableWidth(
'100%');
113 $form->setId(
'certificate');
116 $form->addItem($active);
120 $import->setSuffixes([
'zip']);
123 if (!empty($_FILES[
'certificate_import'][
'name']) && $import->checkInput()) {
124 $result = $this->importAction->import(
125 $_FILES[
'certificate_import'][
'tmp_name'],
126 $_FILES[
'certificate_import'][
'name']
129 $this->page_template->setOnScreenMessage(
130 $this->page_template::MESSAGE_TYPE_SUCCESS,
131 $this->
language->txt(
'saved_successfully'),
134 $this->
ctrl->redirect($certificateGUI,
'certificateEditor');
136 $this->page_template->setOnScreenMessage(
137 $this->page_template::MESSAGE_TYPE_FAILURE,
138 $this->
language->txt(
'certificate_error_import'),
141 $this->
ctrl->redirect($certificateGUI,
'certificateEditor');
144 $form->addItem($import);
147 $formSection->setTitle($this->
language->txt(
'cert_form_sec_layout'));
148 $form->addItem($formSection);
151 $pageformats = $this->pageFormats->fetchPageFormats();
153 foreach ($pageformats as $format) {
154 $option =
new ilRadioOption($format[
"name"], $format[
"value"]);
156 if (strcmp($format[
"value"],
"custom") === 0) {
158 $pageheight->setSize(6);
159 $pageheight->setValidationRegexp(
'/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*)))(cm|mm|in|pt|pc|px|em)$/is');
160 $pageheight->setInfo($this->
language->txt(
"certificate_unit_description"));
161 $pageheight->setRequired(
true);
162 $option->addSubItem($pageheight);
165 $pagewidth->setSize(6);
166 $pagewidth->setValidationRegexp(
'/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*)))(cm|mm|in|pt|pc|px|em)$/is');
167 $pagewidth->setInfo($this->
language->txt(
"certificate_unit_description"));
168 $pagewidth->setRequired(
true);
169 $option->addSubItem($pagewidth);
172 $pageformat->addOption($option);
175 $pageformat->setRequired(
true);
177 if (strcmp($command,
'certificateSave') === 0) {
178 $pageformat->checkInput();
181 $form->addItem($pageformat);
185 $bgimage->setUseCache(
false);
187 $bgimage->setAllowDeletion(
true);
188 if (!$this->backGroundImageFileService->hasBackgroundImage($certificateTemplate)) {
189 if ($this->global_certificate_settings->hasBackgroundImage()) {
192 $bgimage->setImage($imagePath);
193 $bgimage->setAllowDeletion(
false);
198 $thumbnail_path = $this->backGroundImageFileService->getBackgroundImageThumbPath();
200 if (!is_file($thumbnail_path)) {
202 $thumbnail_path =
CLIENT_WEB_DIR . $certificateTemplate->getBackgroundImagePath() .
'.thumb.jpg';
203 if (!is_file($thumbnail_path)) {
205 $thumbnail_path = $this->global_certificate_settings->getDefaultBackgroundImageThumbPath();
206 if (!is_file($thumbnail_path)) {
208 $thumbnail_path =
'';
211 $bgimage->setALlowDeletion(
false);
214 $bgimage->setImage($imagePath);
217 $form->addItem($bgimage);
220 $this->
language->txt(
'certificate_card_thumbnail_image'),
221 'certificate_card_thumbnail_image' 224 $thumbnailImage->setUseCache(
false);
225 $thumbnailImage->setSuffixes([
'svg']);
227 $allowThumbnailDeletion =
false;
229 $cardThumbnailImagePath = $certificateTemplate->getThumbnailImagePath();
230 if (
'' !== $cardThumbnailImagePath) {
231 $presentationThumbnailImagePath =
CLIENT_WEB_DIR . $cardThumbnailImagePath;
233 $allowThumbnailDeletion =
true;
236 $thumbnailImage->setAllowDeletion($allowThumbnailDeletion);
238 $form->addItem($thumbnailImage);
242 $rect->setUseUnits(
true);
243 $rect->setInfo($this->
language->txt(
'certificate_unit_description'));
245 if (strcmp($command,
'certificateSave') === 0) {
249 $form->addItem($rect);
253 $certificate->setRequired(
true);
254 $certificate->setRows(20);
255 $certificate->setCols(80);
257 $certificate->setInfo(
258 $this->
language->txt(
'certificate_text_info') . $this->placeholderDescriptionObject->createPlaceholderHtmlDescription()
261 $certificate->setUseRte(
true,
'3.4.7');
276 $certificate->setRteTags($tags);
278 if (strcmp($command,
'certificateSave') === 0) {
279 $certificate->checkInput();
282 $form->addItem($certificate);
284 if ($this->hasAdditionalElements) {
286 $formSection->setTitle($this->
language->txt(
'cert_form_sec_add_features'));
287 $form->addItem($formSection);
290 if ($this->
access->checkAccess(
293 $this->httpWrapper->query()->retrieve(
'ref_id', $this->
refinery->kindlyTo()->int())
295 if ($certificateTemplate->isCurrentlyActive()) {
296 $preview_button = $this->ui_factory->button()->standard(
297 $this->
language->txt(
'certificate_preview'),
298 $this->
ctrl->getLinkTarget($certificateGUI,
'certificatePreview')
300 $export_button = $this->ui_factory->button()->standard(
301 $this->
language->txt(
'certificate_export'),
302 $this->
ctrl->getLinkTarget($certificateGUI,
'certificateExportFO')
304 $delete_button = $this->ui_factory->button()->standard(
306 $this->
ctrl->getLinkTarget($certificateGUI,
'certificateDelete')
309 $this->
toolbar->addStickyItem($preview_button);
310 $this->
toolbar->addComponent($export_button);
311 $this->
toolbar->addComponent($delete_button);
313 $form->addCommandButton(
"certificateSave", $this->
language->txt(
"save"));
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
removePlugin(string $a_plugin)
static setTokenMaxLifetimeInSeconds(int $token_max_lifetime_in_seconds)
This class represents a text area property in a property form.
static signFile(string $path_to_file)