ILIAS  release_8 Revision v8.24
ilMemberExportSettingsGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilMemberExportSettingsGUI:

Public Member Functions

 __construct (string $a_parent_type, int $a_parent_obj_id=0)
 Constructor. More...
 
 executeCommand ()
 

Protected Member Functions

 printViewSettings (?ilPropertyFormGUI $form=null)
 
 initForm (string $a_type)
 
 savePrintViewSettings ()
 Save print view settings. More...
 

Protected Attributes

const TYPE_PRINT_VIEW_SETTINGS = 'print_view'
 
const TYPE_EXPORT_SETTINGS = 'member_export'
 
const TYPE_PRINT_VIEW_MEMBERS = 'prv_members'
 
ilGlobalTemplateInterface $tpl
 
ilCtrlInterface $ctrl
 
ilLanguage $lng
 
ilRbacSystem $rbacsystem
 

Private Member Functions

 getLang ()
 

Private Attributes

string $parent_type = ''
 
int $parent_obj_id = 0
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Export settings gui

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 26 of file class.ilMemberExportSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMemberExportSettingsGUI::__construct ( string  $a_parent_type,
int  $a_parent_obj_id = 0 
)

Constructor.

Definition at line 45 of file class.ilMemberExportSettingsGUI.php.

46 {
47 global $DIC;
48
49 $this->parent_type = $a_parent_type;
50 $this->parent_obj_id = $a_parent_obj_id;
51
52 $this->tpl = $DIC->ui()->mainTemplate();
53 $this->ctrl = $DIC->ctrl();
54 $this->lng = $DIC->language();
55 $this->lng->loadLanguageModule('crs');
56 $this->lng->loadLanguageModule('mem');
57 $this->rbacsystem = $DIC->rbac()->system();
58 $this->http = $DIC->http();
59 $this->refinery = $DIC->refinery();
60 }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.

References $DIC, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilMemberExportSettingsGUI::executeCommand ( )

Definition at line 67 of file class.ilMemberExportSettingsGUI.php.

