ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilOrgUnitGlobalSettingsGUI Class Reference

Global orgunit settings GUI. More...

+ Collaboration diagram for ilOrgUnitGlobalSettingsGUI:

Public Member Functions

 __construct ()
 Default constructor. 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 35 of file class.ilOrgUnitGlobalSettingsGUI.php.

References $_GET, $DIC, ilObjOrgUnitAccess\_checkAccessSettings(), and ilUtil\sendFailure().

36  {
37  global $DIC;
38 
39  $this->ctrl = $DIC->ctrl();
40  $this->lng = $DIC->language();
41  $this->lng->loadLanguageModule('orgu');
42  $this->tpl = $DIC->ui()->mainTemplate();
43 
44  if (!ilObjOrgUnitAccess::_checkAccessSettings((int) $_GET['ref_id'])) {
45  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
46  $this->ctrl->redirectByClass(ilObjOrgUnitGUI::class);
47  }
48  }
$_GET["client_id"]
static _checkAccessSettings(int $ref_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilOrgUnitGlobalSettingsGUI::executeCommand ( )

Ctrl execute command.

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

55  {
56  $cmd = $this->ctrl->getCmd('settings');
57  $next_class = $this->ctrl->getNextClass($this);
58 
59  switch ($next_class) {
60  default:
61  $this->$cmd();
62  break;
63  }
64  }

◆ initSettingsForm()

ilOrgUnitGlobalSettingsGUI::initSettingsForm ( )
protected

Init settings form.

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

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

Referenced by settings().

85  {
86  global $DIC;
87 
88  $form = new ilPropertyFormGUI();
89  $form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
90 
91  // My Staff
93  $section->setTitle($this->lng->txt('orgu_enable_my_staff'));
94  $form->addItem($section);
95 
96  $item = new ilCheckboxInputGUI($this->lng->txt("orgu_enable_my_staff"), "enable_my_staff");
97  $item->setInfo($this->lng->txt("orgu_enable_my_staff_info"));
98  $item->setValue("1");
99  $item->setChecked(($DIC->settings()->get("enable_my_staff") ? true : false));
100  $form->addItem($item);
101 
102  // Positions in Modules
104  $section->setTitle($this->lng->txt('orgu_global_set_positions'));
105  $form->addItem($section);
106 
107  $objDefinition = $DIC['objDefinition'];
108  $available_types = $objDefinition->getOrgUnitPermissionTypes();
109  foreach ($available_types as $object_type) {
110  $setting = new ilOrgUnitObjectTypePositionSetting($object_type);
111  $is_multi = false;
112 
113  if ($objDefinition->isPlugin($object_type)) {
114  $label = ilObjectPlugin::lookupTxtById($object_type, 'objs_' . $object_type);
115  } else {
116  $is_multi = !$objDefinition->isSystemObject($object_type);
117  $lang_prefix = $is_multi ? 'objs_' : 'obj_';
118  $label = $this->lng->txt($lang_prefix . $object_type);
119  }
120 
122  $this->lng->txt('orgu_global_set_positions_type_active') . ' ' . $label,
123  $object_type . '_active'
124  );
125  $type->setValue(1);
126  $type->setChecked($setting->isActive());
127  if ($is_multi) {
128  $scope = new ilRadioGroupInputGUI($this->lng->txt('orgu_global_set_type_changeable'), $object_type . '_changeable');
129  $scope->setValue((int) $setting->isChangeableForObject());
130 
131  $scope_object = new ilRadioOption(
132  $this->lng->txt('orgu_global_set_type_changeable_object'),
133  1
134  );
135  $default = new ilCheckboxInputGUI($this->lng->txt('orgu_global_set_type_default'), $object_type . '_default');
136  $default->setInfo($this->lng->txt('orgu_global_set_type_default_info'));
138  $default->setChecked($setting->getActivationDefault());
139 
140  $scope_object->addSubItem($default);
141  $scope->addOption($scope_object);
142 
143  $scope_global = new ilRadioOption(
144  $this->lng->txt('orgu_global_set_type_changeable_no'),
145  0
146  );
147  $scope->addOption($scope_global);
148 
149  $type->addSubItem($scope);
150  }
151  $form->addItem($type);
152  }
153  $form->addCommandButton('saveSettings', $this->lng->txt('save'));
154 
155  return $form;
156  }
This class represents an option in a radio group.
static lookupTxtById($plugin_id, $lang_var)
This class represents a property form user interface.
$type
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.
addSubItem($a_item)
Add Subitem.
$DIC
Definition: xapitoken.php:46
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 72 of file class.ilOrgUnitGlobalSettingsGUI.php.

References initSettingsForm().

Referenced by initSettingsForm().

73  {
74  if (!$form instanceof ilPropertyFormGUI) {
75  $form = $this->initSettingsForm();
76  }
77  $this->tpl->setContent($form->getHTML());
78  }
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 19 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 27 of file class.ilOrgUnitGlobalSettingsGUI.php.


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