ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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
 
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(), 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  'USER_LOGIN' => $language->txt('certificate_ph_login'),
44  'USER_FULLNAME' => $language->txt('certificate_ph_fullname'),
45  'USER_FIRSTNAME' => $language->txt('certificate_ph_firstname'),
46  'USER_LASTNAME' => $language->txt('certificate_ph_lastname'),
47  'USER_TITLE' => $language->txt('certificate_ph_title'),
48  'USER_SALUTATION' => $language->txt('certificate_ph_salutation'),
49  'USER_BIRTHDAY' => $language->txt('certificate_ph_birthday'),
50  'USER_INSTITUTION' => $language->txt('certificate_ph_institution'),
51  'USER_DEPARTMENT' => $language->txt('certificate_ph_department'),
52  'USER_STREET' => $language->txt('certificate_ph_street'),
53  'USER_CITY' => $language->txt('certificate_ph_city'),
54  'USER_ZIPCODE' => $language->txt('certificate_ph_zipcode'),
55  'USER_COUNTRY' => $language->txt('certificate_ph_country'),
56  'USER_MATRICULATION' => $language->txt('certificate_ph_matriculation'),
57  'DATE' => $language->txt("certificate_ph_date"),
58  'DATETIME' => $language->txt("certificate_ph_datetime"),
59  ];
60 
61  $this->placeholder = array_merge($this->placeholder, $userDefinedPlaceholderHtmlDescription);
62  }
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.
+ 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.

Parameters
ilTemplate | null$template
Returns
string

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

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

71  : string
72  {
73  if (null === $template) {
74  $template = new ilTemplate('tpl.default_description.html', true, true, 'Services/Certificate');
75  }
76 
77  $template->setVariable('PLACEHOLDER_INTRODUCTION', $this->language->txt('certificate_ph_introduction'));
78 
79  $template->setCurrentBlock('items');
80  foreach ($this->placeholder as $id => $caption) {
81  $template->setVariable('ID', $id);
82  $template->setVariable('TXT', $caption);
83  $template->parseCurrentBlock();
84  }
85 
86  return $template->get();
87  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ 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 94 of file class.ilDefaultPlaceholderDescription.php.

References $placeholder.

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

Field Documentation

◆ $language

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: