ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjLoggingSettingsGUI Class Reference
+ Inheritance diagram for ilObjLoggingSettingsGUI:
+ Collaboration diagram for ilObjLoggingSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor. More...
 
 getLogger ()
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs ()
 Get tabs. More...
 
 setSubTabs ($a_section)
 
 getSettings ()
 Get log settings. More...
 
 settings (ilPropertyFormGUI $form=null)
 Show settings @access public. More...
 
 updateSettings ()
 Save settings @access public. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 cancel action and go back to previous page @access 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...
 

Data Fields

const SECTION_SETTINGS = 'settings'
 
const SUB_SECTION_MAIN = 'log_general_settings'
 
const SUB_SECTION_COMPONENTS = 'log_components'
 
 $tpl
 
 $lng
 
 $ctrl
 
- 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 Member Functions

 initSettings ()
 
 initFormSettings ()
 Init settings form. More...
 
 components ()
 Show components. More...
 
 saveComponentLevels ()
 Save form. More...
 
 resetComponentLevels ()
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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

 $tabs_gui
 
 $form
 
 $settings
 
 $log
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

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...
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

@ilCtrl_Calls ilObjLoggingSettingsGUI: ilPermissionGUI

Definition at line 14 of file class.ilObjLoggingSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

@access public

Definition at line 38 of file class.ilObjLoggingSettingsGUI.php.

39 {
40 global $lng,$tpl,$ilCtrl,$ilTabs;
41
42 $this->type = 'logs';
43 parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
44
45 $this->lng = $lng;
46
47 $this->tpl = $tpl;
48 $this->lng = $lng;
49 $this->ctrl = $ilCtrl;
50 $this->tabs_gui = $ilTabs;
51
52 $this->initSettings();
53 $this->lng->loadLanguageModule('logging');
54 $this->lng->loadLanguageModule('log');
55
56 include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
57 $this->log = ilLoggerFactory::getLogger('log');
58
59 }
static getLogger($a_component_id)
Get component logger.
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, $lng, $tpl, ilLoggerFactory\getLogger(), and initSettings().

+ Here is the call graph for this function:

Member Function Documentation

◆ components()

ilObjLoggingSettingsGUI::components ( )
protected

Show components.

Definition at line 295 of file class.ilObjLoggingSettingsGUI.php.

296 {
297 $this->tabs_gui->activateTab(static::SECTION_SETTINGS);
298 $this->setSubTabs(static::SUB_SECTION_COMPONENTS);
299
300 include_once './Services/Logging/classes/class.ilLogComponentTableGUI.php';
301 $table = new ilLogComponentTableGUI($this, 'components');
302 $table->init();
303 $table->parse();
304
305 $GLOBALS['tpl']->setContent($table->getHTML());
306
307 }
Component logger with individual log levels by component id.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $GLOBALS, and setSubTabs().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjLoggingSettingsGUI::executeCommand ( )

Execute command.

@access public

Reimplemented from ilObjectGUI.

Definition at line 76 of file class.ilObjLoggingSettingsGUI.php.

77 {
78 $next_class = $this->ctrl->getNextClass($this);
79 $cmd = $this->ctrl->getCmd();
80 $this->prepareOutput();
81
82 switch($next_class)
83 {
84 case 'ilpermissiongui':
85 $this->tabs_gui->setTabActive('perm_settings');
86 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
87 $perm_gui =& new ilPermissionGUI($this);
88 $ret =& $this->ctrl->forwardCommand($perm_gui);
89 break;
90
91 default:
92 if($cmd == "" || $cmd == "view")
93 {
94 $cmd = "settings";
95 }
96 $this->$cmd();
97
98 break;
99 }
100 return true;
101 }
prepareOutput()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$cmd
Definition: sahs_server.php:35

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

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjLoggingSettingsGUI::getAdminTabs ( )

Get tabs.

@access public

Definition at line 110 of file class.ilObjLoggingSettingsGUI.php.

111 {
112 global $rbacsystem, $ilAccess;
113
114 if ($ilAccess->checkAccess("read",'',$this->object->getRefId()))
115 {
116 $this->tabs_gui->addTarget(
117 static::SECTION_SETTINGS,
118 $this->ctrl->getLinkTargetByClass('ilobjloggingsettingsgui', "settings")
119 );
120 }
121 if ($ilAccess->checkAccess('edit_permission','',$this->object->getRefId()))
122 {
123 $this->tabs_gui->addTarget(
124 "perm_settings",
125 $this->ctrl->getLinkTargetByClass('ilpermissiongui',"perm")
126 );
127 }
128 }

◆ getLogger()

ilObjLoggingSettingsGUI::getLogger ( )
Returns
ilLogger

Definition at line 65 of file class.ilObjLoggingSettingsGUI.php.

References $log.

Referenced by initFormSettings(), settings(), and updateSettings().

+ Here is the caller graph for this function:

◆ getSettings()

ilObjLoggingSettingsGUI::getSettings ( )

Get log settings.

Returns
ilLogSettings

