ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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, Profile $profile, ?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
 getPlaceholderDescriptions ()
 This method MUST return an array containing an array with the the description as array value. More...
 
 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 27 of file class.ilDefaultPlaceholderDescription.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

36 {
37 if (null === $userDefinedFieldPlaceHolderDescriptionObject) {
38 $userDefinedFieldPlaceHolderDescriptionObject = new ilUserDefinedFieldsPlaceholderDescription(
40 $profile
41 );
42 }
43 $userDefinedPlaceholderHtmlDescription = $userDefinedFieldPlaceHolderDescriptionObject->getPlaceholderDescriptions();
44
45 $language->loadLanguageModule('certificate');
46 $this->language = $language;
47
48 $this->placeholder = [
49 'CERTIFICATE_ID' => $language->txt('certificate_ph_cert_id'),
50 'USER_LOGIN' => $language->txt('certificate_ph_login'),
51 'USER_FULLNAME' => $language->txt('certificate_ph_fullname'),
52 'USER_FIRSTNAME' => $language->txt('certificate_ph_firstname'),
53 'USER_LASTNAME' => $language->txt('certificate_ph_lastname'),
54 'USER_TITLE' => $language->txt('certificate_ph_title'),
55 'USER_SALUTATION' => $language->txt('certificate_ph_salutation'),
56 'USER_BIRTHDAY' => $language->txt('certificate_ph_birthday'),
57 'USER_INSTITUTION' => $language->txt('certificate_ph_institution'),
58 'USER_DEPARTMENT' => $language->txt('certificate_ph_department'),
59 'USER_STREET' => $language->txt('certificate_ph_street'),
60 'USER_CITY' => $language->txt('certificate_ph_city'),
61 'USER_ZIPCODE' => $language->txt('certificate_ph_zipcode'),
62 'USER_COUNTRY' => $language->txt('certificate_ph_country'),
63 'USER_MATRICULATION' => $language->txt('certificate_ph_matriculation'),
64 'DATE' => $language->txt("certificate_ph_date"),
65 'DATETIME' => $language->txt("certificate_ph_datetime"),
66 ];
67
68 $this->placeholder = array_merge($this->placeholder, $userDefinedPlaceholderHtmlDescription);
69 }
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...

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

+ 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 76 of file class.ilDefaultPlaceholderDescription.php.

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

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 99 of file class.ilDefaultPlaceholderDescription.php.

References $placeholder.

Field Documentation

◆ $language

readonly ilLanguage ilDefaultPlaceholderDescription::$language
private

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

Referenced by __construct().

◆ $placeholder

array ilDefaultPlaceholderDescription::$placeholder
private

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