ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilLTIToolPlaceholderDescription Class Reference

The placeholders a certificate of an LTI object offers: the default ones, the object, the scores and the completion. More...

+ Inheritance diagram for ilLTIToolPlaceholderDescription:
+ Collaboration diagram for ilLTIToolPlaceholderDescription:

Public Member Functions

 __construct ()
 
 getPlaceholderDescriptions ()
 
 createPlaceholderHtmlDescription (?ilTemplate $template=null)
 
- 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

ilLanguage $language
 
array $placeholders
 

Detailed Description

The placeholders a certificate of an LTI object offers: the default ones, the object, the scores and the completion.

ilCertificateGUIFactory creates it by this name.

Author
Saúl Díaz sdiaz.nosp@m.@sur.nosp@m.labs..nosp@m.com

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

Constructor & Destructor Documentation

◆ __construct()

ilLTIToolPlaceholderDescription::__construct ( )

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

33 {
34 global $DIC;
35
36 $this->language = $DIC->language();
37 $this->language->loadLanguageModule('certificate');
38
39 $default = new ilDefaultPlaceholderDescription($this->language, $DIC['user']->getProfile());
40 $own = [
41 'OBJECT_TITLE' => 'lti_cert_ph_object_title',
42 'OBJECT_DESCRIPTION' => 'lti_cert_ph_object_description',
43 'MASTERY_SCORE' => 'lti_cert_ph_mastery_score',
44 'REACHED_SCORE' => 'lti_cert_ph_reached_score',
45 'DATE_COMPLETED' => 'certificate_ph_date_completed',
46 'DATETIME_COMPLETED' => 'certificate_ph_datetime_completed',
47 ];
48
49 $util_helper = new ilCertificateUtilHelper();
50 $this->placeholders = $default->getPlaceholderDescriptions() + array_map(
51 fn(string $txt): string => $util_helper->prepareFormOutput($this->language->txt($txt)),
52 $own
53 );
54 }
Just a wrapper class to create Unit Test for other classes.
Collection of basic placeholder values that can be used.
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ createPlaceholderHtmlDescription()

ilLTIToolPlaceholderDescription::createPlaceholderHtmlDescription ( ?ilTemplate  $template = null)
Exceptions
ilTemplateException

Definition at line 67 of file class.ilLTIToolPlaceholderDescription.php.

67 : string
68 {
69 $template ??= new ilTemplate('tpl.default_description.html', true, true, 'components/ILIAS/Certificate');
70 $template->setVariable('PLACEHOLDER_INTRODUCTION', $this->language->txt('certificate_ph_introduction'));
71
72 $template->setCurrentBlock('items');
73 foreach ($this->placeholders as $id => $caption) {
74 $template->setVariable('ID', $id);
75 $template->setVariable('TXT', $caption);
76 $template->parseCurrentBlock();
77 }
78
79 return $template->get();
80 }
$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()

ilLTIToolPlaceholderDescription::getPlaceholderDescriptions ( )
Returns
array

Implements ilCertificatePlaceholderDescription.

Definition at line 59 of file class.ilLTIToolPlaceholderDescription.php.

References $placeholders.

Field Documentation

◆ $language

ilLanguage ilLTIToolPlaceholderDescription::$language
private

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

◆ $placeholders

array ilLTIToolPlaceholderDescription::$placeholders
private

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