89 $logger = $DIC->logger()->cert();
134 $template = $this->templateRepository->fetchCurrentlyUsedCertificate($objectId);
136 $xslfo = $template->getCertificateContent();
142 $xlsfo = $this->mathJaxHelper->fillXlsFoContent($xslfo);
144 $pdf_base64 = $this->rpcClientFactoryHelper
145 ->ilFO2PDF(
'RPCTransformationHandler', $xlsfo);
148 $template->getObjId(),
149 $template->getObjType(),
155 $this->utilHelper->deliverData(
157 $this->pdfFileNameFactory->create($pdfPresentation),
174 string $certificate_text,
178 $insert_tags = $this->placeholderValuesObject->getPlaceholderValuesForPreview($this->
user->getId(), $objectId);
181 $insert_tags[$value[
'ph']] = $this->utilHelper->prepareFormOutput($value[
'name']);
184 foreach ($insert_tags as $placeholderVariable => $value) {
185 $certificate_text = str_replace(
'[' . $placeholderVariable .
']', $value, $certificate_text);
188 $certificate_text = str_replace(
190 $this->rootDirectory,
196 $certificate_text = str_replace(
197 '[BACKGROUND_IMAGE]',
198 $this->rootDirectory . $backgroundImagePath,
202 return $certificate_text;
212 $user_field_definitions = $this->userDefinedFieldsHelper->createInstance();
213 $fds = $user_field_definitions->getDefinitions();
216 foreach ($fds as
$f) {
217 if ($f[
'certificate']) {
218 $fields[$f[
'field_id']] = array(
219 'name' => $f[
'field_name'],
220 'ph' =>
'[#' . str_replace(
' ',
'_', strtoupper($f[
'field_name'])) .
']');
getCustomCertificateFields()
Get custom certificate fields.
exchangeCertificateVariables(string $certificate_text, ilCertificateTemplate $template, int $objectId)
Exchanges the variables in the certificate text with given values.
createPreviewPdf(int $objectId)
Just a wrapper class to create Unit Test for other classes.
__construct(ilCertificateTemplateRepository $templateRepository, ilCertificatePlaceholderValues $placeholderValuesObject, ilLogger $logger=null, ilObjUser $user=null, ilCertificateUtilHelper $utilHelper=null, ilCertificateMathJaxHelper $mathJaxHelper=null, ilCertificateUserDefinedFieldsHelper $userDefinedFieldsHelper=null, ilCertificateRpcClientFactoryHelper $rpcClientFactoryHelper=null, string $rootDirectory=CLIENT_WEB_DIR, ilCertificatePdfFileNameFactory $pdfFileNameFactory=null)
Component logger with individual log levels by component id.