Definition at line 156 of file class.ilObjLoggingSettingsGUI.php.

References $settings.

Referenced by initFormSettings(), settings(), and updateSettings().

+ Here is the caller graph for this function:

◆ initFormSettings()

ilObjLoggingSettingsGUI::initFormSettings ( )
protected

Init settings form.

Definition at line 234 of file class.ilObjLoggingSettingsGUI.php.

235 {
236 global $lng,$ilDB, $ilAccess;
237
238 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
239 include_once './Services/Search/classes/class.ilSearchSettings.php';
240
241 $form = new ilPropertyFormGUI();
242 $form->setTitle($this->lng->txt('logs_settings'));
243 $form->setFormAction($this->ctrl->getFormAction($this));
244
245 if($ilAccess->checkAccess('write','',$this->object->getRefId()))
246 {
247 $form->addCommandButton('updateSettings', $this->lng->txt('save'));
248 }
249
250 $level = new ilSelectInputGUI($this->lng->txt('log_log_level'),'level');
251 $level->setOptions(ilLogLevel::getLevelOptions());
252 $level->setValue($this->getSettings()->getLevel());
253 $form->addItem($level);
254
255 $cache = new ilCheckboxInputGUI($this->lng->txt('log_cache_'), 'cache');
256 $cache->setInfo($this->lng->txt('log_cache_info'));
257 $cache->setValue(1);
258 $cache->setChecked($this->getSettings()->isCacheEnabled());
259 $form->addItem($cache);
260
261 $cache_level = new ilSelectInputGUI($this->lng->txt('log_cache_level'), 'cache_level');
262 $cache_level->setOptions(ilLogLevel::getLevelOptions());
263 $cache_level->setValue($this->getSettings()->getCacheLevel());
264 $cache->addSubItem($cache_level);
265
266 $memory = new ilCheckboxInputGUI($this->lng->txt('log_memory'),'memory');
267 $memory->setValue(1);
268 $memory->setChecked($this->getSettings()->isMemoryUsageEnabled());
269 $form->addItem($memory);
270
271 // Browser handler
272 $browser = new ilCheckboxInputGUI($this->lng->txt('log_browser'),'browser');
273 $browser->setValue(1);
274 $browser->setChecked($this->getSettings()->isBrowserLogEnabled());
275 $form->addItem($browser);
276
277 // users
278 $users = new ilTextInputGUI($this->lng->txt('log_browser_users'), 'browser_users');
279 $users->setValue(current($this->getSettings()->getBrowserLogUsers()));
280 $users->setMulti(TRUE);
281 $users->setMultiValues($this->getSettings()->getBrowserLogUsers());
282
283 $this->getLogger()->debug(print_r($this->getSettings()->getBrowserLogUsers(),TRUE));
284
285 $browser->addSubItem($users);
286
287
288 return $form;
289 }
This class represents a checkbox property in a property form.
static getLevelOptions()
Get log level options.
This class represents a property form user interface.
This class represents a selection list property in a property form.
This class represents a text property in a property form.
global $ilDB

References $form, $ilDB, $lng, ilLogLevel\getLevelOptions(), getLogger(), and getSettings().

Referenced by settings(), and updateSettings().

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

◆ initSettings()

ilObjLoggingSettingsGUI::initSettings ( )
protected

Definition at line 146 of file class.ilObjLoggingSettingsGUI.php.

147 {
148 include_once("Services/Logging/classes/class.ilLoggingDBSettings.php");
150 }
static getInstance()
Get instance.
settings(ilPropertyFormGUI $form=null)
Show settings @access public.

References ilLoggingDBSettings\getInstance(), and settings().

Referenced by __construct().

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

◆ resetComponentLevels()

ilObjLoggingSettingsGUI::resetComponentLevels ( )
protected

Definition at line 330 of file class.ilObjLoggingSettingsGUI.php.

