ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilFMSettingsGUI Class Reference

File manager settings. More...

+ Collaboration diagram for ilFMSettingsGUI:

Public Member Functions

 __construct ($a_parent_gui)
 Constructor. More...
 
 executeCommand ()
 Execute command @global 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$

@ilCtrl_Calls ilFMSettingsGUI:

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

Constructor & Destructor Documentation

◆ __construct()

ilFMSettingsGUI::__construct (   $a_parent_gui)

Constructor.

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

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

Member Function Documentation

◆ executeCommand()

ilFMSettingsGUI::executeCommand ( )

Execute command @global ilCtrl $ilCtrl.

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

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

References $cmd, and $ilCtrl.

◆ getParentObject()

ilFMSettingsGUI::getParentObject ( )

Get parent gui.

Returns
ilObjectGUI

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

References $parent_obj.

◆ initSettingsForm()

ilFMSettingsGUI::initSettingsForm ( )
protected

Init settings form.

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

94 {
95 global $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['lng']->txt('settings'));
101 $form->addCommandButton('update', $GLOBALS['lng']->txt('save'));
102 $form->addCommandButton('settings', $GLOBALS['lng']->txt('cancel'));
103
104 // activation
105 $active = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_active'), 'active');
106 $active->setInfo($GLOBALS['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['lng']->txt('fm_settings_local'), 'local');
113 $local->setInfo($GLOBALS['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['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['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 checkbox property in a property form.
static getInstance()
Get singleton instance.
This class represents a number property in a property form.
This class represents a property form user interface.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

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

Referenced by settings(), and update().

+ 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 62 of file class.ilFMSettingsGUI.php.

63 {
64 $form = $this->initSettingsForm();
65
66 $GLOBALS['tpl']->setContent($form->getHTML());
67 }
initSettingsForm()
Init settings form.

References $GLOBALS, and initSettingsForm().

+ Here is the call graph for this function:

◆ update()

ilFMSettingsGUI::update ( )
protected

Update.

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

73 {
74 include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
75 $settings = ilFMSettings::getInstance();
76
77 $form = $this->initSettingsForm();
78 if($form->checkInput())
79 {
80 $settings->enable($form->getInput('active'));
81 $settings->enableLocalFS($form->getInput('local'));
82 $settings->setMaxFileSize($form->getInput('filesize'));
83 $settings->update();
84
85 ilUtil::sendSuccess($GLOBALS['lng']->txt('settings_saved'), true);
86 $GLOBALS['ilCtrl']->redirect($this,'settings');
87 }
88 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

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

+ Here is the call graph for this function:

Field Documentation

◆ $parent_obj

ilFMSettingsGUI::$parent_obj = null
private

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

Referenced by getParentObject().


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