ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilUserDefinedFieldsPlaceholderDescription.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
8 {
9  private $placeholder;
10 
14  public function __construct(ilUserDefinedFields $userDefinedFieldsObject = null)
15  {
16  $this->placeholder = array();
17 
18  if (null === $userDefinedFieldsObject) {
19  $userDefinedFieldsObject = ilUserDefinedFields::_getInstance();
20  }
21  $userDefinedFields = $userDefinedFieldsObject->getDefinitions();
22 
23  foreach ($userDefinedFields as $field) {
24  if ($field['certificate']) {
25  $placeholderText = '#' . str_replace(' ', '_', strtoupper($field['field_name']));
26 
27  $this->placeholder[$placeholderText] = $field['field_name'];
28  }
29  }
30  }
31 
38  public function getPlaceholderDescriptions()
39  {
40  return $this->placeholder;
41  }
42 
47  {
48  $template = new ilTemplate(
49  'tpl.common_desc.html',
50  true,
51  true,
52  'Services/Certificate'
53  );
54 
55  foreach ($this->getPlaceholderDescriptions() as $key => $field) {
56  $template->setCurrentBlock('cert_field');
57  $template->setVariable('PH', $key);
58  $template->setVariable('PH_TXT', $field);
59  $template->parseCurrentBlock();
60  }
61 
62  return $template->get();
63  }
64 }
static _getInstance()
Get instance.
$template
Additional user data fields definition.
special template class to simplify handling of ITX/PEAR
__construct(ilUserDefinedFields $userDefinedFieldsObject=null)
getPlaceholderDescriptions()
This method MUST return an array containing an array with the the description as array value...
$key
Definition: croninfo.php:18