331 {
332 foreach(ilLogComponentLevels::getInstance()->getLogComponents() as $component)
333 {
334 $component->setLevel(null);
335 $component->update();
336 }
337 ilUtil::sendSuccess($this->lng->txt('settings_saved'),TRUE);
338 $this->ctrl->redirect($this, 'components');
339
340 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References ilLogComponentLevels\getInstance(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ saveComponentLevels()

ilObjLoggingSettingsGUI::saveComponentLevels ( )
protected

Save form.

Definition at line 312 of file class.ilObjLoggingSettingsGUI.php.

313 {
315
316 foreach($_POST['level'] as $component_id => $value)
317 {
318 ilLoggerFactory::getLogger('log')->debug($component_id);
319 ilLoggerFactory::getLogger('log')->debug($value);
320 include_once './Services/Logging/classes/class.ilLogComponentLevel.php';
321 $level = new ilLogComponentLevel($component_id);
322 $level->setLevel($value);
323 $level->update();
324 }
325
326 ilUtil::sendSuccess($this->lng->txt('settings_saved'),TRUE);
327 $this->ctrl->redirect($this, 'components');
328 }
individual log levels for components
$_POST['username']
Definition: cron.php:12

References $_POST, ilLogLevel\DEBUG, ilLoggerFactory\getLogger(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ setSubTabs()

ilObjLoggingSettingsGUI::setSubTabs (   $a_section)

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

131 {
132 $this->tabs_gui->addSubTab(
133 static::SUB_SECTION_MAIN,
134 $this->lng->txt(static::SUB_SECTION_MAIN),
135 $this->ctrl->getLinkTarget($this,'settings')
136 );
137 $this->tabs_gui->addSubTab(
138 static::SUB_SECTION_COMPONENTS,
139 $this->lng->txt(static::SUB_SECTION_COMPONENTS),
140 $this->ctrl->getLinkTarget($this,'components')
141 );
142
143 $this->tabs_gui->activateSubTab($a_section);
144 }

Referenced by components(), and settings().

+ Here is the caller graph for this function:

◆ settings()

ilObjLoggingSettingsGUI::settings ( ilPropertyFormGUI  $form = null)

Show settings @access public.

Definition at line 165 of file class.ilObjLoggingSettingsGUI.php.

166 {
167 global $ilAccess,$ilErr;
168
169 if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
170 {
171 $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
172 }
173
174 $this->tabs_gui->setTabActive(static::SECTION_SETTINGS);
175 $this->setSubTabs(static::SUB_SECTION_MAIN);
176
177 if(!$form instanceof ilPropertyFormGUI)
178 {
179 $form = $this->initFormSettings();
180 }
181 $this->tpl->setContent($form->getHTML());
182
183 $this->getLogger()->debug('Currrent level is '.$this->getSettings()->getLevel());
184
185 return TRUE;
186 }

References $form, $ilErr, getLogger(), getSettings(), initFormSettings(), and setSubTabs().

Referenced by initSettings(), and updateSettings().

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

◆ updateSettings()

ilObjLoggingSettingsGUI::updateSettings ( )

Save settings @access public.

Definition at line 192 of file class.ilObjLoggingSettingsGUI.php.

193 {
194 include_once 'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
195
196 global $rbacsystem;
197
198 if(!$rbacsystem->checkAccess('write',$this->object->getRefId()))
199 {
200 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
201 }
202
203
204 $form = $this->initFormSettings();
205 if($form->checkInput())
206 {
207 $this->getSettings()->setLevel($form->getInput('level'));
208 $this->getSettings()->enableCaching($form->getInput('cache'));
209 $this->getSettings()->setCacheLevel($form->getInput('cache_level'));
210 $this->getSettings()->enableMemoryUsage($form->getInput('memory'));
211 $this->getSettings()->enableBrowserLog($form->getInput('browser'));
212 $this->getSettings()->setBrowserUsers($form->getInput('browser_users'));
213
214 $this->getLogger()->info(print_r($form->getInput('browser_users'),TRUE));
215
216 $this->getSettings()->update();
217
218 ilUtil::sendSuccess($this->lng->txt('settings_saved'),TRUE);
219 $this->ctrl->redirect($this,'settings');
220 return TRUE;
221 }
222
223 ilUtil::sendFailure($this->lng->txt('err_check_input'));
224 $form->setValuesByPost();
225 $this->settings($form);
226
227 return TRUE;
228 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file)

References $form, getLogger(), getSettings(), initFormSettings(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and settings().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilObjLoggingSettingsGUI::$ctrl

Definition at line 23 of file class.ilObjLoggingSettingsGUI.php.

◆ $form

ilObjLoggingSettingsGUI::$form
protected

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

Referenced by initFormSettings(), settings(), and updateSettings().

◆ $lng

ilObjLoggingSettingsGUI::$lng

Definition at line 22 of file class.ilObjLoggingSettingsGUI.php.

Referenced by __construct(), and initFormSettings().

◆ $log

ilObjLoggingSettingsGUI::$log
protected

Definition at line 29 of file class.ilObjLoggingSettingsGUI.php.

Referenced by getLogger().

◆ $settings

ilObjLoggingSettingsGUI::$settings
protected

Definition at line 26 of file class.ilObjLoggingSettingsGUI.php.

Referenced by getSettings().

◆ $tabs_gui

ilObjLoggingSettingsGUI::$tabs_gui
protected

Definition at line 24 of file class.ilObjLoggingSettingsGUI.php.

◆ $tpl

ilObjLoggingSettingsGUI::$tpl

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

Referenced by __construct().

◆ SECTION_SETTINGS

const ilObjLoggingSettingsGUI::SECTION_SETTINGS = 'settings'

Definition at line 16 of file class.ilObjLoggingSettingsGUI.php.

◆ SUB_SECTION_COMPONENTS

const ilObjLoggingSettingsGUI::SUB_SECTION_COMPONENTS = 'log_components'

Definition at line 18 of file class.ilObjLoggingSettingsGUI.php.

◆ SUB_SECTION_MAIN

const ilObjLoggingSettingsGUI::SUB_SECTION_MAIN = 'log_general_settings'

Definition at line 17 of file class.ilObjLoggingSettingsGUI.php.


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