ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
 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 ()
 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
 
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
 
ilObjectCustomIconFactory $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 ilObjAwarenessAdministrationGUI: ilPermissionGUI, ilUserActionAdminGUI 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.

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

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  }
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ cancel()

ilObjAwarenessAdministrationGUI::cancel ( )

Save settings.

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

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

187  : void
188  {
189  $ilCtrl = $this->ctrl;
190 
191  $ilCtrl->redirect($this, "view");
192  }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
+ 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.

References initFormSettings(), and setSubTabs().

Referenced by saveSettings().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjAwarenessAdministrationGUI::executeCommand ( )

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

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

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  }
User action administration GUI class.
prepareOutput(bool $show_sub_objects=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjAwarenessAdministrationGUI::getAdminTabs ( )

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

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

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 ...
+ Here is the call graph for this function:

◆ initFormSettings()

ilObjAwarenessAdministrationGUI::initFormSettings ( )
protected

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

References ilObjectGUI\$lng, ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilNumberInputGUI\setSuffix(), and ilLanguage\txt().

Referenced by editSettings(), and saveSettings().

195  {
196  $lng = $this->lng;
197 
198  $form = new ilPropertyFormGUI();
199  $form->setFormAction($this->ctrl->getFormAction($this));
200  $form->setTitle($this->lng->txt('awareness_settings'));
201 
202  if ($this->checkPermissionBool("write")) {
203  $form->addCommandButton('saveSettings', $this->lng->txt('save'));
204  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
205  }
206 
207  $en = new ilCheckboxInputGUI($lng->txt("awrn_enable"), "enable_awareness");
208  $form->addItem($en);
209 
210  $awrn_set = new ilSetting("awrn");
211  $en->setChecked($awrn_set->get("awrn_enabled", false));
212 
213  // caching period
214  $ti = new ilNumberInputGUI($this->lng->txt("awrn_caching_period"), "caching_period");
215  $ti->setInfo($this->lng->txt("awrn_caching_period_info"));
216  $ti->setSuffix($this->lng->txt("awrn_seconds"));
217  $ti->setSize(6);
218  $ti->setMaxLength(6);
219  $ti->setValue($awrn_set->get("caching_period"));
220  $en->addSubItem($ti);
221 
222  // limit number of entries
223  $ti = new ilNumberInputGUI($this->lng->txt("awrn_max_nr_entries"), "max_nr_entries");
224  $ti->setInfo($this->lng->txt("awrn_max_nr_entries_info"));
225  $ti->setSize(3);
226  $ti->setMaxLength(3);
227  $ti->setMinValue(5);
228  $ti->setMaxValue(200);
229  $ti->setValue($awrn_set->get("max_nr_entries"));
230  $en->addSubItem($ti);
231 
232  // maximum inactivity time
233  $pd_set = new ilSetting("pd"); // under pd settings due to historical reasons
234  $ti_prop = new ilNumberInputGUI(
235  $lng->txt("awrn_max_inactivity"),
236  "time_removal"
237  );
238  $ti_prop->setSuffix($this->lng->txt("awrn_minutes"));
239  if ($pd_set->get("user_activity_time") > 0) {
240  $ti_prop->setValue($pd_set->get("user_activity_time"));
241  }
242  $ti_prop->setInfo($lng->txt("awrn_max_inactivity_info"));
243  $ti_prop->setMaxLength(3);
244  $ti_prop->setSize(3);
245  $en->addSubItem($ti_prop);
246 
247  // activate osd
248  $osd = new ilCheckboxInputGUI($this->lng->txt("awrn_use_osd"), "use_osd");
249  $osd->setInfo($this->lng->txt("awrn_use_osd_info"));
250  $osd->setChecked($awrn_set->get("use_osd", true));
251  $en->addSubItem($osd);
252 
253 
254  $prov = $this->admin_manager->getAllUserProviders();
255  foreach ($prov as $p) {
256  // activation mode
257  $options = $this->admin_manager->getModeOptions();
258  $si = new ilSelectInputGUI($p->getTitle(), "up_act_mode_" . $p->getProviderId());
259  $si->setOptions($options);
260  $si->setInfo($p->getInfo());
261  $si->setValue($this->admin_manager->getActivationMode($p->getProviderId()));
262  $en->addSubItem($si);
263  }
264 
265  return $form;
266  }
setSuffix(string $a_value)
This class represents a selection list 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...
setOptions(array $a_options)
ilLanguage $lng
This class represents a number property in a property form.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ 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.

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

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  $prov = $this->admin_manager->getAllUserProviders();
169  foreach ($prov as $p) {
170  $this->admin_manager->setActivationMode(
171  $p->getProviderId(),
172  (int) $form->getInput("up_act_mode_" . $p->getProviderId())
173  );
174  }
175 
176  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
177  $ilCtrl->redirect($this, "editSettings");
178  }
179 
180  $form->setValuesByPost();
181  $this->editSettings($form);
182  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
editSettings(?ilPropertyFormGUI $a_form=null)
Edit settings.
+ Here is the call graph for this function:

◆ setSubTabs()

ilObjAwarenessAdministrationGUI::setSubTabs ( string  $a_id)

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

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

Referenced by editSettings(), and executeCommand().

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  }
+ 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: