ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjAwarenessAdministrationGUI Class Reference

Awareness tool administration. More...

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

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs ()
 Get tabs. More...
 
 setSubTabs ($a_id)
 Set sub tabs. More...
 
 editSettings ($a_form=null)
 Edit settings. More...
 
 saveSettings ()
 Save settings. More...
 
 cancel ()
 Save settings. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 

Protected Member Functions

 initFormSettings ()
 Init settings property form. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $rbacsystem
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjAwarenessAdministrationGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Contructor.

public

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

References $DIC.

29  {
30  global $DIC;
31 
32  $this->rbacsystem = $DIC->rbac()->system();
33  $this->ctrl = $DIC->ctrl();
34  $this->lng = $DIC->language();
35  $this->type = "awra";
36  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
37 
38  $this->lng->loadLanguageModule("awrn");
39  $this->lng->loadLanguageModule("pd");
40  $this->lng->loadLanguageModule("usr");
41  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ cancel()

ilObjAwarenessAdministrationGUI::cancel ( )

Save settings.

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

References ilObjectGUI\$ctrl, and $ilCtrl.

192  {
194 
195  $ilCtrl->redirect($this, "view");
196  }
global $ilCtrl
Definition: ilias.php:18

◆ editSettings()

ilObjAwarenessAdministrationGUI::editSettings (   $a_form = null)

Edit settings.

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

References initFormSettings(), and setSubTabs().

Referenced by saveSettings().

137  {
138  $this->tabs_gui->setTabActive('settings');
139  $this->setSubTabs("settings");
140 
141  if (!$a_form) {
142  $a_form = $this->initFormSettings();
143  }
144  $this->tpl->setContent($a_form->getHTML());
145  return true;
146  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjAwarenessAdministrationGUI::executeCommand ( )

Execute command.

public

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

References ilObjectGUI\prepareOutput(), and setSubTabs().

50  {
51  $next_class = $this->ctrl->getNextClass($this);
52  $cmd = $this->ctrl->getCmd();
53 
54  $this->prepareOutput();
55 
56  switch ($next_class) {
57  case 'iluseractionadmingui':
58  include_once("./Services/User/Actions/classes/class.ilUserActionAdminGUI.php");
59  include_once("./Services/Awareness/classes/class.ilAwarenessUserActionContext.php");
60  $gui = new ilUserActionAdminGUI();
61  $gui->setActionContext(new ilAwarenessUserActionContext());
62  $this->tabs_gui->setTabActive('settings');
63  $this->setSubTabs("actions");
64  $this->ctrl->forwardCommand($gui);
65  break;
66 
67  case 'ilpermissiongui':
68  $this->tabs_gui->setTabActive('perm_settings');
69  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
70  $perm_gui = new ilPermissionGUI($this);
71  $this->ctrl->forwardCommand($perm_gui);
72  break;
73 
74  default:
75  if (!$cmd || $cmd == 'view') {
76  $cmd = "editSettings";
77  }
78 
79  $this->$cmd();
80  break;
81  }
82  return true;
83  }
User action administration GUI class.
prepareOutput($a_show_subobjects=true)
prepare output
Awareness context for user actions.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjAwarenessAdministrationGUI::getAdminTabs ( )

Get tabs.

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

References $rbacsystem.

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  }

◆ initFormSettings()

ilObjAwarenessAdministrationGUI::initFormSettings ( )
protected

Init settings property form.

protected

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

References $form, ilObjectGUI\$lng, PHPMailer\PHPMailer\$options, $si, ilObjectGUI\checkPermissionBool(), ilAwarenessUserProviderFactory\getAllProviders(), ilAwarenessUserProvider\MODE_INACTIVE, ilAwarenessUserProvider\MODE_INCL_OFFLINE, ilAwarenessUserProvider\MODE_ONLINE_ONLY, ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), and ilNumberInputGUI\setSuffix().

Referenced by editSettings(), and saveSettings().

