ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilObjLoggingSettingsGUI Class Reference
+ Inheritance diagram for ilObjLoggingSettingsGUI:
+ Collaboration diagram for ilObjLoggingSettingsGUI:

Public Member Functions

 __construct ($a_data, int $a_id, bool $a_call_by_reference, bool $a_prepare_output=true)
 
 executeCommand ()
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 setSubTabs (string $a_section)
 
- 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

 components ()
 Show components. More...
 
 saveComponentLevels ()
 Save form. More...
 
 resetComponentLevels ()
 
 errorSettings (?ilPropertyFormGUI $form=null)
 
 updateErrorSettings ()
 
 initFormErrorSettings ()
 
 initErrorSettings ()
 
 getErrorSettings ()
 
- 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

const string SECTION_SETTINGS = 'settings'
 
const string SUB_SECTION_COMPONENTS = 'log_components'
 
const string SUB_SECTION_ERROR = 'log_error_settings'
 
ilLoggingErrorSettings $error_settings
 
Refinery $refinery
 
ilComponentRepository $component_repo
 
BasicConfig $basic_log_config
 
ComponentConfigRepo $component_config_repo
 
- 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

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

@ilCtrl_Calls ilObjLoggingSettingsGUI: ilPermissionGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

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

51 {
52 global $DIC;
53
54 $this->type = 'logs';
55 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
56
57 $this->lng = $DIC->language();
58 $this->component_repo = $DIC["component.repository"];
59
60 $this->initErrorSettings();
61 $this->lng->loadLanguageModule('logging');
62 $this->lng->loadLanguageModule('log');
63
64 $this->refinery = $DIC->refinery();
65
66 $initiator = LegacyInitiator::getInstance();
67 $this->basic_log_config = $initiator->basicConfig();
68 $this->component_config_repo = $initiator->componentConfigRepository();
69 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ components()

ilObjLoggingSettingsGUI::components ( )
protected

Show components.

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

131 : void
132 {
133 $this->tabs_gui->activateTab(static::SECTION_SETTINGS);
134 $this->setSubTabs(static::SUB_SECTION_COMPONENTS);
135
136 $table = new ilLogComponentTableGUI(
137 $this->checkPermissionBool('write'),
138 $this->component_repo,
139 $this->basic_log_config,
140 $this->component_config_repo,
141 $this,
142 'components'
143 );
144 $table->init();
145 $table->parse();
146 $this->tpl->setContent($table->getHTML());
147 }
Component logger with individual log levels by component id.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

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

+ Here is the call graph for this function:

◆ errorSettings()

ilObjLoggingSettingsGUI::errorSettings ( ?ilPropertyFormGUI  $form = null)
protected

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

200 : void
201 {
202 $this->checkPermission('read');
203 $this->tabs_gui->setTabActive(static::SECTION_SETTINGS);
204 $this->setSubTabs(static::SUB_SECTION_ERROR);
205
206 if (!$form instanceof ilPropertyFormGUI) {
207 $form = $this->initFormErrorSettings();
208 }
209 $this->tpl->setContent($form->getHTML());
210 }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
This class represents a property form user interface.

References ilObjectGUI\checkPermission(), initFormErrorSettings(), and setSubTabs().

Referenced by updateErrorSettings().

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

◆ executeCommand()

ilObjLoggingSettingsGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

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

71 : void
72 {
73 $next_class = $this->ctrl->getNextClass($this);
74 $cmd = $this->ctrl->getCmd();
75 $this->prepareOutput();
76 $this->checkPermission('read');
77
78 switch ($next_class) {
79 case 'ilpermissiongui':
80 $this->tabs_gui->setTabActive('perm_settings');
81 $perm_gui = new ilPermissionGUI($this);
82 $this->ctrl->forwardCommand($perm_gui);
83 break;
84
85 default:
86 if ($cmd == "" || $cmd == "view") {
87 $cmd = "errorSettings";
88 }
89 $this->$cmd();
90
91 break;
92 }
93 }
prepareOutput(bool $show_sub_objects=true)

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

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjLoggingSettingsGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

96 : void
97 {
98 if ($this->access->checkAccess("read", '', $this->object->getRefId())) {
99 $this->tabs_gui->addTarget(
100 static::SECTION_SETTINGS,
101 $this->ctrl->getLinkTargetByClass('ilobjloggingsettingsgui', "errorSettings")
102 );
103 }
104 if ($this->access->checkAccess('edit_permission', '', $this->object->getRefId())) {
105 $this->tabs_gui->addTarget(
106 "perm_settings",
107 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
108 );
109 }
110 }

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

+ Here is the call graph for this function:

◆ getErrorSettings()

ilObjLoggingSettingsGUI::getErrorSettings ( )
protected

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

254 {
256 }
Settings for the error protocol system.
ilLoggingErrorSettings $error_settings

References $error_settings.

Referenced by initFormErrorSettings(), and updateErrorSettings().

+ Here is the caller graph for this function:

◆ initErrorSettings()

ilObjLoggingSettingsGUI::initErrorSettings ( )
protected

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

248 : void
249 {
250 $this->error_settings = ilLoggingErrorSettings::getInstance();
251 }

References ilLoggingErrorSettings\getInstance().

Referenced by __construct().

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

◆ initFormErrorSettings()

ilObjLoggingSettingsGUI::initFormErrorSettings ( )
protected

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

229 {
230 $form = new ilPropertyFormGUI();
231 $form->setTitle($this->lng->txt('logs_settings'));
232 $form->setFormAction($this->ctrl->getFormAction($this));
233
234 if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
235 $form->addCommandButton('updateErrorSettings', $this->lng->txt('save'));
236 }
237
238 $folder = new ilNonEditableValueGUI($this->lng->txt('log_error_folder'), 'error_folder');
239 $folder->setValue($this->getErrorSettings()->folder());
240 $form->addItem($folder);
241
242 $mail = new ilTextInputGUI($this->lng->txt('log_error_mail'), 'error_mail');
243 $mail->setValue($this->getErrorSettings()->mail());
244 $form->addItem($mail);
245 return $form;
246 }
This class represents a non editable value in a property form.
This class represents a text property in a property form.

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

