ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilFMSettingsGUI Class Reference

File manager settings. More...

+ Collaboration diagram for ilFMSettingsGUI:

Public Member Functions

 __construct ($a_parent_gui)
 Constructor. More...
 
 executeCommand ()
 Execute command ilCtrl $ilCtrl. More...
 
 getParentObject ()
 Get parent gui. More...
 

Protected Member Functions

 settings ()
 Show settings. More...
 
 update ()
 Update. More...
 
 initSettingsForm ()
 Init settings form. More...
 

Private Attributes

 $parent_obj = null
 

Detailed Description

File manager settings.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e $Id$

ilFMSettingsGUI:

Definition at line 14 of file class.ilFMSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilFMSettingsGUI::__construct (   $a_parent_gui)

Constructor.

Definition at line 21 of file class.ilFMSettingsGUI.php.

22  {
23  $this->parent_obj = $a_parent_gui;
24  }

Member Function Documentation

◆ executeCommand()

ilFMSettingsGUI::executeCommand ( )

Execute command ilCtrl $ilCtrl.

Definition at line 30 of file class.ilFMSettingsGUI.php.

References $DIC, and $ilCtrl.

31  {
32  global $DIC;
33 
34  $ilCtrl = $DIC['ilCtrl'];
35 
36  $next_class = $ilCtrl->getNextClass();
37  $cmd = $ilCtrl->getCmd();
38  switch ($next_class) {
39  default:
40  if (!$cmd) {
41  $cmd = 'settings';
42  }
43  $this->$cmd();
44  break;
45 
46  }
47  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18

◆ getParentObject()

ilFMSettingsGUI::getParentObject ( )

Get parent gui.

Returns
ilObjectGUI

Definition at line 53 of file class.ilFMSettingsGUI.php.

References $parent_obj.

54  {
55  return $this->parent_obj;
56  }

◆ initSettingsForm()

ilFMSettingsGUI::initSettingsForm ( )
protected

Init settings form.

Definition at line 91 of file class.ilFMSettingsGUI.php.

References $DIC, $form, $GLOBALS, $ilCtrl, and ilFMSettings\getInstance().

Referenced by settings(), and update().

92  {
93  global $DIC;
94 
95  $ilCtrl = $DIC['ilCtrl'];
96 
97  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
98  $form = new ilPropertyFormGUI();
99  $form->setFormAction($ilCtrl->getFormAction($this));
100  $form->setTitle($GLOBALS['DIC']['lng']->txt('settings'));
101  $form->addCommandButton('update', $GLOBALS['DIC']['lng']->txt('save'));
102  $form->addCommandButton('settings', $GLOBALS['DIC']['lng']->txt('cancel'));
103 
104  // activation
105  $active = new ilCheckboxInputGUI($GLOBALS['DIC']['lng']->txt('fm_settings_active'), 'active');
106  $active->setInfo($GLOBALS['DIC']['lng']->txt('fm_settings_active_info'));
107  $active->setValue(1);
108  $active->setChecked(ilFMSettings::getInstance()->isEnabled());
109  $form->addItem($active);
110 
111  // one frame
112  $local = new ilCheckboxInputGUI($GLOBALS['DIC']['lng']->txt('fm_settings_local'), 'local');
113  $local->setInfo($GLOBALS['DIC']['lng']->txt('fm_settings_local_info'));
114  $local->setValue(1);
115  $local->setChecked(ilFMSettings::getInstance()->IsLocalFSEnabled());
116  $form->addItem($local);
117 
118  $fs = new ilNumberInputGUI($GLOBALS['DIC']['lng']->txt('fm_settings_filesize'), 'filesize');
119  $fs->setSuffix('MiB');
120  $fs->setSize(3);
121  $fs->setMaxLength(3);
122  $fs->setMinValue(1);
123  $fs->setMaxValue(999);
124  $fs->setInfo($GLOBALS['DIC']['lng']->txt('fm_settings_filesize_info'));
125  $fs->setValue(ilFMSettings::getInstance()->getMaxFileSize());
126  $form->addItem($fs);
127 
128  return $form;
129  }
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
This class represents a number property in a property form.
static getInstance()
Get singleton instance.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settings()

ilFMSettingsGUI::settings ( )
protected

Show settings.

Definition at line 61 of file class.ilFMSettingsGUI.php.

References $form, $GLOBALS, and initSettingsForm().

62  {
63  $form = $this->initSettingsForm();
64 
65  $GLOBALS['DIC']['tpl']->setContent($form->getHTML());
66  }
initSettingsForm()
Init settings form.
if(isset($_POST['submit'])) $form
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ update()

ilFMSettingsGUI::update ( )
protected

Update.

Definition at line 71 of file class.ilFMSettingsGUI.php.

References $form, $GLOBALS, ilFMSettings\getInstance(), and initSettingsForm().

72  {
73  include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
74  $settings = ilFMSettings::getInstance();
75 
76  $form = $this->initSettingsForm();
77  if ($form->checkInput()) {
78  $settings->enable($form->getInput('active'));
79  $settings->enableLocalFS($form->getInput('local'));
80  $settings->setMaxFileSize($form->getInput('filesize'));
81  $settings->update();
82 
83  ilUtil::sendSuccess($GLOBALS['DIC']['lng']->txt('settings_saved'), true);
84  $GLOBALS['DIC']['ilCtrl']->redirect($this, 'settings');
85  }
86  }
initSettingsForm()
Init settings form.
if(isset($_POST['submit'])) $form
static getInstance()
Get singleton instance.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

Field Documentation

◆ $parent_obj

ilFMSettingsGUI::$parent_obj = null
private

Definition at line 16 of file class.ilFMSettingsGUI.php.

Referenced by getParentObject().


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