122        $template = $this->templateRepository->fetchCurrentlyUsedCertificate($objectId);
 
  124        $xslfo = 
$template->getCertificateContent();
 
  130            $xlsfo = $this->mathJaxHelper->fillXlsFoContent($xslfo);
 
  132            $pdf_base64 = $this->rpcClientFactoryHelper
 
  133                ->ilFO2PDF(
'RPCTransformationHandler', $xlsfo);
 
  135            $this->utilHelper->deliverData(
 
  140        } 
catch (Exception $e) {
 
  154        string $certificate_text,
 
  158        $insert_tags = $this->placeholderValuesObject->getPlaceholderValuesForPreview($this->
user->getId(), $objectId);
 
  161            $insert_tags[$value[
'ph']] = $this->utilHelper->prepareFormOutput($value[
'name']);
 
  164        foreach ($insert_tags as $placeholderVariable => $value) {
 
  165            $certificate_text = str_replace(
'[' . $placeholderVariable . 
']', $value, $certificate_text);
 
  168        $certificate_text = str_replace(
 
  170            $this->rootDirectory,
 
  174        $backgroundImagePath = 
$template->getBackgroundImagePath();
 
  176        $certificate_text = str_replace(
 
  177            '[BACKGROUND_IMAGE]',
 
  178            $this->rootDirectory . $backgroundImagePath,
 
  182        return $certificate_text;
 
  192        $user_field_definitions = $this->userDefinedFieldsHelper->createInstance();
 
  193        $fds = $user_field_definitions->getDefinitions();
 
  196        foreach ($fds as 
$f) {
 
  197            if (
$f[
'certificate']) {
 
  198                $fields[
$f[
'field_id']] = array(
 
  199                    'name' => 
$f[
'field_name'],
 
  200                    'ph' => 
'[#' . str_replace(
' ', 
'_', strtoupper(
$f[
'field_name'])) . 
']');
 
An exception for terminatinating execution or to throw for unit testing.
exchangeCertificateVariables(string $certificate_text, ilCertificateTemplate $template, int $objectId)
Exchanges the variables in the certificate text with given values.
__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)
getCustomCertificateFields()
Get custom certificate fields.
createPreviewPdf(int $objectId)
Just a wrapper class to create Unit Test for other classes.
Component logger with individual log levels by component id.