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

Public Member Functions

 __construct (?\ilDefaultPlaceholderDescription $defaultPlaceholderDescriptionObject=null, ?\ilLanguage $language=null, ?Profile $profile=null, ?\ilUserDefinedFieldsPlaceholderDescription $userDefinedFieldPlaceHolderDescriptionObject=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 ilLanguage $language
 
array $placeholder
 

Detailed Description

Author
Niels Theen nthee.nosp@m.n@da.nosp@m.tabay.nosp@m..de

Definition at line 28 of file TestPlaceholderDescription.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 33 of file TestPlaceholderDescription.php.

38 {
39 global $DIC;
40
41 if (null === $language) {
42 $language = $DIC->language();
43 $language->loadLanguageModule('certificate');
44 }
45 $this->language = $language;
46 $profile ??= $DIC['user']->getProfile();
47
48 if (null === $defaultPlaceholderDescriptionObject) {
49 $defaultPlaceholderDescriptionObject = new \ilDefaultPlaceholderDescription(
51 $profile,
52 $userDefinedFieldPlaceHolderDescriptionObject
53 );
54 }
55 $this->placeholder = $defaultPlaceholderDescriptionObject->getPlaceholderDescriptions();
56
57 $this->placeholder['RESULT_PASSED'] = \ilLegacyFormElementsUtil::prepareFormOutput(
58 $this->language->txt('certificate_var_result_passed')
59 );
60 $this->placeholder['RESULT_POINTS'] = \ilLegacyFormElementsUtil::prepareFormOutput(
61 $this->language->txt('certificate_var_result_points')
62 );
63 $this->placeholder['RESULT_PERCENT'] = \ilLegacyFormElementsUtil::prepareFormOutput(
64 $this->language->txt('certificate_var_result_percent')
65 );
66 $this->placeholder['MAX_POINTS'] = \ilLegacyFormElementsUtil::prepareFormOutput(
67 $this->language->txt('certificate_var_max_points')
68 );
69 $this->placeholder['RESULT_MARK_SHORT'] = \ilLegacyFormElementsUtil::prepareFormOutput(
70 $this->language->txt('certificate_var_result_mark_short')
71 );
72 $this->placeholder['RESULT_MARK_LONG'] = \ilLegacyFormElementsUtil::prepareFormOutput(
73 $this->language->txt('certificate_var_result_mark_long')
74 );
75 $this->placeholder['TEST_TITLE'] = \ilLegacyFormElementsUtil::prepareFormOutput(
76 $this->language->txt('certificate_ph_testtitle')
77 );
78 $this->placeholder['DATE_COMPLETED'] = \ilLegacyFormElementsUtil::prepareFormOutput(
79 $language->txt('certificate_ph_date_completed')
80 );
81 $this->placeholder['DATETIME_COMPLETED'] = \ilLegacyFormElementsUtil::prepareFormOutput(
82 $language->txt('certificate_ph_datetime_completed')
83 );
84 }
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\Test\Certificate\TestPlaceholderDescription\$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\Test\Certificate\TestPlaceholderDescription::createPlaceholderHtmlDescription ( ?\ilTemplate  $template = null)

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

Definition at line 90 of file TestPlaceholderDescription.php.

90 : string
91 {
92 if (null === $template) {
93 $template = new \ilTemplate('tpl.default_description.html', true, true, 'components/ILIAS/Certificate');
94 }
95
96 $template->setVariable('PLACEHOLDER_INTRODUCTION', $this->language->txt('certificate_ph_introduction'));
97
98 $template->setCurrentBlock('items');
99 foreach ($this->placeholder as $id => $caption) {
100 $template->setVariable('ID', $id);
101 $template->setVariable('TXT', $caption);
102 $template->parseCurrentBlock();
103 }
104
105 return $template->get();
106 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

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

+ Here is the call graph for this function:

◆ getPlaceholderDescriptions()

ILIAS\Test\Certificate\TestPlaceholderDescription::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 113 of file TestPlaceholderDescription.php.

References ILIAS\Test\Certificate\TestPlaceholderDescription\$placeholder.

Field Documentation

◆ $language

readonly ilLanguage ILIAS\Test\Certificate\TestPlaceholderDescription::$language
private

◆ $placeholder

array ILIAS\Test\Certificate\TestPlaceholderDescription::$placeholder
private

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