ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjectCustomUserFieldsPlaceholderDescription Class Reference
+ Inheritance diagram for ilObjectCustomUserFieldsPlaceholderDescription:
+ Collaboration diagram for ilObjectCustomUserFieldsPlaceholderDescription:

Public Member Functions

 __construct (private readonly int $objectId)
 
 getPlaceholderDescriptions ()
 This method MUST return an array containing an array with the the description as array value. More...
 
 createPlaceholderHtmlDescription ()
 

Private Member Functions

 initPlaceholders ()
 

Private Attributes

array $placeholder
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjectCustomUserFieldsPlaceholderDescription::__construct ( private readonly int  $objectId)

Definition at line 25 of file class.ilObjectCustomUserFieldsPlaceholderDescription.php.

References initPlaceholders().

26  {
27  $this->placeholder = [];
28 
29  $this->initPlaceholders();
30  }
+ Here is the call graph for this function:

Member Function Documentation

◆ createPlaceholderHtmlDescription()

ilObjectCustomUserFieldsPlaceholderDescription::createPlaceholderHtmlDescription ( )
Returns
string - HTML that can used to be displayed in the GUI

Implements ilCertificatePlaceholderDescription.

Definition at line 55 of file class.ilObjectCustomUserFieldsPlaceholderDescription.php.

References getPlaceholderDescriptions().

55  : string
56  {
57  $template = new ilTemplate(
58  'tpl.common_desc.html',
59  true,
60  true,
61  'components/ILIAS/Certificate'
62  );
63 
64  foreach ($this->getPlaceholderDescriptions() as $key => $field) {
65  $template->setCurrentBlock('cert_field');
66  $template->setVariable('PH', $key);
67  $template->setVariable('PH_TXT', $field);
68  $template->parseCurrentBlock();
69  }
70 
71  return $template->get();
72  }
getPlaceholderDescriptions()
This method MUST return an array containing an array with the the description as array value...
+ Here is the call graph for this function:

◆ getPlaceholderDescriptions()

ilObjectCustomUserFieldsPlaceholderDescription::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 50 of file class.ilObjectCustomUserFieldsPlaceholderDescription.php.

References $placeholder.

Referenced by ILIAS\Course\Certificate\CoursePlaceholderDescription\__construct(), and createPlaceholderHtmlDescription().

+ Here is the caller graph for this function:

◆ initPlaceholders()

ilObjectCustomUserFieldsPlaceholderDescription::initPlaceholders ( )
private

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

References ilCourseDefinedFieldDefinition\_getFields(), and ilStr\strToUpper().

Referenced by __construct().

32  : void
33  {
34  $courseDefinedFields = ilCourseDefinedFieldDefinition::_getFields($this->objectId);
35 
36  foreach ($courseDefinedFields as $field) {
37  $name = $field->getName();
38 
39  $placeholderText = '+' . str_replace(' ', '_', ilStr::strToUpper($name));
40 
41  $this->placeholder[$placeholderText] = $name;
42  }
43  }
static _getFields(int $a_container_id, $a_sort=self::IL_CDF_SORT_NAME)
Get all fields of a container.
static strToUpper(string $a_string)
Definition: class.ilStr.php:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $placeholder

array ilObjectCustomUserFieldsPlaceholderDescription::$placeholder
private

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