ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDefaultPlaceholderDescription Class Reference

Collection of basic placeholder values that can be used. More...

+ Inheritance diagram for ilDefaultPlaceholderDescription:
+ Collaboration diagram for ilDefaultPlaceholderDescription:

Public Member Functions

 __construct (ilLanguage $language, ?ilUserDefinedFieldsPlaceholderDescription $userDefinedFieldPlaceHolderDescriptionObject=null)
 
 createPlaceholderHtmlDescription (?ilTemplate $template=null)
 This method is different then the 'getPlaceholderValues' method, this method is used to create a placeholder value array containing dummy values that is used to create a preview certificate. More...
 
 getPlaceholderDescriptions ()
 This method MUST return an array containing an array with the the description as array value. More...
 
- Public Member Functions inherited from ilCertificatePlaceholderDescription
 createPlaceholderHtmlDescription ()
 

Private Attributes

array $placeholder
 
readonly ilLanguage $language
 

Detailed Description

Collection of basic placeholder values that can be used.

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

Definition at line 25 of file class.ilDefaultPlaceholderDescription.php.

Constructor & Destructor Documentation

◆ __construct()

ilDefaultPlaceholderDescription::__construct ( ilLanguage  $language,
?ilUserDefinedFieldsPlaceholderDescription  $userDefinedFieldPlaceHolderDescriptionObject = null 
)

Definition at line 30 of file class.ilDefaultPlaceholderDescription.php.

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

33  {
34  if (null === $userDefinedFieldPlaceHolderDescriptionObject) {
35  $userDefinedFieldPlaceHolderDescriptionObject = new ilUserDefinedFieldsPlaceholderDescription();
36  }
37  $userDefinedPlaceholderHtmlDescription = $userDefinedFieldPlaceHolderDescriptionObject->getPlaceholderDescriptions();
38 
39  $language->loadLanguageModule('certificate');
40  $this->language = $language;
41 
42  $this->placeholder = [
43  'CERTIFICATE_ID' => $language->txt('certificate_ph_cert_id'),
44  'USER_LOGIN' => $language->txt('certificate_ph_login'),
45  'USER_FULLNAME' => $language->txt('certificate_ph_fullname'),
46  'USER_FIRSTNAME' => $language->txt('certificate_ph_firstname'),
47  'USER_LASTNAME' => $language->txt('certificate_ph_lastname'),
48  'USER_TITLE' => $language->txt('certificate_ph_title'),
49  'USER_SALUTATION' => $language->txt('certificate_ph_salutation'),
50  'USER_BIRTHDAY' => $language->txt('certificate_ph_birthday'),
51  'USER_INSTITUTION' => $language->txt('certificate_ph_institution'),
52  'USER_DEPARTMENT' => $language->txt('certificate_ph_department'),
53  'USER_STREET' => $language->txt('certificate_ph_street'),
54  'USER_CITY' => $language->txt('certificate_ph_city'),
55  'USER_ZIPCODE' => $language->txt('certificate_ph_zipcode'),
56  'USER_COUNTRY' => $language->txt('certificate_ph_country'),
57  'USER_MATRICULATION' => $language->txt('certificate_ph_matriculation'),
58  'DATE' => $language->txt("certificate_ph_date"),
59  'DATETIME' => $language->txt("certificate_ph_datetime"),
60  ];
61 
62  $this->placeholder = array_merge($this->placeholder, $userDefinedPlaceholderHtmlDescription);
63  }
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.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

Member Function Documentation

◆ createPlaceholderHtmlDescription()

ilDefaultPlaceholderDescription::createPlaceholderHtmlDescription ( ?ilTemplate  $template = null)

This method is different then the 'getPlaceholderValues' method, this method is used to create a placeholder value array containing dummy values that is used to create a preview certificate.

Definition at line 70 of file class.ilDefaultPlaceholderDescription.php.

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

70  : string
71  {
72  if (null === $template) {
73  $template = new ilTemplate('tpl.default_description.html', true, true, 'components/ILIAS/Certificate');
74  }
75 
76  $template->setVariable('PLACEHOLDER_INTRODUCTION', $this->language->txt('certificate_ph_introduction'));
77 
78  $template->setCurrentBlock('items');
79  foreach ($this->placeholder as $id => $caption) {
80  $template->setVariable('ID', $id);
81  $template->setVariable('TXT', $caption);
82  $template->parseCurrentBlock();
83  }
84 
85  return $template->get();
86  }
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()

ilDefaultPlaceholderDescription::getPlaceholderDescriptions ( )

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

Returns
array - [PLACEHOLDER] => 'description'

Implements ilCertificatePlaceholderDescription.

Definition at line 93 of file class.ilDefaultPlaceholderDescription.php.

References $placeholder.

93  : array
94  {
95  return $this->placeholder;
96  }

Field Documentation

◆ $language

readonly ilLanguage ilDefaultPlaceholderDescription::$language
private

Definition at line 28 of file class.ilDefaultPlaceholderDescription.php.

Referenced by __construct().

◆ $placeholder

array ilDefaultPlaceholderDescription::$placeholder
private

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