19declare(strict_types=1);
36 private \ILIAS\HTTP\Services
$http;
48 public function __construct(
string $a_parent_type,
int $a_parent_obj_id = 0)
52 $this->parent_type = $a_parent_type;
53 $this->parent_obj_id = $a_parent_obj_id;
55 $this->tpl =
$DIC->ui()->mainTemplate();
56 $this->
ctrl = $DIC->ctrl();
57 $this->
lng = $DIC->language();
58 $this->
lng->loadLanguageModule(
'crs');
59 $this->
lng->loadLanguageModule(
'mem');
60 $this->rbacsystem =
$DIC->rbac()->system();
61 $this->
http = $DIC->http();
63 $this->
profile = $DIC[
'user']->getProfile();
73 $next_class = $this->
ctrl->getNextClass($this);
74 $cmd = $this->
ctrl->getCmd(
'printViewSettings');
76 switch ($next_class) {
86 $form = $this->
initForm(self::TYPE_PRINT_VIEW_SETTINGS);
88 $this->tpl->setContent($form->getHTML());
94 $form->setFormAction($this->
ctrl->getFormAction($this));
95 $form->setTitle($this->
getLang()->txt(
'mem_' . $a_type .
'_form'));
98 $fields[
'name'] = $this->
lng->txt(
'name');
99 $fields[
'login'] = $this->
lng->txt(
'login');
100 $fields[
'email'] = $this->
lng->txt(
'email');
103 $field_info->sortExportFields();
105 foreach ($field_info->getExportableFields() as $field) {
115 $fields[$field] = $this->
lng->txt($field);
119 $exportable = $this->
profile->getVisibleUserDefinedFields(Context::buildFromObjectType($this->type));
120 foreach ($exportable as $field) {
121 $fields[
'udf_' . $field->getIdentifier()] = $field->getLabel($this->
lng);
125 foreach ($fields as
$id => $name) {
128 $form->addItem($ufields);
131 if ($this->parent_type ===
'crs') {
132 if ($privacy->enabledCourseAccessTimes()) {
136 if ($this->parent_type ===
'grp') {
137 if ($privacy->enabledGroupAccessTimes()) {
145 $blank->setMulti(
true);
146 $form->addItem($blank);
151 if ($this->parent_type ===
'crs') {
156 if (!$this->parent_obj_id) {
157 $subscriber =
new ilCheckboxOption($this->
lng->txt(
'event_user_selection_include_requests'),
'subscr');
158 $roles->addOption($subscriber);
160 $waiting_list =
new ilCheckboxOption($this->
lng->txt(
'event_user_selection_include_waiting_list'),
'wlist');
161 $roles->addOption($waiting_list);
163 $form->addItem($roles);
169 if ($this->
http->wrapper()->query()->has(
'ref_id')) {
170 $ref_id = $this->
http->wrapper()->query()->retrieve(
176 if ($this->rbacsystem->checkAccess(
'write',
$ref_id)) {
177 $form->addCommandButton(
'savePrintViewSettings', $this->
getLang()->txt(
'save'));
182 $identifier = $this->parent_type .
's_pview';
183 if ($this->parent_obj_id) {
186 $identifier_for_object = $identifier .
'_0';
190 if (!$settings->hasStoredEntry()) {
194 $settings->exportToForm($form);
204 $form = $this->
initForm(self::TYPE_PRINT_VIEW_SETTINGS);
205 if ($form->checkInput()) {
206 $form->setValuesByPost();
211 $identifier = $this->parent_type .
's_pview';
212 if ($this->parent_obj_id) {
217 $settings->importFromForm($form);
220 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
221 $this->
ctrl->redirect($this,
'printViewSettings');
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This class represents an option in a checkbox group.
static _getInstanceByType(string $a_type)
Get Singleton Instance.
ILIAS HTTP Services $http
savePrintViewSettings()
Save print view settings.
__construct(string $a_parent_type, int $a_parent_obj_id=0)
Constructor.
ilGlobalTemplateInterface $tpl
printViewSettings(?ilPropertyFormGUI $form=null)
const TYPE_PRINT_VIEW_SETTINGS
ILIAS Refinery Factory $refinery
const TYPE_EXPORT_SETTINGS
const TYPE_PRINT_VIEW_MEMBERS
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
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...
static http()
Fetches the global http state from ILIAS.