67 : void
68 {
69 $next_class = $this->ctrl->getNextClass($this);
70 $cmd = $this->ctrl->getCmd('printViewSettings');
71
72 switch ($next_class) {
73 default:
74 $this->$cmd();
75 break;
76 }
77 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getLang()

ilMemberExportSettingsGUI::getLang ( )
private

Definition at line 62 of file class.ilMemberExportSettingsGUI.php.

63 {
64 return $this->lng;
65 }
language handling

References $lng.

Referenced by initForm().

+ Here is the caller graph for this function:

◆ initForm()

ilMemberExportSettingsGUI::initForm ( string  $a_type)
protected

Definition at line 87 of file class.ilMemberExportSettingsGUI.php.

88 {
89 $form = new ilPropertyFormGUI();
90 $form->setFormAction($this->ctrl->getFormAction($this));
91 $form->setTitle($this->getLang()->txt('mem_' . $a_type . '_form'));
92
93 // profile fields
94 $fields['name'] = $this->lng->txt('name');
95 $fields['login'] = $this->lng->txt('login');
96 $fields['email'] = $this->lng->txt('email');
97
98 $field_info = ilExportFieldsInfo::_getInstanceByType($this->parent_type);
99 $field_info->sortExportFields();
100
101 foreach ($field_info->getExportableFields() as $field) {
102 switch ($field) {
103 case 'username':
104 case 'firstname':
105 case 'lastname':
106 case 'email':
107 continue 2;
108 }
109
110 // Check if default enabled
111 $fields[$field] = $this->lng->txt($field);
112 }
113
114 // udf
116 $exportable = array();
117 if ($this->parent_type === 'crs') {
118 $exportable = $udf->getCourseExportableFields();
119 } elseif ($this->parent_type === 'grp') {
120 $exportable = $udf->getGroupExportableFields();
121 }
122 foreach ($exportable as $field_id => $udf_data) {
123 $fields['udf_' . $field_id] = $udf_data['field_name'];
124 }
125
126 $ufields = new ilCheckboxGroupInputGUI($this->lng->txt('user_detail'), 'preset');
127 foreach ($fields as $id => $name) {
128 $ufields->addOption(new ilCheckboxOption($name, $id));
129 }
130 $form->addItem($ufields);
131
133 if ($this->parent_type === 'crs') {
134 if ($privacy->enabledCourseAccessTimes()) {
135 $ufields->addOption(new ilCheckboxOption($this->lng->txt('last_access'), 'access'));
136 }
137 }
138 if ($this->parent_type === 'grp') {
139 if ($privacy->enabledGroupAccessTimes()) {
140 $ufields->addOption(new ilCheckboxOption($this->lng->txt('last_access'), 'access'));
141 }
142 }
143 $ufields->addOption(new ilCheckboxOption($this->lng->txt('crs_status'), 'status'));
144 $ufields->addOption(new ilCheckboxOption($this->lng->txt('crs_passed'), 'passed'));
145
146 $blank = new ilTextInputGUI($this->lng->txt('event_blank_columns'), 'blank');
147 $blank->setMulti(true);
148 $form->addItem($blank);
149
150 $roles = new ilCheckboxGroupInputGUI($this->lng->txt('event_user_selection'), 'selection_of_users');
151
152 $roles->addOption(new ilCheckboxOption($this->lng->txt('event_tbl_admin'), 'role_adm'));
153 if ($this->parent_type === 'crs') {
154 $roles->addOption(new ilCheckboxOption($this->lng->txt('event_tbl_tutor'), 'role_tut'));
155 }
156 $roles->addOption(new ilCheckboxOption($this->lng->txt('event_tbl_member'), 'role_mem'));
157
158 if (!$this->parent_obj_id) {
159 $subscriber = new ilCheckboxOption($this->lng->txt('event_user_selection_include_requests'), 'subscr');
160 $roles->addOption($subscriber);
161
162 $waiting_list = new ilCheckboxOption($this->lng->txt('event_user_selection_include_waiting_list'), 'wlist');
163 $roles->addOption($waiting_list);
164 }
165 $form->addItem($roles);
166
167 switch ($a_type) {
169
170 $ref_id = 0;
171 if ($this->http->wrapper()->query()->has('ref_id')) {
172 $ref_id = $this->http->wrapper()->query()->retrieve(
173 'ref_id',
174 $this->refinery->kindlyTo()->int()
175 );
176 }
177
178 if ($this->rbacsystem->checkAccess('write', $ref_id)) {
179 $form->addCommandButton('savePrintViewSettings', $this->getLang()->txt('save'));
180 }
181 break;
182 }
183
184 $identifier = $this->parent_type . 's_pview';
185 if ($this->parent_obj_id) {
186 $identifier_for_object = $identifier . '_' . $this->parent_obj_id;
187 } else {
188 $identifier_for_object = $identifier . '_0';
189 }
190
191 $settings = new ilUserFormSettings($identifier_for_object, -1);
192 if (!$settings->hasStoredEntry()) {
193 // use default settings
194 $settings = new ilUserFormSettings($identifier, -1);
195 }
196 $settings->exportToForm($form);
197
198 return $form;
199 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstanceByType(string $a_type)
Get Singleton Instance.
This class represents a property form user interface.
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:67
if($format !==null) $name
Definition: metadata.php:247
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200

References $id, $name, $parent_obj_id, $ref_id, ILIAS\LTI\ToolProvider\$settings, ilUserDefinedFields\_getInstance(), ilExportFieldsInfo\_getInstanceByType(), ILIAS\Repository\ctrl(), ilPrivacySettings\getInstance(), getLang(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and TYPE_PRINT_VIEW_SETTINGS.

Referenced by printViewSettings(), and savePrintViewSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printViewSettings()

ilMemberExportSettingsGUI::printViewSettings ( ?ilPropertyFormGUI  $form = null)
protected

Definition at line 79 of file class.ilMemberExportSettingsGUI.php.

79 : void
80 {
81 if (!$form instanceof ilPropertyFormGUI) {
82 $form = $this->initForm(self::TYPE_PRINT_VIEW_SETTINGS);
83 }
84 $this->tpl->setContent($form->getHTML());
85 }

References initForm().

+ Here is the call graph for this function:

◆ savePrintViewSettings()

ilMemberExportSettingsGUI::savePrintViewSettings ( )
protected

Save print view settings.

Definition at line 204 of file class.ilMemberExportSettingsGUI.php.

204 : void
205 {
206 $form = $this->initForm(self::TYPE_PRINT_VIEW_SETTINGS);
207 if ($form->checkInput()) {
208 $form->setValuesByPost();
209
212
213 $identifier = $this->parent_type . 's_pview';
214 if ($this->parent_obj_id) {
215 $identifier .= '_' . $this->parent_obj_id;
216 }
217
218 $settings = new ilUserFormSettings($identifier, -1);
219 $settings->importFromForm($form);
220 $settings->store();
221
222 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
223 $this->ctrl->redirect($this, 'printViewSettings');
224 }
225 }
static deleteAllForPrefix(string $a_prefix)
Delete all entries for prefix.

References $parent_obj_id, ILIAS\LTI\ToolProvider\$settings, ILIAS\Repository\ctrl(), ilUserFormSettings\deleteAllForPrefix(), initForm(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrlInterface ilMemberExportSettingsGUI::$ctrl
protected

Definition at line 38 of file class.ilMemberExportSettingsGUI.php.

◆ $http

ILIAS HTTP Services ilMemberExportSettingsGUI::$http
private

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

◆ $lng

ilLanguage ilMemberExportSettingsGUI::$lng
protected

Definition at line 39 of file class.ilMemberExportSettingsGUI.php.

Referenced by getLang().

◆ $parent_obj_id

int ilMemberExportSettingsGUI::$parent_obj_id = 0
private

Definition at line 33 of file class.ilMemberExportSettingsGUI.php.

Referenced by initForm(), and savePrintViewSettings().

◆ $parent_type

string ilMemberExportSettingsGUI::$parent_type = ''
private

Definition at line 32 of file class.ilMemberExportSettingsGUI.php.

◆ $rbacsystem

ilRbacSystem ilMemberExportSettingsGUI::$rbacsystem
protected

Definition at line 40 of file class.ilMemberExportSettingsGUI.php.

◆ $refinery

ILIAS Refinery Factory ilMemberExportSettingsGUI::$refinery
private

Definition at line 35 of file class.ilMemberExportSettingsGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilMemberExportSettingsGUI::$tpl
protected

Definition at line 37 of file class.ilMemberExportSettingsGUI.php.

◆ TYPE_EXPORT_SETTINGS

const ilMemberExportSettingsGUI::TYPE_EXPORT_SETTINGS = 'member_export'
protected

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

◆ TYPE_PRINT_VIEW_MEMBERS

const ilMemberExportSettingsGUI::TYPE_PRINT_VIEW_MEMBERS = 'prv_members'
protected

Definition at line 30 of file class.ilMemberExportSettingsGUI.php.

◆ TYPE_PRINT_VIEW_SETTINGS

const ilMemberExportSettingsGUI::TYPE_PRINT_VIEW_SETTINGS = 'print_view'
protected

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

Referenced by initForm().


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