ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilDefaultPlaceholderValues Class Reference

Collection of basic placeholder values that can be used. More...

+ Inheritance diagram for ilDefaultPlaceholderValues:
+ Collaboration diagram for ilDefaultPlaceholderValues:

Public Member Functions

 __construct (ilCertificateObjectHelper $objectHelper=null, ilCertificateDateHelper $dateHelper=null, int $dateFormat=null, ilLanguage $language=null, ilCertificateUtilHelper $utilHelper=null, ilUserDefinedFieldsPlaceholderValues $userDefinedFieldsPlaceholderValues=null, $birthdayDateFormat=IL_CAL_DATE)
 
 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

 $placeholder
 
 $objectHelper
 
 $dateHelper
 
 $dateFormat
 
 $language
 
 $utilHelper
 
 $userDefinedFieldsPlaceholderValues
 
 $birthdayDateFormat
 

Detailed Description

Collection of basic placeholder values that can be used.

Author
Niels Theen nthee.nosp@m.n@da.nosp@m.tabay.nosp@m..de

Definition at line 8 of file class.ilDefaultPlaceholderValues.php.

Constructor & Destructor Documentation

◆ __construct()

ilDefaultPlaceholderValues::__construct ( ilCertificateObjectHelper  $objectHelper = null,
ilCertificateDateHelper  $dateHelper = null,
int  $dateFormat = null,
ilLanguage  $language = null,
ilCertificateUtilHelper  $utilHelper = null,
ilUserDefinedFieldsPlaceholderValues  $userDefinedFieldsPlaceholderValues = null,
  $birthdayDateFormat = IL_CAL_DATE 
)
Parameters
ilCertificateObjectHelper$objectHelper
ilCertificateDateHelper$dateHelper
int$dateFormat
ilLanguage | null$language
ilCertificateUtilHelper | null$utilHelper
ilUserDefinedFieldsPlaceholderValues | null$userDefinedFieldsPlaceholderValues

Definition at line 58 of file class.ilDefaultPlaceholderValues.php.

References $birthdayDateFormat, $dateFormat, $dateHelper, $DIC, $language, $objectHelper, $placeholder, $user, $userDefinedFieldsPlaceholderValues, $utilHelper, ilCertificatePlaceholderValues\getPlaceholderValues(), and IL_CAL_UNIX.

66  {
67  if (null === $objectHelper) {
68  $objectHelper = new ilCertificateObjectHelper();
69  }
70  $this->objectHelper = $objectHelper;
71 
72  if (null === $dateHelper) {
73  $dateHelper = new ilCertificateDateHelper();
74  }
75  $this->dateHelper = $dateHelper;
76 
77  if (null === $dateFormat) {
79  }
80  $this->dateFormat = $dateFormat;
81 
82  if (null === $language) {
83  global $DIC;
84  $language = $DIC->language();
85  }
86  $this->language = $language;
87 
88  if (null === $utilHelper) {
89  $utilHelper = new ilCertificateUtilHelper();
90  }
91  $this->utilHelper = $utilHelper;
92 
93  if (null === $userDefinedFieldsPlaceholderValues) {
94  $userDefinedFieldsPlaceholderValues = new ilUserDefinedFieldsPlaceholderValues();
95  }
96  $this->userDefinedFieldsPlaceholderValues = $userDefinedFieldsPlaceholderValues;
97 
98  $this->birthdayDateFormat = $birthdayDateFormat;
99 
100  $this->placeholder = array(
101  'USER_LOGIN' => '',
102  'USER_FULLNAME' => '',
103  'USER_FIRSTNAME' => '',
104  'USER_LASTNAME' => '',
105  'USER_TITLE' => '',
106  'USER_SALUTATION' => '',
107  'USER_BIRTHDAY' => '',
108  'USER_INSTITUTION' => '',
109  'USER_DEPARTMENT' => '',
110  'USER_STREET' => '',
111  'USER_CITY' => '',
112  'USER_ZIPCODE' => '',
113  'USER_COUNTRY' => '',
114  'USER_MATRICULATION' => '',
115  'DATE' => '',
116  'DATETIME' => '',
117  'DATE_COMPLETED' => '',
118  'DATETIME_COMPLETED' => '',
119  );
120  }
global $DIC
Definition: saml.php:7
const IL_CAL_UNIX
Just a wrapper class to create Unit Test for other classes.
+ Here is the call graph for this function:

Member Function Documentation

◆ getPlaceholderValuesForPreview()

ilDefaultPlaceholderValues::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.

Due the fact that this is a class to create default values the placeholder values will be identical to the description

Parameters
int$userId
int$objId
Returns
mixed
Exceptions
ilDateTimeException
ilException
ilInvalidCertificateException

Implements ilCertificatePlaceholderValues.

Definition at line 189 of file class.ilDefaultPlaceholderValues.php.

189  : array
190  {
191  $previewPlacholderValues = array(
192  "USER_LOGIN" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_login")),
193  "USER_FULLNAME" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_fullname")),
194  "USER_FIRSTNAME" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_firstname")),
195  "USER_LASTNAME" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_lastname")),
196  "USER_TITLE" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_title")),
197  "USER_SALUTATION" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_salutation")),
198  "USER_BIRTHDAY" => $this->utilHelper->prepareFormOutput((trim($this->dateHelper->formatDate(time(), $this->dateFormat)))),
199  "USER_INSTITUTION" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_institution")),
200  "USER_DEPARTMENT" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_department")),
201  "USER_STREET" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_street")),
202  "USER_CITY" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_city")),
203  "USER_ZIPCODE" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_zipcode")),
204  "USER_COUNTRY" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_country")),
205  "USER_MATRICULATION" => $this->utilHelper->prepareFormOutput($this->language->txt("certificate_var_user_matriculation")),
206  'DATE' => $this->utilHelper->prepareFormOutput((trim($this->dateHelper->formatDate(time(), $this->dateFormat)))),
207  'DATETIME' => $this->utilHelper->prepareFormOutput((trim($this->dateHelper->formatDatetime(time(), $this->dateFormat)))),
208  'DATE_COMPLETED' => $this->utilHelper->prepareFormOutput((trim($this->dateHelper->formatDate(time(), $this->dateFormat)))),
209  'DATETIME_COMPLETED' => $this->utilHelper->prepareFormOutput((trim($this->dateHelper->formatDatetime(time(), $this->dateFormat))))
210  );
211 
212  return array_merge($previewPlacholderValues, $this->userDefinedFieldsPlaceholderValues->getPlaceholderValuesForPreview($userId, $objId));
213  }

Field Documentation

◆ $birthdayDateFormat

ilDefaultPlaceholderValues::$birthdayDateFormat
private

Definition at line 48 of file class.ilDefaultPlaceholderValues.php.

Referenced by __construct().

◆ $dateFormat

ilDefaultPlaceholderValues::$dateFormat
private

Definition at line 28 of file class.ilDefaultPlaceholderValues.php.

Referenced by __construct().

◆ $dateHelper

ilDefaultPlaceholderValues::$dateHelper
private

Definition at line 23 of file class.ilDefaultPlaceholderValues.php.

Referenced by __construct().

◆ $language

ilDefaultPlaceholderValues::$language
private

Definition at line 33 of file class.ilDefaultPlaceholderValues.php.

Referenced by __construct().

◆ $objectHelper

ilDefaultPlaceholderValues::$objectHelper
private

Definition at line 18 of file class.ilDefaultPlaceholderValues.php.

Referenced by __construct().

◆ $placeholder

ilDefaultPlaceholderValues::$placeholder
private

Definition at line 13 of file class.ilDefaultPlaceholderValues.php.

Referenced by __construct().

◆ $userDefinedFieldsPlaceholderValues

ilDefaultPlaceholderValues::$userDefinedFieldsPlaceholderValues
private

Definition at line 43 of file class.ilDefaultPlaceholderValues.php.

Referenced by __construct().

◆ $utilHelper

ilDefaultPlaceholderValues::$utilHelper
private

Definition at line 38 of file class.ilDefaultPlaceholderValues.php.

Referenced by __construct().


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