ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjNotificationAdminGUI Class Reference

@ilCtrl_IsCalledBy ilObjNotificationAdminGUI: ilAdministrationGUI @ilCtrl_Calls ilObjNotificationAdminGUI: ilPermissionGUI More...

+ Inheritance diagram for ilObjNotificationAdminGUI:
+ Collaboration diagram for ilObjNotificationAdminGUI:

Public Member Functions

 __construct ($a_data, int $a_id=0, bool $a_call_by_reference=true, bool $a_prepare_output=true)
 
 executeCommand ()
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 showSettings (?Form $form=null)
 
 saveSettings ()
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 getForm (?array $values=null)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

Container $dic
 
bool $has_push_config = false
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjNotificationAdminGUI::__construct (   $a_data,
int  $a_id = 0,
bool  $a_call_by_reference = true,
bool  $a_prepare_output = true 
)

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

35 {
36 global $DIC;
37 $this->dic = $DIC;
38 $this->type = 'nota';
39 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
40 $this->has_push_config = is_readable((new ilSetting('notifications'))->get('private_key_path', ''));
41 $this->lng->loadLanguageModule('notifications_adm');
42 }
ILIAS Setting Class.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilObjNotificationAdminGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

Definition at line 44 of file class.ilObjNotificationAdminGUI.php.

44 : void
45 {
46 if (!$this->rbac_system->checkAccess('visible,read', $this->object->getRefId())) {
47 $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
48 }
49
50 $this->prepareOutput();
51 $this->tabs_gui->activateTab('settings');
52
53 switch (strtolower($this->ctrl->getNextClass())) {
54 case strtolower(ilPermissionGUI::class):
55 $perm_gui = new ilPermissionGUI($this);
56 $this->ctrl->forwardCommand($perm_gui);
57 break;
58 default:
59 match ($this->ctrl->getCmd()) {
60 'saveSettings' => $this->saveSettings(),
61 // no break
62 default => $this->showSettings(),
63 };
64 }
65 }
error(string $a_errmsg)
prepareOutput(bool $show_sub_objects=true)

References ILIAS\Repository\ctrl(), error(), ILIAS\Repository\lng(), ilObjectGUI\prepareOutput(), saveSettings(), and showSettings().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjNotificationAdminGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

67 : void
68 {
69 if ($this->checkPermissionBool('visible,read')) {
70 $this->tabs_gui->addTab(
71 'settings',
72 $this->lng->txt('settings'),
73 $this->ctrl->getLinkTarget($this, 'editSettings')
74 );
75 }
76
77 if ($this->checkPermissionBool('edit_permission')) {
78 $this->tabs_gui->addTab(
79 'perm_settings',
80 $this->lng->txt('perm_settings'),
81 $this->ctrl->getLinkTargetByClass([$this::class, ilPermissionGUI::class], 'perm')
82 );
83 }
84 }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ilObjectGUI\checkPermissionBool(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getForm()

ilObjNotificationAdminGUI::getForm ( ?array  $values = null)
protected
Parameters
array<string,mixed>|null$values
Exceptions
ilCtrlException

Definition at line 150 of file class.ilObjNotificationAdminGUI.php.

150 : Form
151 {
152 $enable_osd = $this->dic->ui()->factory()->input()->field()->optionalGroup(
153 [
154 'osd_interval' => $this->dic->ui()->factory()->input()->field()->numeric(
155 $this->lng->txt('osd_interval'),
156 $this->lng->txt('osd_interval_desc')
157 )
158 ->withRequired(true)
159 ->withValue(60000)
160 ->withAdditionalTransformation($this->dic->refinery()->custom()->constraint(
161 static function ($value) {
162 return $value >= 3000;
163 },
164 $this->lng->txt('osd_error_refresh_interval_too_small')
165 )),
166 'osd_play_sound' => $this->dic->ui()->factory()->input()->field()->checkbox(
167 $this->lng->txt('osd_play_sound'),
168 $this->lng->txt('osd_play_sound_desc')
169 )
170 ],
171 $this->lng->txt('enable_osd')
172 )->withByline($this->lng->txt('enable_osd_desc'));
173
174 $enable_push = $this->dic->ui()->factory()->input()->field()->checkbox(
175 $this->lng->txt('enable_push'),
176 $this->lng->txt('enable_push_desc'),
177 );
178
179 if (!$this->has_push_config) {
180 $enable_push = $enable_push->withDisabled(true);
181 }
182
183 if ($values !== null) {
184 $enable_osd = $enable_osd->withValue($values['enable_osd'] ?? null);
185 $enable_push = $enable_push->withValue($values['enable_push'] ?? null);
186 }
187
188 return $this->dic->ui()->factory()->input()->container()->form()->standard(
189 $this->ctrl->getFormAction($this, 'saveSettings'),
190 [
191 'osd' => $this->dic->ui()->factory()->input()->field()->section(
192 ['enable_osd' => $enable_osd,],
193 $this->lng->txt('osd_settings')
194 ),
195 'push' => $this->dic->ui()->factory()->input()->field()->section(
196 ['enable_push' => $enable_push],
197 $this->lng->txt('push_settings')
198 )
199 ]
200 );
201 }
This describes commonalities between all forms.
Definition: Form.php:33

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by saveSettings(), and showSettings().

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

◆ saveSettings()

ilObjNotificationAdminGUI::saveSettings ( )
Exceptions
ilCtrlException

Definition at line 114 of file class.ilObjNotificationAdminGUI.php.

114 : void
115 {
116 if (!$this->checkPermissionBool('write')) {
117 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
118 }
119
120 $settings = new ilSetting('notifications');
121
122 $form = $this->getForm()->withRequest($this->dic->http()->request());
123 $data = $form->getData();
124 if (isset($data['osd']) && is_array($data['osd'])) {
125 if (!isset($data['osd']['enable_osd'])) {
126 global $DIC;
127 $DIC->notifications()->system()->clear('osd');
128 $settings->set('enable_osd', '0');
129 $settings->delete('osd_interval');
130 $settings->delete('osd_play_sound');
131 } else {
132 $settings->set('enable_osd', '1');
133 $settings->set('osd_interval', ((string) $data['osd']['enable_osd']['osd_interval']));
134 $settings->set('osd_play_sound', ($data['osd']['enable_osd']['osd_play_sound']) ? '1' : '0');
135 }
136 }
137
138 $push = false;
139 if ($this->has_push_config) {
140 $push = $data['push']['enable_push'] ?? false;
141 }
142 $settings->set('enable_push', $push ? '1' : '0');
143 $this->showSettings($form);
144 }
ilSetting $settings
delete(string $a_keyword)
set(string $a_key, string $a_val)

References ilObjectGUI\$data, $DIC, ilObjectGUI\$settings, ilObjectGUI\checkPermissionBool(), ilSetting\delete(), error(), getForm(), ILIAS\Repository\lng(), ilSetting\set(), and showSettings().

Referenced by executeCommand().

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

◆ showSettings()

ilObjNotificationAdminGUI::showSettings ( ?Form  $form = null)
Exceptions
ilCtrlException

Definition at line 89 of file class.ilObjNotificationAdminGUI.php.

89 : void
90 {
91 if ($form === null) {
92 $settings = new ilSetting('notifications');
93 $values = [];
94 if ($settings->get('enable_osd') === '0' || $settings->get('enable_osd') === null) {
95 $values['enable_osd'] = null;
96 } else {
97 $values['enable_osd'] = [
98 'osd_interval' => (int) $settings->get('osd_interval'),
99 'osd_play_sound' => (bool) $settings->get('osd_play_sound'),
100 ];
101 }
102 if ($this->has_push_config) {
103 $values['enable_push'] = $settings->get('enable_push') === '1';
104 }
105 $form = $this->getForm($values);
106 }
107
108 $this->tpl->setContent($this->dic->ui()->renderer()->render($form));
109 }
get(string $a_keyword, ?string $a_default_value=null)
get setting

References ilObjectGUI\$settings, ilSetting\get(), getForm(), and ILIAS\Repository\int().

Referenced by executeCommand(), and saveSettings().

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

Field Documentation

◆ $dic

Container ilObjNotificationAdminGUI::$dic
protected

Definition at line 31 of file class.ilObjNotificationAdminGUI.php.

◆ $has_push_config

bool ilObjNotificationAdminGUI::$has_push_config = false
protected

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


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