81 string $certificatePath,
104 $database = $DIC->database();
107 if (null === $logger) {
108 $logger = $logger = $DIC->logger()->cert();
125 $placeholderDescriptionObject,
127 $DIC->filesystem()->web()
151 $certificateTemplate = $this->templateRepository->fetchCurrentlyUsedCertificate($this->objectId);
153 $command = $this->controller->getCmd();
156 $form->setPreventDoubleSubmission(
false);
157 $form->setFormAction($this->controller->getFormAction($certificateGUI));
158 $form->setTitle($this->
language->txt(
"cert_form_sec_availability"));
159 $form->setMultipart(
true);
160 $form->setTableWidth(
"100%");
161 $form->setId(
"certificate");
164 $form->addItem($active);
168 $import->setSuffixes(array(
"zip"));
171 if (strlen($_FILES[
"certificate_import"][
"name"])) {
172 if ($import->checkInput()) {
173 $result = $this->importAction->import($_FILES[
"certificate_import"][
"tmp_name"], $_FILES[
"certificate_import"][
"name"]);
175 $import->setAlert($this->
language->txt(
"certificate_error_import"));
177 $this->controller->redirect($certificateGUI,
"certificateEditor");
181 $form->addItem($import);
183 $formSection = new \ilFormSectionHeaderGUI();
184 $formSection->setTitle($this->
language->txt(
"cert_form_sec_layout"));
185 $form->addItem($formSection);
188 $pageformats = $this->pageFormats->fetchPageFormats();
190 foreach ($pageformats as
$format) {
191 $option =
new ilRadioOption($format[
"name"], $format[
"value"]);
193 if (strcmp($format[
"value"],
"custom") == 0) {
196 $pageheight->setValidationRegexp(
'/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*)))(cm|mm|in|pt|pc|px|em)$/is');
197 $pageheight->setInfo($this->
language->txt(
"certificate_unit_description"));
198 $pageheight->setRequired(
true);
199 $option->addSubitem($pageheight);
203 $pagewidth->setValidationRegexp(
'/^(([1-9]+|([1-9]+[0]*[\.,]{0,1}[\d]+))|(0[\.,](0*[1-9]+[\d]*)))(cm|mm|in|pt|pc|px|em)$/is');
204 $pagewidth->setInfo($this->
language->txt(
"certificate_unit_description"));
205 $pagewidth->setRequired(
true);
206 $option->addSubitem($pagewidth);
209 $pageformat->addOption($option);
212 $pageformat->setRequired(
true);
214 if (strcmp($command,
"certificateSave") == 0) {
215 $pageformat->checkInput();
218 $form->addItem($pageformat);
222 $bgimage->setUseCache(
false);
224 $bgimage->setALlowDeletion(
true);
229 $bgimage->setImage($imagePath);
230 $bgimage->setALlowDeletion(
false);
237 if (!file_exists($thumbnailPath)) {
239 $bgimage->setALlowDeletion(
false);
242 $bgimage->setImage($imagePath);
245 $form->addItem($bgimage);
247 $thumbnailImage =
new ilImageFileInputGUI($this->
language->txt(
'certificate_card_thumbnail_image'),
'certificate_card_thumbnail_image');
249 $thumbnailImage->setUseCache(
false);
250 $thumbnailImage->setSuffixes(array(
'svg'));
252 $allowThumbnailDeletion =
false;
254 $cardThumbnailImagePath = $certificateTemplate->getThumbnailImagePath();
255 if (
'' !== $cardThumbnailImagePath) {
256 $presentationThumbnailImagePath = CLIENT_WEB_DIR . $cardThumbnailImagePath;
258 $allowThumbnailDeletion =
true;
261 $thumbnailImage->setAllowDeletion($allowThumbnailDeletion);
263 $form->addItem($thumbnailImage);
267 $rect->setUseUnits(
true);
268 $rect->setInfo($this->
language->txt(
"certificate_unit_description"));
270 if (strcmp($command,
"certificateSave") == 0) {
274 $form->addItem($rect);
283 $placeholderHtmlDescription = $this->placeholderDescriptionObject->createPlaceholderHtmlDescription();
285 $placeholderDescriptionInHtml = $placeholderHtmlDescription;
306 if (strcmp($command,
"certificateSave") == 0) {
312 if ($certificateObject->
getAdapter()->hasAdditionalFormElements()) {
313 $formSection = new \ilFormSectionHeaderGUI();
314 $formSection->setTitle($this->
language->txt(
"cert_form_sec_add_features"));
315 $form->addItem($formSection);
318 if ($this->access->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
319 if ($certificateTemplate->isCurrentlyActive()) {
320 $this->toolbar->setFormAction($this->controller->getFormAction($certificateGUI));
323 $preview->setCaption(
'certificate_preview');
324 $preview->setCommand(
'certificatePreview');
325 $this->toolbar->addStickyItem(
$preview);
328 $export->setCaption(
'certificate_export');
329 $export->setCommand(
'certificateExportFO');
330 $this->toolbar->addButtonInstance($export);
333 $delete->setCaption(
'delete');
334 $delete->setCommand(
'certificateDelete');
335 $this->toolbar->addButtonInstance($delete);
337 $form->addCommandButton(
"certificateSave", $this->
language->txt(
"save"));
347 public function save(array $formFields)
357 return $this->formFieldParser->fetchDefaultFormFields($content);
This class represents an option in a radio group.
This class provides processing control methods.
static getBackgroundImageThumbPath()
Returns the filesystem path of the background image thumbnail.
hasBackgroundImage()
Checks for the background image of the certificate.
getBackgroundImageThumbPath()
Returns the filesystem path of the background image thumbnail.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
getAdapter()
Gets the adapter.
if(isset($_POST['submit'])) $form
special template class to simplify handling of ITX/PEAR
setSize($a_size)
Set Size.
This class represents a text property in a property form.
GUI class to create PDF certificates.
static getBackgroundImageThumbPathWeb()
Returns the web path of the background image thumbnail.
static signFile($path_to_file)
static hasBackgroundImage()
Returns wheather or not a default background image exists.
This class represents a text area property in a property form.
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
Component logger with individual log levels by component id.