ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 
 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.

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:26

References $DIC.

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.

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 }
This class represents a property form user interface.
static subStr(string $a_str, int $a_start, ?int $a_length=null)
Definition: class.ilStr.php:21
This class represents a text property in a property form.

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

+ Here is the call graph for this function:

◆ fetchFormFieldData()

ilCertificateSettingsScormFormRepository::fetchFormFieldData ( string  $content)

Implements ilCertificateFormRepository.

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

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 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ save()

ilCertificateSettingsScormFormRepository::save ( array  $formFields)

Implements ilCertificateFormRepository.

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

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 }

References ILIAS\Repository\object().

+ 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: