ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilScormPlaceholderDescription Class Reference
+ Inheritance diagram for ilScormPlaceholderDescription:
+ Collaboration diagram for ilScormPlaceholderDescription:

Public Member Functions

 __construct (ilObject $object, ilDefaultPlaceholderDescription $defaultPlaceholderDescriptionObject=null, ilLanguage $language=null, ilObjectLP $learningProgressObject=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
 getPlaceholderDescriptions ()
 This method MUST return an array containing an array with the the description as array value. More...
 
 createPlaceholderHtmlDescription ()
 

Private Attributes

 $defaultPlaceHolderDescriptionObject
 
 $language
 
 $placeholder
 
 $object
 
 $learningProgressObject
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilScormPlaceholderDescription::__construct ( ilObject  $object,
ilDefaultPlaceholderDescription  $defaultPlaceholderDescriptionObject = null,
ilLanguage  $language = null,
ilObjectLP  $learningProgressObject = null,
ilUserDefinedFieldsPlaceholderDescription  $userDefinedFieldPlaceHolderDescriptionObject = null 
)
Parameters
ilObject$object
ilDefaultPlaceholderDescription | null$defaultPlaceholderDescriptionObject
ilLanguage | null$language
ilObjectLP | null$learningProgressObject
ilUserDefinedFieldsPlaceholderDescription | null$userDefinedFieldPlaceHolderDescriptionObject

Definition at line 41 of file class.ilScormPlaceholderDescription.php.

47 {
48 global $DIC;
49
50 $this->object = $object;
51
52 if (null === $language) {
53 $language = $DIC->language();
54 }
55 $this->language = $language;
56
57 if (null === $defaultPlaceholderDescriptionObject) {
58 $defaultPlaceholderDescriptionObject = new ilDefaultPlaceholderDescription($language, $userDefinedFieldPlaceHolderDescriptionObject);
59 }
60 $this->defaultPlaceHolderDescriptionObject = $defaultPlaceholderDescriptionObject;
61
62 if (null === $learningProgressObject) {
63 $learningProgressObject = ilObjectLP::getInstance($this->object->getId());
64 }
65 $this->learningProgressObject = $learningProgressObject;
66
67 $this->placeholder = $this->defaultPlaceHolderDescriptionObject->getPlaceholderDescriptions();
68
69 $this->placeholder['SCORM_TITLE'] = $language->txt('certificate_ph_scormtitle');
70 $this->placeholder['SCORM_POINTS'] = $language->txt('certificate_ph_scormpoints');
71 $this->placeholder['SCORM_POINTS_MAX'] = $language->txt('certificate_ph_scormmaxpoints');
72 $this->placeholder['DATE_COMPLETED'] = ilUtil::prepareFormOutput($language->txt('certificate_ph_date_completed'));
73 $this->placeholder['DATETIME_COMPLETED'] = ilUtil::prepareFormOutput($language->txt('certificate_ph_datetime_completed'));
74 }
Collection of basic placeholder values that can be used.
static getInstance($a_obj_id)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
global $DIC
Definition: saml.php:7

References $DIC, $language, $learningProgressObject, $object, ilObjectLP\getInstance(), and ilUtil\prepareFormOutput().

+ Here is the call graph for this function:

Member Function Documentation

◆ createPlaceholderHtmlDescription()

ilScormPlaceholderDescription::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 83 of file class.ilScormPlaceholderDescription.php.

83 : string
84 {
85 if (null === $template) {
86 $template = new ilTemplate('tpl.scorm_description.html', true, true, 'Services/Certificate');
87 }
88
89 $template->setCurrentBlock('items');
90
91 foreach ($this->placeholder as $id => $caption) {
92 $template->setVariable('ID', $id);
93 $template->setVariable('TXT', $caption);
94 $template->parseCurrentBlock();
95 }
96
97 $template->setVariable('PH_INTRODUCTION', $this->language->txt('certificate_ph_introduction'));
98
99 $collection = $this->learningProgressObject->getCollectionInstance();
100 if ($collection) {
101 $items = $collection->getPossibleItems();
102 }
103
104 if (!$items) {
105 $template->setCurrentBlock('NO_SCO');
106 $template->setVariable('PH_NO_SCO', $this->language->txt('certificate_ph_no_sco'));
107 $template->parseCurrentBlock();
108 } else {
109 $template->setCurrentBlock('SCOS');
110 $template->setVariable('PH_SCOS', $this->language->txt('certificate_ph_scos'));
111 $template->parseCurrentBlock();
112 $template->setCurrentBlock('SCO_HEADER');
113 $template->setVariable('PH_TITLE_SCO', $this->language->txt('certificate_ph_title_sco'));
114 $template->setVariable('PH_SCO_TITLE', $this->language->txt('certificate_ph_sco_title'));
115 $template->setVariable('PH_SCO_POINTS_RAW', $this->language->txt('certificate_ph_sco_points_raw'));
116 $template->setVariable('PH_SCO_POINTS_MAX', $this->language->txt('certificate_ph_sco_points_max'));
117 $template->setVariable('PH_SCO_POINTS_SCALED', $this->language->txt('certificate_ph_sco_points_scaled'));
118 $template->parseCurrentBlock();
119 }
120
121 if ($collection) {
122 $counter = 0;
123 foreach ($items as $item_id => $sahs_item) {
124 if ($collection->isAssignedEntry($item_id)) {
125 $template->setCurrentBlock('SCO');
126 $template->setVariable('SCO_TITLE', $sahs_item['title']);
127 $template->setVariable('PH_SCO_TITLE', '[SCO_T_' . $counter . ']');
128 $template->setVariable('PH_SCO_POINTS_RAW', '[SCO_P_' . $counter . ']');
129 $template->setVariable('PH_SCO_POINTS_MAX', '[SCO_PM_' . $counter . ']');
130 $template->setVariable('PH_SCO_POINTS_SCALED', '[SCO_PP_' . $counter . ']');
131 $template->parseCurrentBlock();
132 $counter++;
133 }
134 }
135 }
136
137 return $template->get();
138 }
special template class to simplify handling of ITX/PEAR
$template
if(!array_key_exists('StateId', $_REQUEST)) $id

References $id, and $template.

◆ getPlaceholderDescriptions()

ilScormPlaceholderDescription::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 146 of file class.ilScormPlaceholderDescription.php.

References $placeholder.

Field Documentation

◆ $defaultPlaceHolderDescriptionObject

ilScormPlaceholderDescription::$defaultPlaceHolderDescriptionObject
private

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

◆ $language

ilScormPlaceholderDescription::$language
private

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

Referenced by __construct().

◆ $learningProgressObject

ilScormPlaceholderDescription::$learningProgressObject
private

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

Referenced by __construct().

◆ $object

ilScormPlaceholderDescription::$object
private

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

Referenced by __construct().

◆ $placeholder

ilScormPlaceholderDescription::$placeholder
private

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

Referenced by getPlaceholderDescriptions().


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