ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestPlaceholderDescription Class Reference
+ Inheritance diagram for ilTestPlaceholderDescription:
+ Collaboration diagram for ilTestPlaceholderDescription:

Public Member Functions

 __construct (ilDefaultPlaceholderDescription $defaultPlaceholderDescriptionObject=null, ilLanguage $language=null, ilUserDefinedFieldsPlaceholderDescription $userDefinedFieldPlaceHolderDescriptionObject=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
 
 $language
 
 $placeholder
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestPlaceholderDescription::__construct ( ilDefaultPlaceholderDescription  $defaultPlaceholderDescriptionObject = null,
ilLanguage  $language = null,
ilUserDefinedFieldsPlaceholderDescription  $userDefinedFieldPlaceHolderDescriptionObject = null 
)
Parameters
ilDefaultPlaceholderDescription | null$defaultPlaceholderDescriptionObject
ilLanguage | null$language
ilUserDefinedFieldsPlaceholderDescription | null$userDefinedFieldPlaceHolderDescriptionObject

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

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

33  {
34  global $DIC;
35 
36  if (null === $language) {
37  $language = $DIC->language();
38  $language->loadLanguageModule('certificate');
39  }
40  $this->language = $language;
41 
42  if (null === $defaultPlaceholderDescriptionObject) {
43  $defaultPlaceholderDescriptionObject = new ilDefaultPlaceholderDescription($language, $userDefinedFieldPlaceHolderDescriptionObject);
44  }
45  $this->defaultPlaceHolderDescriptionObject = $defaultPlaceholderDescriptionObject;
46 
47  $this->placeholder = $this->defaultPlaceHolderDescriptionObject->getPlaceholderDescriptions();
48 
49  $this->placeholder['RESULT_PASSED'] = ilUtil::prepareFormOutput($this->language->txt('certificate_var_result_passed'));
50  $this->placeholder['RESULT_POINTS'] = ilUtil::prepareFormOutput($this->language->txt('certificate_var_result_points'));
51  $this->placeholder['RESULT_PERCENT'] = ilUtil::prepareFormOutput($this->language->txt('certificate_var_result_percent'));
52  $this->placeholder['MAX_POINTS'] = ilUtil::prepareFormOutput($this->language->txt('certificate_var_max_points'));
53  $this->placeholder['RESULT_MARK_SHORT'] = ilUtil::prepareFormOutput($this->language->txt('certificate_var_result_mark_short'));
54  $this->placeholder['RESULT_MARK_LONG'] = ilUtil::prepareFormOutput($this->language->txt('certificate_var_result_mark_long'));
55  $this->placeholder['TEST_TITLE'] = ilUtil::prepareFormOutput($this->language->txt('certificate_ph_testtitle'));
56  $this->placeholder['DATE_COMPLETED'] = ilUtil::prepareFormOutput($language->txt('certificate_ph_date_completed'));
57  $this->placeholder['DATETIME_COMPLETED'] = ilUtil::prepareFormOutput($language->txt('certificate_ph_datetime_completed'));
58  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getPlaceholderDescriptions()
This method MUST return an array containing an array with the the description as array value...
loadLanguageModule($a_module)
$DIC
Definition: xapitoken.php:46
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()

ilTestPlaceholderDescription::createPlaceholderHtmlDescription ( ilTemplate  $template = null)

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

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

Definition at line 68 of file class.ilTestPlaceholderDescription.php.

References language().

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

ilTestPlaceholderDescription::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 92 of file class.ilTestPlaceholderDescription.php.

References $placeholder.

Field Documentation

◆ $defaultPlaceHolderDescriptionObject

ilTestPlaceholderDescription::$defaultPlaceHolderDescriptionObject
private

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

◆ $language

ilTestPlaceholderDescription::$language
private

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

Referenced by __construct().

◆ $placeholder

ilTestPlaceholderDescription::$placeholder
private

Definition at line 22 of file class.ilTestPlaceholderDescription.php.

Referenced by getPlaceholderDescriptions().


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