19 declare(strict_types=1);
37 if (
null === $language) {
38 $language = $DIC->language();
39 $language->loadLanguageModule(
'certificate');
43 if (
null === $defaultPlaceholderDescriptionObject) {
46 $userDefinedFieldPlaceHolderDescriptionObject
49 $this->defaultPlaceHolderDescriptionObject = $defaultPlaceholderDescriptionObject;
51 if (
null === $learningProgressObject) {
56 $this->placeholder = $this->defaultPlaceHolderDescriptionObject->getPlaceholderDescriptions();
58 $this->placeholder[
'SCORM_TITLE'] = $language->txt(
'certificate_ph_scormtitle');
59 $this->placeholder[
'SCORM_POINTS'] = $language->txt(
'certificate_ph_scormpoints');
60 $this->placeholder[
'SCORM_POINTS_MAX'] = $language->txt(
'certificate_ph_scormmaxpoints');
62 $language->txt(
'certificate_ph_date_completed')
65 $language->txt(
'certificate_ph_datetime_completed')
77 if (
null === $template) {
78 $template =
new ilTemplate(
'tpl.scorm_description.html',
true,
true,
'components/ILIAS/Certificate');
81 $template->setCurrentBlock(
'items');
83 foreach ($this->placeholder as
$id => $caption) {
84 $template->setVariable(
'ID',
$id);
85 $template->setVariable(
'TXT', $caption);
86 $template->parseCurrentBlock();
89 $template->setVariable(
'PH_INTRODUCTION', $this->
language->txt(
'certificate_ph_introduction'));
91 $collection = $this->learningProgressObject->getCollectionInstance();
93 if ($collection !==
null) {
94 $items = $collection->getPossibleItems();
98 $template->setCurrentBlock(
'SCOS');
99 $template->setVariable(
'PH_SCOS', $this->
language->txt(
'certificate_ph_scos'));
100 $template->parseCurrentBlock();
101 $template->setCurrentBlock(
'SCO_HEADER');
102 $template->setVariable(
'PH_TITLE_SCO', $this->
language->txt(
'certificate_ph_title_sco'));
103 $template->setVariable(
'PH_SCO_TITLE', $this->
language->txt(
'certificate_ph_sco_title'));
104 $template->setVariable(
'PH_SCO_POINTS_RAW', $this->
language->txt(
'certificate_ph_sco_points_raw'));
105 $template->setVariable(
'PH_SCO_POINTS_MAX', $this->
language->txt(
'certificate_ph_sco_points_max'));
106 $template->setVariable(
'PH_SCO_POINTS_SCALED', $this->
language->txt(
'certificate_ph_sco_points_scaled'));
108 $template->setCurrentBlock(
'NO_SCO');
109 $template->setVariable(
'PH_NO_SCO', $this->
language->txt(
'certificate_ph_no_sco'));
111 $template->parseCurrentBlock();
113 if ($collection !==
null) {
115 foreach ($items as $item_id => $sahs_item) {
116 if ($collection->isAssignedEntry($item_id)) {
117 $template->setCurrentBlock(
'SCO');
118 $template->setVariable(
'SCO_TITLE', $sahs_item[
'title']);
119 $template->setVariable(
'PH_SCO_TITLE',
'[SCO_T_' . $counter .
']');
120 $template->setVariable(
'PH_SCO_POINTS_RAW',
'[SCO_P_' . $counter .
']');
121 $template->setVariable(
'PH_SCO_POINTS_MAX',
'[SCO_PM_' . $counter .
']');
122 $template->setVariable(
'PH_SCO_POINTS_SCALED',
'[SCO_PP_' . $counter .
']');
123 $template->parseCurrentBlock();
129 return $template->get();
readonly ilDefaultPlaceholderDescription $defaultPlaceHolderDescriptionObject
readonly ilObjectLP $learningProgressObject
getPlaceholderDescriptions()
This method MUST return an array containing an array with the the description as array value...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
createPlaceholderHtmlDescription(?ilTemplate $template=null)
This methods MUST return an array containing an array with the the description as array value...
__construct(private readonly ilObject $object, ?ilDefaultPlaceholderDescription $defaultPlaceholderDescriptionObject=null, ?ilLanguage $language=null, ?ilObjectLP $learningProgressObject=null, ?ilUserDefinedFieldsPlaceholderDescription $userDefinedFieldPlaceHolderDescriptionObject=null)
readonly ilLanguage $language
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
language()
description: > Example for rendring a language glyph.
static getInstance(int $obj_id)