Referenced by errorSettings(), and updateErrorSettings().

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

◆ resetComponentLevels()

ilObjLoggingSettingsGUI::resetComponentLevels ( )
protected

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

192 : void
193 {
194 $this->checkPermission('write');
195 $this->component_config_repo->resetLevelsForAllComponents();
196 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
197 $this->ctrl->redirect($this, 'components');
198 }

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

+ Here is the call graph for this function:

◆ saveComponentLevels()

ilObjLoggingSettingsGUI::saveComponentLevels ( )
protected

Save form.

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

152 : void
153 {
154 $this->checkPermission('write');
155
156 $levels = [];
157 if ($this->http->wrapper()->post()->has('level')) {
158 $levels = $this->http->wrapper()->post()->retrieve(
159 'level',
160 $this->refinery->custom()->transformation(
161 function ($arr) {
162 // keep keys(!), transform all values to int
163 return array_column(
164 array_map(
165 static function ($k, $v): array {
166 return [$k, (int) $v];
167 },
168 array_keys($arr),
169 $arr
170 ),
171 1,
172 0
173 );
174 }
175 )
176 );
177 }
178 foreach ($levels as $component_id => $value) {
179 if ($value === 0) {
180 $this->component_config_repo->resetLevelForComponent($component_id);
181 }
182 $level = ILIASLogLevel::tryFrom($value);
183 if ($level === null) {
184 continue;
185 }
186 $this->component_config_repo->updateLevelForComponent($component_id, $level);
187 }
188 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
189 $this->ctrl->redirect($this, 'components');
190 }
static http()
Fetches the global http state from ILIAS.

References ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ setSubTabs()

ilObjLoggingSettingsGUI::setSubTabs ( string  $a_section)

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

112 : void
113 {
114 $this->tabs_gui->addSubTab(
115 static::SUB_SECTION_ERROR,
116 $this->lng->txt(static::SUB_SECTION_ERROR),
117 $this->ctrl->getLinkTarget($this, 'errorSettings')
118 );
119 $this->tabs_gui->addSubTab(
120 static::SUB_SECTION_COMPONENTS,
121 $this->lng->txt(static::SUB_SECTION_COMPONENTS),
122 $this->ctrl->getLinkTarget($this, 'components')
123 );
124 $this->tabs_gui->activateSubTab($a_section);
125 }

References ILIAS\Repository\lng().

Referenced by components(), and errorSettings().

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

◆ updateErrorSettings()

ilObjLoggingSettingsGUI::updateErrorSettings ( )
protected

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

212 : void
213 {
214 $this->checkPermission('write');
215 $form = $this->initFormErrorSettings();
216 if ($form->checkInput()) {
217 $this->getErrorSettings()->setMail($form->getInput('error_mail'));
218 $this->getErrorSettings()->update();
219
220 $this->tpl->setOnScreenMessage('success', $this->lng->txt('error_settings_saved'), true);
221 $this->ctrl->redirect($this, 'errorSettings');
222 }
223 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
224 $form->setValuesByPost();
225 $this->errorSettings($form);
226 }
errorSettings(?ilPropertyFormGUI $form=null)

References ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), errorSettings(), getErrorSettings(), initFormErrorSettings(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Field Documentation

◆ $basic_log_config

BasicConfig ilObjLoggingSettingsGUI::$basic_log_config
protected

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

◆ $component_config_repo

ComponentConfigRepo ilObjLoggingSettingsGUI::$component_config_repo
protected

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

◆ $component_repo

ilComponentRepository ilObjLoggingSettingsGUI::$component_repo
protected

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

◆ $error_settings

ilLoggingErrorSettings ilObjLoggingSettingsGUI::$error_settings
protected

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

Referenced by getErrorSettings().

◆ $refinery

Refinery ilObjLoggingSettingsGUI::$refinery
protected

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

◆ SECTION_SETTINGS

const string ilObjLoggingSettingsGUI::SECTION_SETTINGS = 'settings'
protected

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

◆ SUB_SECTION_COMPONENTS

const string ilObjLoggingSettingsGUI::SUB_SECTION_COMPONENTS = 'log_components'
protected

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

◆ SUB_SECTION_ERROR

const string ilObjLoggingSettingsGUI::SUB_SECTION_ERROR = 'log_error_settings'
protected

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


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