204  {
205  $lng = $this->lng;
206 
207  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
208  $form = new ilPropertyFormGUI();
209  $form->setFormAction($this->ctrl->getFormAction($this));
210  $form->setTitle($this->lng->txt('awareness_settings'));
211 
212  if ($this->checkPermissionBool("write")) {
213  $form->addCommandButton('saveSettings', $this->lng->txt('save'));
214  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
215  }
216 
217  $en = new ilCheckboxInputGUI($lng->txt("awrn_enable"), "enable_awareness");
218  $form->addItem($en);
219 
220  $awrn_set = new ilSetting("awrn");
221  $en->setChecked($awrn_set->get("awrn_enabled", false));
222 
223  // caching period
224  $ti = new ilNumberInputGUI($this->lng->txt("awrn_caching_period"), "caching_period");
225  $ti->setInfo($this->lng->txt("awrn_caching_period_info"));
226  $ti->setSuffix($this->lng->txt("awrn_seconds"));
227  $ti->setSize(6);
228  $ti->setMaxLength(6);
229  $ti->setValue($awrn_set->get("caching_period"));
230  $en->addSubItem($ti);
231 
232  // limit number of entries
233  $ti = new ilNumberInputGUI($this->lng->txt("awrn_max_nr_entries"), "max_nr_entries");
234  $ti->setInfo($this->lng->txt("awrn_max_nr_entries_info"));
235  $ti->setSize(3);
236  $ti->setMaxLength(3);
237  $ti->setMinValue(5);
238  $ti->setMaxValue(200);
239  $ti->setValue($awrn_set->get("max_nr_entries"));
240  $en->addSubItem($ti);
241 
242  // maximum inactivity time
243  $pd_set = new ilSetting("pd"); // under pd settings due to historical reasons
244  $ti_prop = new ilNumberInputGUI(
245  $lng->txt("awrn_max_inactivity"),
246  "time_removal"
247  );
248  $ti_prop->setSuffix($this->lng->txt("awrn_minutes"));
249  if ($pd_set->get("user_activity_time") > 0) {
250  $ti_prop->setValue($pd_set->get("user_activity_time"));
251  }
252  $ti_prop->setInfo($lng->txt("awrn_max_inactivity_info"));
253  $ti_prop->setMaxLength(3);
254  $ti_prop->setSize(3);
255  $en->addSubItem($ti_prop);
256 
257  // activate osd
258  $osd = new ilCheckboxInputGUI($this->lng->txt("awrn_use_osd"), "use_osd");
259  $osd->setInfo($this->lng->txt("awrn_use_osd_info"));
260  $osd->setChecked($awrn_set->get("use_osd", true));
261  $en->addSubItem($osd);
262 
263 
264  include_once("./Services/Awareness/classes/class.ilAwarenessUserProviderFactory.php");
266  foreach ($prov as $p) {
267  // activation mode
268  $options = array(
269  ilAwarenessUserProvider::MODE_INACTIVE => $lng->txt("awrn_inactive"),
270  ilAwarenessUserProvider::MODE_ONLINE_ONLY => $lng->txt("awrn_online_only"),
271  ilAwarenessUserProvider::MODE_INCL_OFFLINE => $lng->txt("awrn_incl_offline")
272  );
273  $si = new ilSelectInputGUI($p->getTitle(), "up_act_mode_" . $p->getProviderId());
274  $si->setOptions($options);
275  $si->setInfo($p->getInfo());
276  $si->setValue($p->getActivationMode());
277  $en->addSubItem($si);
278  }
279 
280  return $form;
281  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
setSuffix($a_value)
Set suffix.
if(isset($_POST['submit'])) $form
This class represents a number property in a property form.
static getAllProviders()
Get all awareness providers.
setOptions($a_options)
Set Options.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSettings()

ilObjAwarenessAdministrationGUI::saveSettings ( )

Save settings.

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

References $_POST, ilObjectGUI\$ctrl, $form, $ilCtrl, ilObjectGUI\checkPermission(), editSettings(), ilAwarenessUserProviderFactory\getAllProviders(), and initFormSettings().

152  {
154 
155  $this->checkPermission("write");
156 
157  $form = $this->initFormSettings();
158  if ($form->checkInput()) {
159  $awrn_set = new ilSetting("awrn");
160  $awrn_set->set("awrn_enabled", (bool) $form->getInput("enable_awareness"));
161 
162  $p = (int) $form->getInput("caching_period");
163  if ($p < 0) {
164  $p = 0;
165  }
166  $awrn_set->set("caching_period", $p);
167 
168  $awrn_set->set("max_nr_entries", (int) $form->getInput("max_nr_entries"));
169  $awrn_set->set("use_osd", (int) $form->getInput("use_osd"));
170 
171  $pd_set = new ilSetting("pd");
172  $pd_set->set("user_activity_time", (int) $_POST["time_removal"]);
173 
174  include_once("./Services/Awareness/classes/class.ilAwarenessUserProviderFactory.php");
176  foreach ($prov as $p) {
177  $p->setActivationMode($form->getInput("up_act_mode_" . $p->getProviderId()));
178  }
179 
180  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
181  $ilCtrl->redirect($this, "editSettings");
182  }
183 
184  $form->setValuesByPost();
185  $this->editSettings($form);
186  }
global $ilCtrl
Definition: ilias.php:18
if(isset($_POST['submit'])) $form
static getAllProviders()
Get all awareness providers.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
$_POST["username"]
+ Here is the call graph for this function:

◆ setSubTabs()

ilObjAwarenessAdministrationGUI::setSubTabs (   $a_id)

Set sub tabs.

Parameters

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

Referenced by editSettings(), and executeCommand().

116  {
117  $this->tabs_gui->addSubTab(
118  "settings",
119  $this->lng->txt("settings"),
120  $this->ctrl->getLinkTarget($this, "editSettings")
121  );
122 
123  $this->tabs_gui->addSubTab(
124  "actions",
125  $this->lng->txt("user_actions"),
126  $this->ctrl->getLinkTargetByClass("iluseractionadmingui")
127  );
128 
129  $this->tabs_gui->activateSubTab($a_id);
130  }
+ Here is the caller graph for this function:

Field Documentation

◆ $rbacsystem

ilObjAwarenessAdministrationGUI::$rbacsystem
protected

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

Referenced by getAdminTabs().


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