19declare(strict_types=1);
46 if (
null === $defaultPlaceholderDescriptionObject) {
49 $profile ??
$DIC[
'user']->getProfile(),
50 $userDefinedFieldPlaceHolderDescriptionObject
53 $this->defaultPlaceHolderDescriptionObject = $defaultPlaceholderDescriptionObject;
60 $this->placeholder = $this->defaultPlaceHolderDescriptionObject->getPlaceholderDescriptions();
62 $this->placeholder[
'SCORM_TITLE'] =
$language->
txt(
'certificate_ph_scormtitle');
63 $this->placeholder[
'SCORM_POINTS'] =
$language->
txt(
'certificate_ph_scormpoints');
64 $this->placeholder[
'SCORM_POINTS_MAX'] =
$language->
txt(
'certificate_ph_scormmaxpoints');
81 if (
null === $template) {
82 $template =
new ilTemplate(
'tpl.scorm_description.html',
true,
true,
'components/ILIAS/Certificate');
85 $template->setCurrentBlock(
'items');
87 foreach ($this->placeholder as
$id => $caption) {
88 $template->setVariable(
'ID',
$id);
89 $template->setVariable(
'TXT', $caption);
90 $template->parseCurrentBlock();
93 $template->setVariable(
'PH_INTRODUCTION', $this->
language->txt(
'certificate_ph_introduction'));
95 $collection = $this->learningProgressObject->getCollectionInstance();
97 if ($collection !==
null) {
98 $items = $collection->getPossibleItems();
102 $template->setCurrentBlock(
'SCOS');
103 $template->setVariable(
'PH_SCOS', $this->
language->txt(
'certificate_ph_scos'));
104 $template->parseCurrentBlock();
105 $template->setCurrentBlock(
'SCO_HEADER');
106 $template->setVariable(
'PH_TITLE_SCO', $this->
language->txt(
'certificate_ph_title_sco'));
107 $template->setVariable(
'PH_SCO_TITLE', $this->
language->txt(
'certificate_ph_sco_title'));
108 $template->setVariable(
'PH_SCO_POINTS_RAW', $this->
language->txt(
'certificate_ph_sco_points_raw'));
109 $template->setVariable(
'PH_SCO_POINTS_MAX', $this->
language->txt(
'certificate_ph_sco_points_max'));
110 $template->setVariable(
'PH_SCO_POINTS_SCALED', $this->
language->txt(
'certificate_ph_sco_points_scaled'));
112 $template->setCurrentBlock(
'NO_SCO');
113 $template->setVariable(
'PH_NO_SCO', $this->
language->txt(
'certificate_ph_no_sco'));
115 $template->parseCurrentBlock();
117 if ($collection !==
null) {
119 foreach ($items as $item_id => $sahs_item) {
120 if ($collection->isAssignedEntry($item_id)) {
121 $template->setCurrentBlock(
'SCO');
122 $template->setVariable(
'SCO_TITLE', $sahs_item[
'title']);
123 $template->setVariable(
'PH_SCO_TITLE',
'[SCO_T_' .
$counter .
']');
124 $template->setVariable(
'PH_SCO_POINTS_RAW',
'[SCO_P_' .
$counter .
']');
125 $template->setVariable(
'PH_SCO_POINTS_MAX',
'[SCO_PM_' .
$counter .
']');
126 $template->setVariable(
'PH_SCO_POINTS_SCALED',
'[SCO_PP_' .
$counter .
']');
127 $template->parseCurrentBlock();
133 return $template->get();
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Collection of basic placeholder values that can be used.
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Base class for object lp connectors.
static getInstance(int $obj_id)
Class ilObject Basic functions for all objects.
readonly ilLanguage $language
readonly ilObjectLP $learningProgressObject
getPlaceholderDescriptions()
This method MUST return an array containing an array with the the description as array value.
createPlaceholderHtmlDescription(?ilTemplate $template=null)
This methods MUST return an array containing an array with the the description as array value.
readonly ilDefaultPlaceholderDescription $defaultPlaceHolderDescriptionObject
__construct(private readonly ilObject $object, ?ilDefaultPlaceholderDescription $defaultPlaceholderDescriptionObject=null, ?ilLanguage $language=null, ?ilObjectLP $learningProgressObject=null, ?ilUserDefinedFieldsPlaceholderDescription $userDefinedFieldPlaceHolderDescriptionObject=null, ?Profile $profile=null)
special template class to simplify handling of ITX/PEAR