ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 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...
 

Protected Member Functions

 initFormSettings ()
 Init settings property form. More...
 
- Protected Member Functions inherited from ilObjectGUI
 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...
 
 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...
 
 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...
 

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
 
 $ilias
 
 $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
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

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 23 of file class.ilObjAwarenessAdministrationGUI.php.

24  {
25  $this->type = "awra";
26  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
27 
28  $this->lng->loadLanguageModule("awrn");
29  $this->lng->loadLanguageModule("pd");
30  $this->lng->loadLanguageModule("usr");
31  }

Member Function Documentation

◆ cancel()

ilObjAwarenessAdministrationGUI::cancel ( )

Save settings.

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

References $ilCtrl.

180  {
181  global $ilCtrl;
182 
183  $ilCtrl->redirect($this, "view");
184  }
global $ilCtrl
Definition: ilias.php:18

◆ editSettings()

ilObjAwarenessAdministrationGUI::editSettings (   $a_form = null)

Edit settings.

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

References initFormSettings(), and setSubTabs().

Referenced by saveSettings().

121  {
122  $this->tabs_gui->setTabActive('settings');
123  $this->setSubTabs("settings");
124 
125  if(!$a_form)
126  {
127  $a_form = $this->initFormSettings();
128  }
129  $this->tpl->setContent($a_form->getHTML());
130  return true;
131  }
+ 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 39 of file class.ilObjAwarenessAdministrationGUI.php.

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

40  {
41  $next_class = $this->ctrl->getNextClass($this);
42  $cmd = $this->ctrl->getCmd();
43 
44  $this->prepareOutput();
45 
46  switch($next_class)
47  {
48  case 'iluseractionadmingui':
49  include_once("./Services/User/Actions/classes/class.ilUserActionAdminGUI.php");
50  $gui = new ilUserActionAdminGUI();
51  $this->tabs_gui->setTabActive('settings');
52  $this->setSubTabs("actions");
53  $this->ctrl->forwardCommand($gui);
54  break;
55 
56  case 'ilpermissiongui':
57  $this->tabs_gui->setTabActive('perm_settings');
58  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
59  $perm_gui = new ilPermissionGUI($this);
60  $this->ctrl->forwardCommand($perm_gui);
61  break;
62 
63  default:
64  if(!$cmd || $cmd == 'view')
65  {
66  $cmd = "editSettings";
67  }
68 
69  $this->$cmd();
70  break;
71  }
72  return true;
73  }
User action administration GUI class.
$cmd
Definition: sahs_server.php:35
prepareOutput($a_show_subobjects=true)
prepare output
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 78 of file class.ilObjAwarenessAdministrationGUI.php.

79  {
80  global $rbacsystem;
81 
82  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
83  {
84  $this->tabs_gui->addTab("settings",
85  $this->lng->txt("settings"),
86  $this->ctrl->getLinkTarget($this, "editSettings"));
87  }
88 
89  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
90  {
91  $this->tabs_gui->addTab("perm_settings",
92  $this->lng->txt("perm_settings"),
93  $this->ctrl->getLinkTargetByClass('ilpermissiongui',"perm"));
94  }
95  }

◆ initFormSettings()

ilObjAwarenessAdministrationGUI::initFormSettings ( )
protected

Init settings property form.

protected

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

References ilObjectGUI\$lng, $options, $si, array, 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().

