49 $language->loadLanguageModule(
'certificate');
53 if (null === $defaultPlaceholderValues) {
72 $this->defaultPlaceholderValuesObject = $defaultPlaceholderValues;
90 $object = $this->objectHelper->getInstanceByObjId($objId);
92 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValues($userId, $objId);
93 $latest_progress = array_reduce(
94 $object->getProgressesOf($userId),
95 function ($one, $other) {
96 if ($one !== null && $one->isSuccessful() && $other !== null && $other->isSuccessful()) {
98 $one->getCompletionDate()->format(
'Y-m-d H:i:s') > $other->getCompletionDate()->format(
'Y-m-d H:i:s') ?
102 if ($one !== null && $one->isSuccessful()) {
105 if ($other !== null && $other->isSuccessful()) {
111 $type = $object->getSubType();
116 $placeholders[
'PRG_COMPLETION_DATE'] =
ilUtil::prepareFormOutput($latest_progress->getCompletionDate() instanceof \DateTime ? $latest_progress->getCompletionDate()->format(
'd.m.Y') :
'');
117 $placeholders[
'PRG_EXPIRES_AT'] =
ilUtil::prepareFormOutput($latest_progress->getValidityOfQualification() instanceof \DateTime ? $latest_progress->getValidityOfQualification()->format(
'd.m.Y') :
'');
118 return $placeholders;
132 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValuesForPreview($userId, $objId);
134 $object = $this->objectHelper->getInstanceByObjId($objId);
135 $type = $object->getSubType();
141 $placeholders[
'PRG_COMPLETION_DATE'] = $today;
142 $placeholders[
'PRG_EXPIRES_AT'] = $today;
143 return $placeholders;
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
Collection of basic placeholder values that can be used.
__construct(ilDefaultPlaceholderValues $defaultPlaceholderValues=null, ilLanguage $language=null, ilCertificateObjectHelper $objectHelper=null, ilCertificateParticipantsHelper $participantsHelper=null, ilCertificateUtilHelper $ilUtilHelper=null)
$defaultPlaceholderValuesObject
getPlaceholderValuesForPreview(int $userId, int $objId)
This method is different then the 'getPlaceholderValues' method, this method is used to create a plac...
Just a wrapper class to create Unit Test for other classes.
getPlaceholderValues(int $userId, int $objId)
This method MUST return an array that contains the actual data for the given user of the given object...