ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCoursePlaceholderDescription Class Reference
+ Inheritance diagram for ilCoursePlaceholderDescription:
+ Collaboration diagram for ilCoursePlaceholderDescription:

Public Member Functions

 __construct (int $objectId, ?ilDefaultPlaceholderDescription $defaultPlaceholderDescriptionObject=null, ?ilLanguage $language=null, ?ilUserDefinedFieldsPlaceholderDescription $userDefinedFieldPlaceHolderDescriptionObject=null, ?ilObjectCustomUserFieldsPlaceholderDescription $customUserFieldsPlaceholderDescriptionObject=null)
 
 createPlaceholderHtmlDescription (?ilTemplate $template=null)
 
 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

ilDefaultPlaceholderDescription $defaultPlaceHolderDescriptionObject
 
ilObjectCustomUserFieldsPlaceholderDescription $customUserFieldsPlaceholderDescriptionObject
 
ilLanguage $language
 
array $placeholder
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCoursePlaceholderDescription::__construct ( int  $objectId,
?ilDefaultPlaceholderDescription  $defaultPlaceholderDescriptionObject = null,
?ilLanguage  $language = null,
?ilUserDefinedFieldsPlaceholderDescription  $userDefinedFieldPlaceHolderDescriptionObject = null,
?ilObjectCustomUserFieldsPlaceholderDescription  $customUserFieldsPlaceholderDescriptionObject = null 
)

Definition at line 31 of file class.ilCoursePlaceholderDescription.php.

References $customUserFieldsPlaceholderDescriptionObject, $DIC, $language, ilObjectCustomUserFieldsPlaceholderDescription\getPlaceholderDescriptions(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ilLanguage\loadLanguageModule(), ilLegacyFormElementsUtil\prepareFormOutput(), and ilLanguage\txt().

37  {
38  global $DIC;
39 
40  if (null === $language) {
41  $language = $DIC->language();
42  $language->loadLanguageModule('certificate');
43  }
44  $this->language = $language;
45 
46  if (null === $defaultPlaceholderDescriptionObject) {
47  $defaultPlaceholderDescriptionObject = new ilDefaultPlaceholderDescription(
48  $language,
49  $userDefinedFieldPlaceHolderDescriptionObject
50  );
51  }
52  $this->defaultPlaceHolderDescriptionObject = $defaultPlaceholderDescriptionObject;
53 
56  }
57  $this->customUserFieldsPlaceholderDescriptionObject = $customUserFieldsPlaceholderDescriptionObject;
58 
59  $customUserFieldsPlaceholderHtmlDescription = $this->customUserFieldsPlaceholderDescriptionObject->getPlaceholderDescriptions();
60  $defaultPlaceholderDescription = $this->defaultPlaceHolderDescriptionObject->getPlaceholderDescriptions();
61 
62  $this->placeholder = array_merge($defaultPlaceholderDescription, $customUserFieldsPlaceholderHtmlDescription);
63  $this->placeholder['COURSE_TITLE'] = $this->language->txt('crs_title');
64  $this->placeholder['DATE_COMPLETED'] = ilLegacyFormElementsUtil::prepareFormOutput(
65  $language->txt('certificate_ph_date_completed')
66  );
67  $this->placeholder['DATETIME_COMPLETED'] = ilLegacyFormElementsUtil::prepareFormOutput(
68  $language->txt('certificate_ph_datetime_completed')
69  );
70  }
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)
global $DIC
Definition: feed.php:28
getPlaceholderDescriptions()
This method MUST return an array containing an array with the the description as array value...
Collection of basic placeholder values that can be used.
ilObjectCustomUserFieldsPlaceholderDescription $customUserFieldsPlaceholderDescriptionObject
+ Here is the call graph for this function:

Member Function Documentation

◆ createPlaceholderHtmlDescription()

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

Definition at line 72 of file class.ilCoursePlaceholderDescription.php.

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

72  : string
73  {
74  if (null === $template) {
75  $template = new ilTemplate('tpl.default_description.html', true, true, 'Services/Certificate');
76  }
77 
78  $template->setVariable("PLACEHOLDER_INTRODUCTION", $this->language->txt('certificate_ph_introduction'));
79 
80  $template->setCurrentBlock("items");
81  foreach ($this->placeholder as $id => $caption) {
82  $template->setVariable("ID", $id);
83  $template->setVariable("TXT", $caption);
84  $template->parseCurrentBlock();
85  }
86 
87  return $template->get();
88  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getPlaceholderDescriptions()

ilCoursePlaceholderDescription::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 95 of file class.ilCoursePlaceholderDescription.php.

References $placeholder.

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

Field Documentation

◆ $customUserFieldsPlaceholderDescriptionObject

ilObjectCustomUserFieldsPlaceholderDescription ilCoursePlaceholderDescription::$customUserFieldsPlaceholderDescriptionObject
private

Definition at line 27 of file class.ilCoursePlaceholderDescription.php.

Referenced by __construct().

◆ $defaultPlaceHolderDescriptionObject

ilDefaultPlaceholderDescription ilCoursePlaceholderDescription::$defaultPlaceHolderDescriptionObject
private

Definition at line 26 of file class.ilCoursePlaceholderDescription.php.

◆ $language

ilLanguage ilCoursePlaceholderDescription::$language
private

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

Referenced by __construct().

◆ $placeholder

array ilCoursePlaceholderDescription::$placeholder
private

Definition at line 29 of file class.ilCoursePlaceholderDescription.php.

Referenced by getPlaceholderDescriptions().


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