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

Global orgunit settings GUI. More...

+ Collaboration diagram for ilOrgUnitGlobalSettingsGUI:

Public Member Functions

 __construct ()
 Default constructor type $DIC. More...
 
 executeCommand ()
 Ctrl execute command. More...
 

Protected Member Functions

 settings (ilPropertyFormGUI $form=null)
 Show settings. More...
 
 initSettingsForm ()
 Init settings form. More...
 

Protected Attributes

 $ctrl
 
 $lng
 
 $tpl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitGlobalSettingsGUI::__construct ( )

Default constructor type $DIC.

Definition at line 34 of file class.ilOrgUnitGlobalSettingsGUI.php.

References $DIC.

35  {
36  global $DIC;
37 
38  $this->ctrl = $DIC->ctrl();
39  $this->lng = $DIC->language();
40  $this->lng->loadLanguageModule('orgu');
41  $this->tpl = $DIC->ui()->mainTemplate();
42  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ executeCommand()

ilOrgUnitGlobalSettingsGUI::executeCommand ( )

Ctrl execute command.

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

48  {
49  $cmd = $this->ctrl->getCmd('settings');
50  $next_class = $this->ctrl->getNextClass($this);
51 
52  switch ($next_class) {
53  default:
54  $this->$cmd();
55  break;
56  }
57  }

◆ initSettingsForm()

ilOrgUnitGlobalSettingsGUI::initSettingsForm ( )
protected

Init settings form.

Definition at line 74 of file class.ilOrgUnitGlobalSettingsGUI.php.

References $_POST, $default, $DIC, $form, $GLOBALS, $section, $type, ilRadioOption\addSubItem(), ilOrgUnitObjectTypePositionSetting\DEFAULT_ON, ilUtil\sendFailure(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), settings(), ilRadioGroupInputGUI\setValue(), and ilRadioOption\setValue().

Referenced by settings().

75  {
76  global $DIC;
77 
78  $form = new ilPropertyFormGUI();
79  $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
80 
81  // My Staff
83  $section->setTitle($this->lng->txt('orgu_enable_my_staff'));
84  $form->addItem($section);
85 
86  $item = new ilCheckboxInputGUI($this->lng->txt("orgu_enable_my_staff"), "enable_my_staff");
87  $item->setInfo($this->lng->txt("orgu_enable_my_staff_info"));
88  $item->setValue("1");
89  $item->setChecked(($DIC->settings()->get("enable_my_staff") ? true : false));
90  $form->addItem($item);
91 
92  // Positions in Modules
94  $section->setTitle($this->lng->txt('orgu_global_set_positions'));
95  $form->addItem($section);
96 
97  $available_types = $GLOBALS['DIC']['objDefinition']->getOrgUnitPermissionTypes();
98  foreach ($available_types as $object_type) {
99  $setting = new ilOrgUnitObjectTypePositionSetting($object_type);
100 
102  $this->lng->txt('orgu_global_set_positions_type_active') . ' ' . $this->lng->txt('objs_' . $object_type),
103  $object_type . '_active'
104  );
105  $type->setValue(1);
106  $type->setChecked($setting->isActive());
107 
108  $scope = new ilRadioGroupInputGUI($this->lng->txt('orgu_global_set_type_changeable'), $object_type . '_changeable');
109  $scope->setValue((int) $setting->isChangeableForObject());
110 
111  $scope_object = new ilRadioOption(
112  $this->lng->txt('orgu_global_set_type_changeable_object'),
113  1
114  );
115  $default = new ilCheckboxInputGUI($this->lng->txt('orgu_global_set_type_default'), $object_type . '_default');
116  $default->setInfo($this->lng->txt('orgu_global_set_type_default_info'));
118  $default->setChecked($setting->getActivationDefault());
119 
120  $scope_object->addSubItem($default);
121  $scope->addOption($scope_object);
122 
123  $scope_global = new ilRadioOption(
124  $this->lng->txt('orgu_global_set_type_changeable_no'),
125  0
126  );
127  $scope->addOption($scope_global);
128 
129  $type->addSubItem($scope);
130  $form->addItem($type);
131  }
132  $form->addCommandButton('saveSettings', $this->lng->txt('save'));
133 
134  return $form;
135  }
This class represents an option in a radio group.
This class represents a property form user interface.
$type
global $DIC
Definition: saml.php:7
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Info.
setInfo($a_info)
Set Information Text.
$section
Definition: Utf8Test.php:83
This class represents a property in a property form.
setValue($a_value)
Set Value.
if(isset($_POST['submit'])) $form
addSubItem($a_item)
Add Subitem.
$default
Definition: build.php:20
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Object settings regarding position permissions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settings()

ilOrgUnitGlobalSettingsGUI::settings ( ilPropertyFormGUI  $form = null)
protected

Show settings.

Parameters
ilPropertyFormGUI$form

Definition at line 63 of file class.ilOrgUnitGlobalSettingsGUI.php.

References $form, and initSettingsForm().

Referenced by initSettingsForm().

64  {
65  if (!$form instanceof ilPropertyFormGUI) {
66  $form = $this->initSettingsForm();
67  }
68  $this->tpl->setContent($form->getHTML());
69  }
This class represents a property form user interface.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilOrgUnitGlobalSettingsGUI::$ctrl
protected

Definition at line 18 of file class.ilOrgUnitGlobalSettingsGUI.php.

◆ $lng

ilOrgUnitGlobalSettingsGUI::$lng
protected

Definition at line 23 of file class.ilOrgUnitGlobalSettingsGUI.php.

◆ $tpl

ilOrgUnitGlobalSettingsGUI::$tpl
protected

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


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