ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilCertificateSettingsScormFormRepository Class Reference
+ Inheritance diagram for ilCertificateSettingsScormFormRepository:
+ Collaboration diagram for ilCertificateSettingsScormFormRepository:

Public Member Functions

 __construct (ilObject $object, string $certificatePath, bool $hasAdditionalElements, ilLanguage $language, ilCtrl $controller, ilAccess $access, ilToolbarGUI $toolbar, ilCertificatePlaceholderDescription $placeholderDescriptionObject, ilCertificateSettingsFormRepository $settingsFormRepository=null, ilSetting $setting=null)
 
 createForm (ilCertificateGUI $certificateGUI)
 
 save (array $formFields)
 
 fetchFormFieldData (string $content)
 
 createForm (ilCertificateGUI $certificateGUI)
 
 save (array $formFields)
 
 fetchFormFieldData (string $content)
 

Private Attributes

 $object
 
 $language
 
 $settingsFromFactory
 
 $setting
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCertificateSettingsScormFormRepository::__construct ( ilObject  $object,
string  $certificatePath,
bool  $hasAdditionalElements,
ilLanguage  $language,
ilCtrl  $controller,
ilAccess  $access,
ilToolbarGUI  $toolbar,
ilCertificatePlaceholderDescription  $placeholderDescriptionObject,
ilCertificateSettingsFormRepository  $settingsFormRepository = null,
ilSetting  $setting = null 
)
Parameters
ilObject$object
string$certificatePath
ilLanguage$language
ilCtrl$controller
ilAccess$access
ilToolbarGUI$toolbar
ilCertificatePlaceholderDescription$placeholderDescriptionObject
ilCertificateSettingsFormRepository | null$settingsFormRepository
ilSetting | null$setting

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

51 {
52 $this->object = $object;
53
54 $this->language = $language;
55
56 if (null === $settingsFormRepository) {
57 $settingsFormRepository = new ilCertificateSettingsFormRepository(
58 $object->getId(),
59 $certificatePath,
60 $hasAdditionalElements,
62 $controller,
63 $access,
64 $toolbar,
65 $placeholderDescriptionObject
66 );
67 }
68
69 $this->settingsFromFactory = $settingsFormRepository;
70
71 if (null === $setting) {
72 $setting = new ilSetting('scorm');
73 }
74 $this->setting = $setting;
75 }
ILIAS Setting Class.
language()
Definition: language.php:2

References $language, $object, $setting, and language().

+ Here is the call graph for this function:

Member Function Documentation

◆ createForm()

ilCertificateSettingsScormFormRepository::createForm ( ilCertificateGUI  $certificateGUI)
Parameters
ilCertificateGUI$certificateGUI
string$certificatePath
Returns
ilPropertyFormGUI
Exceptions

ILIAS\Filesystem\Exception\FileAlreadyExistsException

Exceptions

ILIAS\Filesystem\Exception\FileNotFoundException

Exceptions

ILIAS\Filesystem\Exception\IOException

Exceptions
ilDatabaseException
ilException
ilWACException

Implements ilCertificateFormRepository.

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

89 {
90 $form = $this->settingsFromFactory->createForm($certificateGUI);
91
92 $short_name = new ilTextInputGUI($this->language->txt('certificate_short_name'), 'short_name');
93 $short_name->setRequired(true);
94 $short_name->setValue(ilStr::subStr($this->object->getTitle(), 0, 30));
95 $short_name->setSize(30);
96
97 $infoText = $this->language->txt('certificate_short_name_description');
98 $short_name->setInfo($infoText);
99
100 $form->addItem($short_name);
101
102 return $form;
103 }
static subStr($a_str, $a_start, $a_length=null)
Definition: class.ilStr.php:15
This class represents a text property in a property form.

References language(), and ilStr\subStr().

+ Here is the call graph for this function:

◆ fetchFormFieldData()

ilCertificateSettingsScormFormRepository::fetchFormFieldData ( string  $content)
Parameters
string$content
Returns
array|mixed

Implements ilCertificateFormRepository.

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

119 {
120 $formFields = $this->settingsFromFactory->fetchFormFieldData($content);
121 $formFields['certificate_enabled_scorm'] = $this->setting->get('certificate_' . $this->object->getId(), $formFields['certificate_enabled_scorm']);
122 $formFields['short_name'] = $this->setting->get('certificate_short_name_' . $this->object->getId(), $formFields['short_name']);
123
124 return $formFields;
125 }

◆ save()

ilCertificateSettingsScormFormRepository::save ( array  $formFields)
Parameters
array$formFields

Implements ilCertificateFormRepository.

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

109 {
110 $this->setting->set('certificate_' . $this->object->getId(), $formFields['certificate_enabled_scorm']);
111 $this->setting->set('certificate_short_name_' . $this->object->getId(), $formFields['short_name']);
112 }

Field Documentation

◆ $language

ilCertificateSettingsScormFormRepository::$language
private

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

Referenced by __construct().

◆ $object

ilCertificateSettingsScormFormRepository::$object
private

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

Referenced by __construct().

◆ $setting

ilCertificateSettingsScormFormRepository::$setting
private

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

Referenced by __construct().

◆ $settingsFromFactory

ilCertificateSettingsScormFormRepository::$settingsFromFactory
private

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