ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 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 the description as array value. More...
 
- Public Member Functions inherited from ilCertificatePlaceholderDescription
 createPlaceholderHtmlDescription ()
 

Private Attributes

 $defaultPlaceHolderDescriptionObject
 
 $customUserFieldsPlaceholderDescriptionObject
 
 $language
 
 $placeholder
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $customUserFieldsPlaceholderDescriptionObject, $DIC, $language, language(), and ilUtil\prepareFormOutput().

41  {
42  global $DIC;
43 
44  if (null === $language) {
45  $language = $DIC->language();
46  $language->loadLanguageModule('certificate');
47  }
48  $this->language = $language;
49 
50  if (null === $defaultPlaceholderDescriptionObject) {
51  $defaultPlaceholderDescriptionObject = new ilDefaultPlaceholderDescription($language, $userDefinedFieldPlaceHolderDescriptionObject);
52  }
53  $this->defaultPlaceHolderDescriptionObject = $defaultPlaceholderDescriptionObject;
54 
55  if (null === $customUserFieldsPlaceholderDescriptionObject) {
56  $customUserFieldsPlaceholderDescriptionObject = new ilObjectCustomUserFieldsPlaceholderDescription($objectId);
57  }
58  $this->customUserFieldsPlaceholderDescriptionObject = $customUserFieldsPlaceholderDescriptionObject;
59 
60  $customUserFieldsPlaceholderHtmlDescription = $this->customUserFieldsPlaceholderDescriptionObject->getPlaceholderDescriptions();
61  $defaultPlaceholderDescription = $this->defaultPlaceHolderDescriptionObject->getPlaceholderDescriptions();
62 
63  $this->placeholder = array_merge($defaultPlaceholderDescription, $customUserFieldsPlaceholderHtmlDescription);
64  $this->placeholder['COURSE_TITLE'] = $this->language->txt('crs_title');
65  $this->placeholder['DATE_COMPLETED'] = ilUtil::prepareFormOutput($language->txt('certificate_ph_date_completed'));
66  $this->placeholder['DATETIME_COMPLETED'] = ilUtil::prepareFormOutput($language->txt('certificate_ph_datetime_completed'));
67  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
global $DIC
Definition: goto.php:24
loadLanguageModule($a_module)
Collection of basic placeholder values that can be used.
language()
Definition: language.php:2
txt($a_topic, $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...
+ Here is the call graph for this function:

Member Function Documentation

◆ createPlaceholderHtmlDescription()

ilCoursePlaceholderDescription::createPlaceholderHtmlDescription ( ilTemplate  $template = null)

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

Parameters
null$template
Returns
mixed - [PLACEHOLDER] => 'description'

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

References language().

75  : string
76  {
77  if (null === $template) {
78  $template = new ilTemplate('tpl.default_description.html', true, true, 'Services/Certificate');
79  }
80 
81  $template->setVariable("PLACEHOLDER_INTRODUCTION", $this->language->txt('certificate_ph_introduction'));
82 
83  $template->setCurrentBlock("items");
84  foreach ($this->placeholder as $id => $caption) {
85  $template->setVariable("ID", $id);
86  $template->setVariable("TXT", $caption);
87  $template->parseCurrentBlock();
88  }
89 
90  return $template->get();
91  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:615
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
language()
Definition: language.php:2
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public...
get($part="DEFAULT")
+ 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
mixed - [PLACEHOLDER] => 'description'

Implements ilCertificatePlaceholderDescription.

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

References $placeholder.

Field Documentation

◆ $customUserFieldsPlaceholderDescriptionObject

ilCoursePlaceholderDescription::$customUserFieldsPlaceholderDescriptionObject
private

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

Referenced by __construct().

◆ $defaultPlaceHolderDescriptionObject

ilCoursePlaceholderDescription::$defaultPlaceHolderDescriptionObject
private

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

◆ $language

ilCoursePlaceholderDescription::$language
private

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

Referenced by __construct().

◆ $placeholder

ilCoursePlaceholderDescription::$placeholder
private

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

Referenced by getPlaceholderDescriptions().


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