ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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

 $dic
 
 $ctrl
 
 $rbacsystem
 
 $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 34 of file class.ilFMSettingsGUI.php.

35 {
36 global $DIC;
37 $this->dic = $DIC;
38 $this->ctrl = $this->dic->ctrl();
39 $this->rbacsystem = $this->dic->rbac()->system();
40 $this->parent_obj = $a_parent_gui;
41 }
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ executeCommand()

ilFMSettingsGUI::executeCommand ( )

Execute command @global ilCtrl $ilCtrl.

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

48 {
49 global $ilCtrl;
50
51 $next_class = $ilCtrl->getNextClass();
52 $cmd = $ilCtrl->getCmd();
53 switch ($next_class) {
54 default:
55 if (!$cmd) {
56 $cmd = 'settings';
57 }
58 $this->$cmd();
59 break;
60
61 }
62 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl.

◆ getParentObject()

ilFMSettingsGUI::getParentObject ( )

Get parent gui.

Returns
ilObjectGUI

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

References $parent_obj.

◆ initSettingsForm()

ilFMSettingsGUI::initSettingsForm ( )
protected

Init settings form.

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

107 {
108 global $ilCtrl;
109
110 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
111 $form = new ilPropertyFormGUI();
112 $form->setFormAction($ilCtrl->getFormAction($this));
113 $form->setTitle($GLOBALS['lng']->txt('settings'));
114
115 if ($this->rbacsystem->checkAccess('write', $_GET['ref_id'])) {
116 $form->addCommandButton('update', $GLOBALS['lng']->txt('save'));
117 $form->addCommandButton('settings', $GLOBALS['lng']->txt('cancel'));
118 }
119
120 // activation
121 $active = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_active'), 'active');
122 $active->setInfo($GLOBALS['lng']->txt('fm_settings_active_info'));
123 $active->setValue(1);
124 $active->setChecked(ilFMSettings::getInstance()->isEnabled());
125 $form->addItem($active);
126
127 // one frame
128 $local = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_local'), 'local');
129 $local->setInfo($GLOBALS['lng']->txt('fm_settings_local_info'));
130 $local->setValue(1);
131 $local->setChecked(ilFMSettings::getInstance()->IsLocalFSEnabled());
132 $form->addItem($local);
133
134 $fs = new ilNumberInputGUI($GLOBALS['lng']->txt('fm_settings_filesize'), 'filesize');
135 $fs->setSuffix('MiB');
136 $fs->setSize(3);
137 $fs->setMaxLength(3);
138 $fs->setMinValue(1);
139 $fs->setMaxValue(999);
140 $fs->setInfo($GLOBALS['lng']->txt('fm_settings_filesize_info'));
141 $fs->setValue(ilFMSettings::getInstance()->getMaxFileSize());
142 $form->addItem($fs);
143
144 return $form;
145 }
$_GET["client_id"]
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['loaded']
Global hash that tracks already loaded includes.
if(isset($_POST['submit'])) $form

References $_GET, $form, $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 76 of file class.ilFMSettingsGUI.php.

77 {
78 $form = $this->initSettingsForm();
79
80 $GLOBALS['tpl']->setContent($form->getHTML());
81 }
initSettingsForm()
Init settings form.

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

+ Here is the call graph for this function:

◆ update()

ilFMSettingsGUI::update ( )
protected

Update.

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

87 {
88 include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
89 $settings = ilFMSettings::getInstance();
90
91 $form = $this->initSettingsForm();
92 if ($form->checkInput()) {
93 $settings->enable($form->getInput('active'));
94 $settings->enableLocalFS($form->getInput('local'));
95 $settings->setMaxFileSize($form->getInput('filesize'));
96 $settings->update();
97
98 ilUtil::sendSuccess($GLOBALS['lng']->txt('settings_saved'), true);
99 $GLOBALS['ilCtrl']->redirect($this, 'settings');
100 }
101 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

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

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilFMSettingsGUI::$ctrl
private

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

◆ $dic

ilFMSettingsGUI::$dic
private

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

◆ $parent_obj

ilFMSettingsGUI::$parent_obj = null
private

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

Referenced by getParentObject().

◆ $rbacsystem

ilFMSettingsGUI::$rbacsystem
private

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


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