ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjectCustomUserFieldsPlaceholderValues Class Reference
+ Inheritance diagram for ilObjectCustomUserFieldsPlaceholderValues:
+ Collaboration diagram for ilObjectCustomUserFieldsPlaceholderValues:

Public Member Functions

 __construct (?ilCertificateObjectHelper $objectHelper=null, ?ilCertificateUtilHelper $utilHelper=null)
 
 getPlaceholderValuesForPreview (int $userId, int $objId)
 This method is different then the 'getPlaceholderValues' method, this method is used to create a placeholder value array containing dummy values that is used to create a preview certificate. More...
 
- Public Member Functions inherited from ilCertificatePlaceholderValues
 getPlaceholderValues (int $userId, int $objId)
 This method MUST return an array that contains the actual data for the given user of the given object. More...
 

Private Attributes

ilCertificateObjectHelper $objectHelper
 
ilCertificateUtilHelper $utilHelper
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjectCustomUserFieldsPlaceholderValues::__construct ( ?ilCertificateObjectHelper  $objectHelper = null,
?ilCertificateUtilHelper  $utilHelper = null 
)

Member Function Documentation

◆ getPlaceholderValuesForPreview()

ilObjectCustomUserFieldsPlaceholderValues::getPlaceholderValuesForPreview ( int  $userId,
int  $objId 
)

This method is different then the 'getPlaceholderValues' method, this method is used to create a placeholder value array containing dummy values that is used to create a preview certificate.

Parameters
int$userId
int$objId
Returns
array - [PLACEHOLDER] => 'dummy value'

Implements ilCertificatePlaceholderValues.

Definition at line 88 of file class.ilObjectCustomUserFieldsPlaceholderValues.php.

References $DIC, ILIAS\LTI\ToolProvider\$key, $lng, ilCourseDefinedFieldDefinition\_getFields(), and ilStr\strToUpper().

88  : array
89  {
90  global $DIC;
91 
92  $lng = $DIC->language();
93 
94  $course_defined_fields = ilCourseDefinedFieldDefinition::_getFields($objId);
95 
96  $placeholder = [];
97  foreach ($course_defined_fields as $key => $field) {
98  $placeholderText = '+' . str_replace(' ', '_', ilStr::strToUpper($field->getName()));
99 
100  $placeholder[$placeholderText] = $placeholderText . '_' . ilStr::strToUpper($lng->txt('value'));
101  }
102 
103  return $placeholder;
104  }
$lng
$objId
Definition: xapitoken.php:57
static _getFields(int $a_container_id, $a_sort=self::IL_CDF_SORT_NAME)
Get all fields of a container.
global $DIC
Definition: feed.php:28
static strToUpper(string $a_string)
Definition: class.ilStr.php:81
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

Field Documentation

◆ $objectHelper

ilCertificateObjectHelper ilObjectCustomUserFieldsPlaceholderValues::$objectHelper
private

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

Referenced by __construct().

◆ $utilHelper

ilCertificateUtilHelper ilObjectCustomUserFieldsPlaceholderValues::$utilHelper
private

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

Referenced by __construct().


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