192  {
193  global $lng;
194 
195  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
196  $form = new ilPropertyFormGUI();
197  $form->setFormAction($this->ctrl->getFormAction($this));
198  $form->setTitle($this->lng->txt('awareness_settings'));
199  $form->addCommandButton('saveSettings',$this->lng->txt('save'));
200  $form->addCommandButton('cancel',$this->lng->txt('cancel'));
201 
202  $en = new ilCheckboxInputGUI($lng->txt("awrn_enable"), "enable_awareness");
203  $form->addItem($en);
204 
205  $awrn_set = new ilSetting("awrn");
206  $en->setChecked($awrn_set->get("awrn_enabled", false));
207 
208  // caching period
209  $ti = new ilNumberInputGUI($this->lng->txt("awrn_caching_period"), "caching_period");
210  $ti->setInfo($this->lng->txt("awrn_caching_period_info"));
211  $ti->setSuffix($this->lng->txt("awrn_seconds"));
212  $ti->setSize(6);
213  $ti->setMaxLength(6);
214  $ti->setValue($awrn_set->get("caching_period"));
215  $en->addSubItem($ti);
216 
217  // limit number of entries
218  $ti = new ilNumberInputGUI($this->lng->txt("awrn_max_nr_entries"), "max_nr_entries");
219  $ti->setInfo($this->lng->txt("awrn_max_nr_entries_info"));
220  $ti->setSize(3);
221  $ti->setMaxLength(3);
222  $ti->setMinValue(5);
223  $ti->setMaxValue(200);
224  $ti->setValue($awrn_set->get("max_nr_entries"));
225  $en->addSubItem($ti);
226 
227  // maximum inactivity time
228  $pd_set = new ilSetting("pd"); // under pd settings due to historical reasons
229  $ti_prop = new ilNumberInputGUI($lng->txt("awrn_max_inactivity"),
230  "time_removal");
231  $ti_prop->setSuffix($this->lng->txt("awrn_minutes"));
232  if ($pd_set->get("user_activity_time") > 0)
233  {
234  $ti_prop->setValue($pd_set->get("user_activity_time"));
235  }
236  $ti_prop->setInfo($lng->txt("awrn_max_inactivity_info"));
237  $ti_prop->setMaxLength(3);
238  $ti_prop->setSize(3);
239  $en->addSubItem($ti_prop);
240 
241  // activate osd
242  $osd = new ilCheckboxInputGUI($this->lng->txt("awrn_use_osd"), "use_osd");
243  $osd->setInfo($this->lng->txt("awrn_use_osd_info"));
244  $osd->setChecked($awrn_set->get("use_osd", true));
245  $en->addSubItem($osd);
246 
247 
248  include_once("./Services/Awareness/classes/class.ilAwarenessUserProviderFactory.php");
250  foreach ($prov as $p)
251  {
252  // activation mode
253  $options = array(
254  ilAwarenessUserProvider::MODE_INACTIVE => $lng->txt("awrn_inactive"),
255  ilAwarenessUserProvider::MODE_ONLINE_ONLY => $lng->txt("awrn_online_only"),
256  ilAwarenessUserProvider::MODE_INCL_OFFLINE => $lng->txt("awrn_incl_offline")
257  );
258  $si = new ilSelectInputGUI($p->getTitle(), "up_act_mode_".$p->getProviderId());
259  $si->setOptions($options);
260  $si->setInfo($p->getInfo());
261  $si->setValue($p->getActivationMode());
262  $en->addSubItem($si);
263  }
264 
265  return $form;
266  }
ILIAS Setting Class.
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(!is_array($argv)) $options
This class represents a number property in a property form.
static getAllProviders()
Get all awareness providers.
setOptions($a_options)
Set Options.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSettings()

ilObjAwarenessAdministrationGUI::saveSettings ( )

Save settings.

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

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

137  {
138  global $ilCtrl;
139 
140  $this->checkPermission("write");
141 
142  $form = $this->initFormSettings();
143  if($form->checkInput())
144  {
145  $awrn_set = new ilSetting("awrn");
146  $awrn_set->set("awrn_enabled", (bool) $form->getInput("enable_awareness"));
147 
148  $p = (int) $form->getInput("caching_period");
149  if ($p < 0)
150  {
151  $p = 0;
152  }
153  $awrn_set->set("caching_period", $p);
154 
155  $awrn_set->set("max_nr_entries", (int) $form->getInput("max_nr_entries"));
156  $awrn_set->set("use_osd", (int) $form->getInput("use_osd"));
157 
158  $pd_set = new ilSetting("pd");
159  $pd_set->set("user_activity_time", (int) $_POST["time_removal"]);
160 
161  include_once("./Services/Awareness/classes/class.ilAwarenessUserProviderFactory.php");
163  foreach ($prov as $p)
164  {
165  $p->setActivationMode($form->getInput("up_act_mode_".$p->getProviderId()));
166  }
167 
168  ilUtil::sendSuccess($this->lng->txt("settings_saved"),true);
169  $ilCtrl->redirect($this, "editSettings");
170  }
171 
172  $form->setValuesByPost();
173  $this->editSettings($form);
174  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
ILIAS Setting Class.
global $ilCtrl
Definition: ilias.php:18
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 103 of file class.ilObjAwarenessAdministrationGUI.php.

Referenced by editSettings(), and executeCommand().

104  {
105  $this->tabs_gui->addSubTab("settings",
106  $this->lng->txt("settings"),
107  $this->ctrl->getLinkTarget($this, "editSettings"));
108 
109  $this->tabs_gui->addSubTab("actions",
110  $this->lng->txt("user_actions"),
111  $this->ctrl->getLinkTargetByClass("iluseractionadmingui"));
112 
113  $this->tabs_gui->activateSubTab($a_id);
114  }
+ Here is the caller graph for this function:

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