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

Public Member Functions

 __construct (private readonly ilObject $object, string $certificatePath, bool $hasAdditionalElements, private readonly ilLanguage $language, ilCtrlInterface $ctrl, ilAccess $access, ilToolbarGUI $toolbar, ilCertificatePlaceholderDescription $placeholderDescriptionObject, ?ilCertificateSettingsFormRepository $settingsFormRepository=null, private readonly ilSetting $setting=new ilSetting('scorm'))
 
 createForm (ilCertificateGUI $certificateGUI)
 
 save (array $formFields)
 
 fetchFormFieldData (string $content)
 

Private Attributes

readonly ilCertificateSettingsFormRepository $settingsFormFactory
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCertificateSettingsScormFormRepository::__construct ( private readonly ilObject  $object,
string  $certificatePath,
bool  $hasAdditionalElements,
private readonly ilLanguage  $language,
ilCtrlInterface  $ctrl,
ilAccess  $access,
ilToolbarGUI  $toolbar,
ilCertificatePlaceholderDescription  $placeholderDescriptionObject,
?ilCertificateSettingsFormRepository  $settingsFormRepository = null,
private readonly ilSetting  $setting = new ilSetting('scorm') 
)

Definition at line 29 of file class.ilCertificateSettingsScormFormRepository.php.

References $DIC.

40  {
41  global $DIC;
42 
43  $this->settingsFormFactory = $settingsFormRepository ?? new ilCertificateSettingsFormRepository(
44  $object->getId(),
45  $certificatePath,
46  $hasAdditionalElements,
47  $language,
48  $ctrl,
49  $access,
50  $toolbar,
51  $placeholderDescriptionObject,
52  $DIC->ui()->factory(),
53  $DIC->ui()->renderer()
54  );
55  }
global $DIC
Definition: shib_login.php:22

Member Function Documentation

◆ createForm()

ilCertificateSettingsScormFormRepository::createForm ( ilCertificateGUI  $certificateGUI)
Exceptions
FileAlreadyExistsException
FileNotFoundException
IOException
ilDatabaseException
ilException
ilWACException

Implements ilCertificateFormRepository.

Definition at line 65 of file class.ilCertificateSettingsScormFormRepository.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\Repository\object(), and ilStr\subStr().

66  {
67  $form = $this->settingsFormFactory->createForm($certificateGUI);
68 
69  $short_name = new ilTextInputGUI($this->language->txt('certificate_short_name'), 'short_name');
70  $short_name->setRequired(true);
71  $short_name->setValue(ilStr::subStr($this->object->getTitle(), 0, 30));
72  $short_name->setSize(30);
73 
74  $short_name_value = $this->setting->get(
75  'certificate_short_name_' . $this->object->getId(),
76  ''
77  );
78 
79  $infoText = $this->language->txt('certificate_short_name_description');
80  if ($short_name_value !== '') {
81  $short_name->setInfo(str_replace(
82  '[SHORT_TITLE]',
83  $short_name_value,
84  $infoText
85  ));
86  } else {
87  $short_name->setInfo($infoText);
88  }
89 
90  $form->addItem($short_name);
91 
92  return $form;
93  }
static subStr(string $a_str, int $a_start, ?int $a_length=null)
Definition: class.ilStr.php:24
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ fetchFormFieldData()

ilCertificateSettingsScormFormRepository::fetchFormFieldData ( string  $content)

Implements ilCertificateFormRepository.

Definition at line 101 of file class.ilCertificateSettingsScormFormRepository.php.

References ILIAS\Repository\object().

101  : array
102  {
103  $formFields = $this->settingsFormFactory->fetchFormFieldData($content);
104  $formFields['certificate_enabled_scorm'] = $this->setting->get(
105  'certificate_' . $this->object->getId(),
106  (string) ($formFields['certificate_enabled_scorm'] ?? '0')
107  );
108  $formFields['short_name'] = $this->setting->get(
109  'certificate_short_name_' . $this->object->getId(),
110  (string) ($formFields['short_name'] ?? '')
111  );
112 
113  return $formFields;
114  }
+ Here is the call graph for this function:

◆ save()

ilCertificateSettingsScormFormRepository::save ( array  $formFields)

Implements ilCertificateFormRepository.

Definition at line 95 of file class.ilCertificateSettingsScormFormRepository.php.

References ILIAS\Repository\object().

95  : void
96  {
97  $this->setting->set('certificate_' . $this->object->getId(), (string) ($formFields['certificate_enabled_scorm'] ?? '0'));
98  $this->setting->set('certificate_short_name_' . $this->object->getId(), (string) ($formFields['short_name'] ?? ''));
99  }
+ Here is the call graph for this function:

Field Documentation

◆ $settingsFormFactory

readonly ilCertificateSettingsFormRepository ilCertificateSettingsScormFormRepository::$settingsFormFactory
private

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