38 $this->ctrl = $DIC->ctrl();
39 $this->lng = $DIC->language();
40 $this->lng->loadLanguageModule(
'orgu');
41 $this->tpl = $DIC->ui()->mainTemplate();
49 $cmd = $this->ctrl->getCmd(
'settings');
50 $next_class = $this->ctrl->getNextClass($this);
52 switch ($next_class) {
68 $this->tpl->setContent(
$form->getHTML());
79 $form->setFormAction($this->ctrl->getFormAction($this,
'saveSettings'));
83 $section->setTitle($this->lng->txt(
'orgu_enable_my_staff'));
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"));
89 $item->setChecked(($DIC->settings()->get(
"enable_my_staff") ? true :
false));
90 $form->addItem($item);
94 $section->setTitle($this->lng->txt(
'orgu_global_set_positions'));
97 $available_types =
$GLOBALS[
'DIC'][
'objDefinition']->getOrgUnitPermissionTypes();
98 foreach ($available_types as $object_type) {
102 $this->lng->txt(
'orgu_global_set_positions_type_active') .
' ' . $this->lng->txt(
'objs_' . $object_type),
103 $object_type .
'_active' 106 $type->setChecked($setting->isActive());
108 $scope =
new ilRadioGroupInputGUI($this->lng->txt(
'orgu_global_set_type_changeable'), $object_type .
'_changeable');
109 $scope->
setValue((
int) $setting->isChangeableForObject());
112 $this->lng->txt(
'orgu_global_set_type_changeable_object'),
116 $default->
setInfo($this->lng->txt(
'orgu_global_set_type_default_info'));
118 $default->setChecked($setting->getActivationDefault());
121 $scope->addOption($scope_object);
124 $this->lng->txt(
'orgu_global_set_type_changeable_no'),
127 $scope->addOption($scope_global);
129 $type->addSubItem($scope);
132 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
138 protected function saveSettings()
144 $objDefinition = $DIC[
'objDefinition'];
146 if (
$form->checkInput()) {
148 $available_types = $objDefinition->getOrgUnitPermissionTypes();
149 foreach ($available_types as $object_type) {
151 $obj_setting->setActive((
bool)
$form->getInput($object_type .
'_active'));
152 $obj_setting->setActivationDefault((
int)
$form->getInput($object_type .
'_default'));
153 $obj_setting->setChangeableForObject((
bool)
$form->getInput($object_type
155 $obj_setting->update();
160 $DIC->settings()->set(
"enable_my_staff", (
int) (
$_POST[
"enable_my_staff"] ? 1 : 0));
162 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
163 $this->ctrl->redirect($this,
'settings');
165 $form->setValuesByPost();
This class represents an option in a radio group.
__construct()
Default constructor type $DIC.
setInfo($a_info)
Set Info.
Global orgunit settings GUI.
executeCommand()
Ctrl execute command.
setValue($a_value)
Set Value.
if(isset($_POST['submit'])) $form
initSettingsForm()
Init settings form.
addSubItem($a_item)
Add Subitem.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
settings(ilPropertyFormGUI $form=null)
Show settings.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Object settings regarding position permissions.