ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCertificateSettingsScormFormRepository Class Reference
+ Inheritance diagram for ilCertificateSettingsScormFormRepository:
+ Collaboration diagram for ilCertificateSettingsScormFormRepository:

Public Member Functions

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

Private Attributes

 $object
 
 $language
 
 $settingsFromFactory
 
 $setting
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $language, $object, $setting, $template, and ilObject\getId().

52  {
53  $this->object = $object;
54 
55  $this->language = $language;
56 
57  if (null === $settingsFormRepository) {
58  $settingsFormRepository = new ilCertificateSettingsFormRepository(
59  $object->getId(),
60  $certificatePath,
61  $language,
62  $template,
63  $controller,
64  $access,
65  $toolbar,
66  $placeholderDescriptionObject
67  );
68  }
69 
70  $this->settingsFromFactory = $settingsFormRepository;
71 
72  if (null === $setting) {
73  $setting = new ilSetting('scorm');
74  }
75  $this->setting = $setting;
76  }
$template
getId()
get object id public
+ Here is the call graph for this function:

Member Function Documentation

◆ createForm()

ilCertificateSettingsScormFormRepository::createForm ( ilCertificateGUI  $certificateGUI,
ilCertificate  $certificateObject 
)
Parameters
ilCertificateGUI$certificateGUI
ilCertificate$certificateObject
Returns
ilPropertyFormGUI
Exceptions
ilException
ilWACException

Implements ilCertificateFormRepository.

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

References $form, ilFormPropertyGUI\setRequired(), and ilStr\subStr().

86  {
87  $form = $this->settingsFromFactory->createForm($certificateGUI, $certificateObject);
88 
89  $short_name = new ilTextInputGUI($this->language->txt('certificate_short_name'), 'short_name');
90  $short_name->setRequired(true);
91  $short_name->setValue(ilStr::subStr($this->object->getTitle(), 0, 30));
92  $short_name->setSize(30);
93 
94  $infoText = $this->language->txt('certificate_short_name_description');
95  $short_name->setInfo($infoText);
96 
97  $form->addItem($short_name);
98 
99  return $form;
100  }
static subStr($a_str, $a_start, $a_length=null)
Definition: class.ilStr.php:15
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ fetchFormFieldData()

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

Implements ilCertificateFormRepository.

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

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

◆ save()

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

Implements ilCertificateFormRepository.

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

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

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: