ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Exercise\Certificate\ExercisePlaceholderDescription Class Reference
+ Inheritance diagram for ILIAS\Exercise\Certificate\ExercisePlaceholderDescription:
+ Collaboration diagram for ILIAS\Exercise\Certificate\ExercisePlaceholderDescription:

Public Member Functions

 __construct (?ilDefaultPlaceholderDescription $defaultPlaceholderDescriptionObject=null, ?ilLanguage $language=null, ?ilUserDefinedFieldsPlaceholderDescription $userDefinedFieldPlaceHolderDescriptionObject=null, ?Profile $profile=null)
 
 createPlaceholderHtmlDescription (?ilTemplate $template=null)
 This methods MUST return an array containing an array with the the description as array value. More...
 
 getPlaceholderDescriptions ()
 This method MUST return an array containing an array with the description as array value. More...
 
- Public Member Functions inherited from ilCertificatePlaceholderDescription
 getPlaceholderDescriptions ()
 This method MUST return an array containing an array with the the description as array value. More...
 
 createPlaceholderHtmlDescription ()
 

Private Attributes

readonly ilDefaultPlaceholderDescription $defaultPlaceHolderDescriptionObject
 
readonly ilLanguage $language
 
array $placeholder
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Exercise\Certificate\ExercisePlaceholderDescription::__construct ( ?ilDefaultPlaceholderDescription  $defaultPlaceholderDescriptionObject = null,
?ilLanguage  $language = null,
?ilUserDefinedFieldsPlaceholderDescription  $userDefinedFieldPlaceHolderDescriptionObject = null,
?Profile  $profile = null 
)

Definition at line 40 of file ExercisePlaceholderDescription.php.

45 {
46 if (null === $language) {
47 $language = $DIC->language();
48 $language->loadLanguageModule('certificate');
49 }
50 $this->language = $language;
51
52 if (null === $defaultPlaceholderDescriptionObject) {
53 $defaultPlaceholderDescriptionObject = new ilDefaultPlaceholderDescription(
55 $profile ?? $DIC['user']->getProfile(),
56 $userDefinedFieldPlaceHolderDescriptionObject
57 );
58 }
59 $this->placeholder = $defaultPlaceholderDescriptionObject->getPlaceholderDescriptions();
60
61 $this->placeholder['RESULT_PASSED'] = ilLegacyFormElementsUtil::prepareFormOutput(
62 $language->txt('certificate_var_result_passed')
63 );
64 $this->placeholder['RESULT_MARK'] = ilLegacyFormElementsUtil::prepareFormOutput(
65 $language->txt('certificate_var_result_mark_short')
66 );
67 $this->placeholder['EXERCISE_TITLE'] = ilLegacyFormElementsUtil::prepareFormOutput(
68 $language->txt('certificate_ph_exercisetitle')
69 );
70 $this->placeholder['DATE_COMPLETED'] = ilLegacyFormElementsUtil::prepareFormOutput(
71 $language->txt('certificate_ph_datetime_completed')
72 );
73 $this->placeholder['DATETIME_COMPLETED'] = ilLegacyFormElementsUtil::prepareFormOutput(
74 $language->txt('certificate_ph_datetime_completed')
75 );
76 }
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...
static prepareFormOutput($a_str, bool $a_strip=false)
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Exercise\Certificate\ExercisePlaceholderDescription\$language, ILIAS\UI\examples\Symbol\Glyph\Language\language(), ilLanguage\loadLanguageModule(), ilLegacyFormElementsUtil\prepareFormOutput(), and ilLanguage\txt().

+ Here is the call graph for this function:

Member Function Documentation

◆ createPlaceholderHtmlDescription()

ILIAS\Exercise\Certificate\ExercisePlaceholderDescription::createPlaceholderHtmlDescription ( ?ilTemplate  $template = null)

This methods MUST return an array containing an array with the the description as array value.

Returns
string - [PLACEHOLDER] => 'description'

Definition at line 83 of file ExercisePlaceholderDescription.php.

83 : string
84 {
85 if (null === $template) {
86 $template = new ilTemplate('tpl.default_description.html', true, true, 'components/ILIAS/Certificate');
87 }
88
89 $template->setVariable('PLACEHOLDER_INTRODUCTION', $this->language->txt('certificate_ph_introduction'));
90
91 $template->setCurrentBlock('items');
92 foreach ($this->placeholder as $id => $caption) {
93 $template->setVariable('ID', $id);
94 $template->setVariable('TXT', $caption);
95 $template->parseCurrentBlock();
96 }
97
98 return $template->get();
99 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
special template class to simplify handling of ITX/PEAR

References $id, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

+ Here is the call graph for this function:

◆ getPlaceholderDescriptions()

ILIAS\Exercise\Certificate\ExercisePlaceholderDescription::getPlaceholderDescriptions ( )

This method MUST return an array containing an array with the description as array value.

Returns
array - [PLACEHOLDER] => 'description'

Implements ilCertificatePlaceholderDescription.

Definition at line 106 of file ExercisePlaceholderDescription.php.

References ILIAS\Exercise\Certificate\ExercisePlaceholderDescription\$placeholder.

Field Documentation

◆ $defaultPlaceHolderDescriptionObject

readonly ilDefaultPlaceholderDescription ILIAS\Exercise\Certificate\ExercisePlaceholderDescription::$defaultPlaceHolderDescriptionObject
private

Definition at line 36 of file ExercisePlaceholderDescription.php.

◆ $language

readonly ilLanguage ILIAS\Exercise\Certificate\ExercisePlaceholderDescription::$language
private

◆ $placeholder

array ILIAS\Exercise\Certificate\ExercisePlaceholderDescription::$placeholder
private

The documentation for this class was generated from the following file: