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

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

+ Inheritance diagram for ilObjAwarenessAdministrationGUI:
+ Collaboration diagram for ilObjAwarenessAdministrationGUI:

Public Member Functions

 __construct ( $a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
 
 executeCommand ()
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 setSubTabs (string $a_id)
 
 editSettings (?ilPropertyFormGUI $a_form=null)
 Edit settings. More...
 
 saveSettings ()
 Save settings. More...
 
 cancel ()
 Save settings. More...
 
- 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

 initFormSettings ()
 
- 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

ilRbacSystem $rbacsystem
 
ILIAS Awareness AdminManager $admin_manager
 
- 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

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 Awareness tool administration

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_Calls ilObjAwarenessAdministrationGUI: ilPermissionGUI, ilUserActionAdminGUI @ilCtrl_IsCalledBy ilObjAwarenessAdministrationGUI: ilAdministrationGUI

Definition at line 25 of file class.ilObjAwarenessAdministrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjAwarenessAdministrationGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference = true,
bool  $a_prepare_output = true 
)
Parameters
mixed$a_data

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

38 {
39 global $DIC;
40
41 $this->rbacsystem = $DIC->rbac()->system();
42 $this->ctrl = $DIC->ctrl();
43 $this->lng = $DIC->language();
44 $this->type = "awra";
45 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
46
47 $this->lng->loadLanguageModule("awrn");
48 $this->lng->loadLanguageModule("pd");
49 $this->lng->loadLanguageModule("usr");
50 $this->admin_manager = $DIC->awareness()
51 ->internal()
52 ->domain()
53 ->admin($this->requested_ref_id);
54 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ cancel()

ilObjAwarenessAdministrationGUI::cancel ( )

Save settings.

Definition at line 189 of file class.ilObjAwarenessAdministrationGUI.php.

189 : void
190 {
191 $ilCtrl = $this->ctrl;
192
193 $ilCtrl->redirect($this, "view");
194 }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc

References ilObjectGUI\$ctrl, and ilCtrl\redirect().

+ Here is the call graph for this function:

◆ editSettings()

ilObjAwarenessAdministrationGUI::editSettings ( ?ilPropertyFormGUI  $a_form = null)

Edit settings.

Definition at line 130 of file class.ilObjAwarenessAdministrationGUI.php.

130 : bool
131 {
132 $this->tabs_gui->setTabActive('settings');
133 $this->setSubTabs("settings");
134
135 if (!$a_form) {
136 $a_form = $this->initFormSettings();
137 }
138 $this->tpl->setContent($a_form->getHTML());
139 return true;
140 }

References initFormSettings(), and setSubTabs().

Referenced by saveSettings().

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

◆ executeCommand()

ilObjAwarenessAdministrationGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

Definition at line 56 of file class.ilObjAwarenessAdministrationGUI.php.

56 : void
57 {
58 $next_class = $this->ctrl->getNextClass($this);
59 $cmd = $this->ctrl->getCmd();
60
61 $this->prepareOutput();
62
63 switch ($next_class) {
64 case 'iluseractionadmingui':
65 $gui = new ilUserActionAdminGUI($this->requested_ref_id);
66 $gui->setActionContext(new ilAwarenessUserActionContext());
67 $this->tabs_gui->setTabActive('settings');
68 $this->setSubTabs("actions");
69 $this->ctrl->forwardCommand($gui);
70 break;
71
72 case 'ilpermissiongui':
73 $this->tabs_gui->setTabActive('perm_settings');
74 $perm_gui = new ilPermissionGUI($this);
75 $this->ctrl->forwardCommand($perm_gui);
76 break;
77
78 default:
79 if (!$cmd || $cmd == 'view') {
80 $cmd = "editSettings";
81 }
82
83 $this->$cmd();
84 break;
85 }
86 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
prepareOutput(bool $show_sub_objects=true)
User action administration GUI class.

References ILIAS\Repository\ctrl(), ilObjectGUI\prepareOutput(), and setSubTabs().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjAwarenessAdministrationGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 88 of file class.ilObjAwarenessAdministrationGUI.php.

88 : void
89 {
91
92 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
93 $this->tabs_gui->addTab(
94 "settings",
95 $this->lng->txt("settings"),
96 $this->ctrl->getLinkTarget($this, "editSettings")
97 );
98 }
99
100 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
101 $this->tabs_gui->addTab(
102 "perm_settings",
103 $this->lng->txt("perm_settings"),
104 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
105 );
106 }
107 }
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...

References $rbacsystem, ilRbacSystem\checkAccess(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initFormSettings()

ilObjAwarenessAdministrationGUI::initFormSettings ( )
protected

Definition at line 196 of file class.ilObjAwarenessAdministrationGUI.php.

197 {
199
200 $form = new ilPropertyFormGUI();
201 $form->setFormAction($this->ctrl->getFormAction($this));
202 $form->setTitle($this->lng->txt('awareness_settings'));
203
204 if ($this->checkPermissionBool("write")) {
205 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
206 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
207 }
208
209 $en = new ilCheckboxInputGUI($lng->txt("awrn_enable"), "enable_awareness");
210 $form->addItem($en);
211
212 $awrn_set = new ilSetting("awrn");
213 $en->setChecked($awrn_set->get("awrn_enabled", false));
214
215 // caching period
216 $ti = new ilNumberInputGUI($this->lng->txt("awrn_caching_period"), "caching_period");
217 $ti->setInfo($this->lng->txt("awrn_caching_period_info"));
218 $ti->setSuffix($this->lng->txt("awrn_seconds"));
219 $ti->setSize(6);
220 $ti->setMaxLength(6);
221 $ti->setValue($awrn_set->get("caching_period"));
222 $en->addSubItem($ti);
223
224 // limit number of entries
225 $ti = new ilNumberInputGUI($this->lng->txt("awrn_max_nr_entries"), "max_nr_entries");
226 $ti->setInfo($this->lng->txt("awrn_max_nr_entries_info"));
227 $ti->setSize(3);
228 $ti->setMaxLength(3);
229 $ti->setMinValue(5);
230 $ti->setMaxValue(200);
231 $ti->setValue($awrn_set->get("max_nr_entries"));
232 $en->addSubItem($ti);
233
234 // maximum inactivity time
235 $pd_set = new ilSetting("pd"); // under pd settings due to historical reasons
236 $ti_prop = new ilNumberInputGUI(
237 $lng->txt("awrn_max_inactivity"),
238 "time_removal"
239 );
240 $ti_prop->setSuffix($this->lng->txt("awrn_minutes"));
241 if ($pd_set->get("user_activity_time") > 0) {
242 $ti_prop->setValue($pd_set->get("user_activity_time"));
243 }
244 $ti_prop->setInfo($lng->txt("awrn_max_inactivity_info"));
245 $ti_prop->setMaxLength(3);
246 $ti_prop->setSize(3);
247 $en->addSubItem($ti_prop);
248
249 // activate osd
250 $osd = new ilCheckboxInputGUI($this->lng->txt("awrn_use_osd"), "use_osd");
251 $osd->setInfo($this->lng->txt("awrn_use_osd_info"));
252 $osd->setChecked($awrn_set->get("use_osd", true));
253 $en->addSubItem($osd);
254
255 $osd = new ilSelectInputGUI($this->lng->txt('awrn_user_show_default'), 'show_own_online_status');
256 $osd->setInfo($this->lng->txt('awrn_user_show_default_info'));
257 $osd->setOptions([
258 'n' => $this->lng->txt('user_awrn_show'),
259 'y' => $this->lng->txt('user_awrn_hide')
260 ]);
261 $osd->setValue($this->settings->get("hide_own_online_status", 'y'));
262 $en->addSubItem($osd);
263
264 $prov = $this->admin_manager->getAllUserProviders();
265 foreach ($prov as $p) {
266 // activation mode
267 $options = $this->admin_manager->getModeOptions();
268 $si = new ilSelectInputGUI($p->getTitle(), "up_act_mode_" . $p->getProviderId());
269 $si->setOptions($options);
270 $si->setInfo($p->getInfo());
271 $si->setValue($this->admin_manager->getActivationMode($p->getProviderId()));
272 $en->addSubItem($si);
273 }
274
275 return $form;
276 }
This class represents a checkbox property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This class represents a number property in a property form.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
ilLanguage $lng
This class represents a property form user interface.
This class represents a selection list property in a property form.
ILIAS Setting Class.

References ilObjectGUI\$lng, ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), and ilLanguage\txt().

Referenced by editSettings(), and saveSettings().

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

◆ saveSettings()

ilObjAwarenessAdministrationGUI::saveSettings ( )

Save settings.

Definition at line 145 of file class.ilObjAwarenessAdministrationGUI.php.

145 : void
146 {
147 $ilCtrl = $this->ctrl;
148
149 $this->checkPermission("write");
150
151 $form = $this->initFormSettings();
152 if ($form->checkInput()) {
153 $awrn_set = new ilSetting("awrn");
154 $awrn_set->set("awrn_enabled", (bool) $form->getInput("enable_awareness"));
155
156 $p = (int) $form->getInput("caching_period");
157 if ($p < 0) {
158 $p = 0;
159 }
160 $awrn_set->set("caching_period", $p);
161
162 $awrn_set->set("max_nr_entries", (int) $form->getInput("max_nr_entries"));
163 $awrn_set->set("use_osd", (int) $form->getInput("use_osd"));
164
165 $pd_set = new ilSetting("pd");
166 $pd_set->set("user_activity_time", (int) $form->getInput("time_removal"));
167
168 $this->settings->set('hide_own_online_status', $form->getInput('show_own_online_status'));
169
170 $prov = $this->admin_manager->getAllUserProviders();
171 foreach ($prov as $p) {
172 $this->admin_manager->setActivationMode(
173 $p->getProviderId(),
174 (int) $form->getInput("up_act_mode_" . $p->getProviderId())
175 );
176 }
177
178 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
179 $ilCtrl->redirect($this, "editSettings");
180 }
181
182 $form->setValuesByPost();
183 $this->editSettings($form);
184 }
editSettings(?ilPropertyFormGUI $a_form=null)
Edit settings.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ilObjectGUI\$ctrl, ilObjectGUI\checkPermission(), editSettings(), initFormSettings(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ setSubTabs()

ilObjAwarenessAdministrationGUI::setSubTabs ( string  $a_id)

Definition at line 109 of file class.ilObjAwarenessAdministrationGUI.php.

109 : void
110 {
111 $this->tabs_gui->addSubTab(
112 "settings",
113 $this->lng->txt("settings"),
114 $this->ctrl->getLinkTarget($this, "editSettings")
115 );
116
117 $this->tabs_gui->addSubTab(
118 "actions",
119 $this->lng->txt("user_actions"),
120 $this->ctrl->getLinkTargetByClass("iluseractionadmingui")
121 );
122
123 $this->tabs_gui->activateSubTab($a_id);
124 }

References ILIAS\Repository\lng().

Referenced by editSettings(), and executeCommand().

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

Field Documentation

◆ $admin_manager

ILIAS Awareness AdminManager ilObjAwarenessAdministrationGUI::$admin_manager
protected

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

◆ $rbacsystem

ilRbacSystem ilObjAwarenessAdministrationGUI::$rbacsystem
protected

Definition at line 27 of file class.ilObjAwarenessAdministrationGUI.php.

Referenced by getAdminTabs().


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