ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
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, ?\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
 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 26 of file TestPlaceholderDescription.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 31 of file TestPlaceholderDescription.php.

References $DIC, ILIAS\Test\Certificate\TestPlaceholderDescription\$language, ILIAS\UI\examples\Symbol\Glyph\Language\language(), null, and ilLegacyFormElementsUtil\prepareFormOutput().

35  {
36  global $DIC;
37 
38  if (null === $language) {
39  $language = $DIC->language();
40  $language->loadLanguageModule('certificate');
41  }
42  $this->language = $language;
43 
44  if (null === $defaultPlaceholderDescriptionObject) {
45  $defaultPlaceholderDescriptionObject = new \ilDefaultPlaceholderDescription(
46  $language,
47  $userDefinedFieldPlaceHolderDescriptionObject
48  );
49  }
50  $this->placeholder = $defaultPlaceholderDescriptionObject->getPlaceholderDescriptions();
51 
52  $this->placeholder['RESULT_PASSED'] = \ilLegacyFormElementsUtil::prepareFormOutput(
53  $this->language->txt('certificate_var_result_passed')
54  );
55  $this->placeholder['RESULT_POINTS'] = \ilLegacyFormElementsUtil::prepareFormOutput(
56  $this->language->txt('certificate_var_result_points')
57  );
58  $this->placeholder['RESULT_PERCENT'] = \ilLegacyFormElementsUtil::prepareFormOutput(
59  $this->language->txt('certificate_var_result_percent')
60  );
61  $this->placeholder['MAX_POINTS'] = \ilLegacyFormElementsUtil::prepareFormOutput(
62  $this->language->txt('certificate_var_max_points')
63  );
64  $this->placeholder['RESULT_MARK_SHORT'] = \ilLegacyFormElementsUtil::prepareFormOutput(
65  $this->language->txt('certificate_var_result_mark_short')
66  );
67  $this->placeholder['RESULT_MARK_LONG'] = \ilLegacyFormElementsUtil::prepareFormOutput(
68  $this->language->txt('certificate_var_result_mark_long')
69  );
70  $this->placeholder['TEST_TITLE'] = \ilLegacyFormElementsUtil::prepareFormOutput(
71  $this->language->txt('certificate_ph_testtitle')
72  );
73  $this->placeholder['DATE_COMPLETED'] = \ilLegacyFormElementsUtil::prepareFormOutput(
74  $language->txt('certificate_ph_date_completed')
75  );
76  $this->placeholder['DATETIME_COMPLETED'] = \ilLegacyFormElementsUtil::prepareFormOutput(
77  $language->txt('certificate_ph_datetime_completed')
78  );
79  }
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...
loadLanguageModule(string $a_module)
Load language module.
static prepareFormOutput($a_str, bool $a_strip=false)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ 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 85 of file TestPlaceholderDescription.php.

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

85  : string
86  {
87  if (null === $template) {
88  $template = new \ilTemplate('tpl.default_description.html', true, true, 'components/ILIAS/Certificate');
89  }
90 
91  $template->setVariable('PLACEHOLDER_INTRODUCTION', $this->language->txt('certificate_ph_introduction'));
92 
93  $template->setCurrentBlock('items');
94  foreach ($this->placeholder as $id => $caption) {
95  $template->setVariable('ID', $id);
96  $template->setVariable('TXT', $caption);
97  $template->parseCurrentBlock();
98  }
99 
100  return $template->get();
101  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ 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 108 of file TestPlaceholderDescription.php.

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

108  : array
109  {
110  return $this->placeholder;
111  }

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: