ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjTermsOfServiceGUI Class Reference
+ Inheritance diagram for ilObjTermsOfServiceGUI:
+ Collaboration diagram for ilObjTermsOfServiceGUI:

Public Member Functions

 __construct (int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
 
 getType ()
 Functions that must be overwritten. More...
 
 executeCommand ()
 execute command More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 form ()
 
 afterDocumentDeletion ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. 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)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. 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

 settings ()
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $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...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) 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...
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
- 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

ILIAS DI Container $dic
 
ilErrorHandling $error
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = []
 
 $access_handler
 
- 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 = ""
 

Private Member Functions

 documents ()
 
 confirmReset ()
 
 resetNow ()
 
 createSettings ()
 

Private Attributes

readonly ilLegalDocumentsAdministrationGUI $legal_documents
 
readonly Config $config
 
readonly UI $ui
 
readonly Settings $tos_settings
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- 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 ilObject2GUI
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- 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
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de @ilCtrl_Calls ilObjTermsOfServiceGUI: ilPermissionGUI @ilCtrl_Calls ilObjTermsOfServiceGUI: ilTermsOfServiceDocumentGUI @ilCtrl_Calls ilObjTermsOfServiceGUI: ilTermsOfServiceAcceptanceHistoryGUI @ilCtrl_Calls ilObjTermsOfServiceGUI: ilLegalDocumentsAdministrationGUI @ilCtrl_isCalledBy ilObjTermsOfServiceGUI: ilAdministrationGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilObjTermsOfServiceGUI::__construct ( int  $a_id = 0,
int  $a_id_type = self::REPOSITORY_NODE_ID,
int  $a_parent_node_id = 0 
)

Reimplemented from ilObject2GUI.

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

48 {
49 global $DIC;
50
51 $this->dic = $DIC;
52 $this->lng = $DIC->language();
53 $this->error = $DIC['ilErr'];
54
55 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
56
57 $this->lng->loadLanguageModule('tos');
58 $this->lng->loadLanguageModule('meta');
59 $config = new Config($this->dic['legalDocuments']->provide(Consumer::ID));
60 if ($this->rbac_system->checkAccess('write', $this->object->getRefId())) {
62 }
63 $this->config = $config;
64 $this->legal_documents = new ilLegalDocumentsAdministrationGUI(self::class, $this->config, $this->afterDocumentDeletion(...));
65 $this->ui = new UI(Consumer::ID, $this->dic->ui(), $this->dic->language());
66 $this->tos_settings = $this->createSettings();
67 }
error(string $a_errmsg)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $config, $DIC, ILIAS\GlobalScreen\Provider\__construct(), afterDocumentDeletion(), ILIAS\LegalDocuments\Config\allowEditing(), createSettings(), error(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

Member Function Documentation

◆ afterDocumentDeletion()

ilObjTermsOfServiceGUI::afterDocumentDeletion ( )

Definition at line 177 of file class.ilObjTermsOfServiceGUI.php.

177 : void
178 {
179 if ($this->config->legalDocuments()->document()->repository()->countAll() === 0) {
180 $this->tos_settings->enabled()->update(false);
181 }
182 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ confirmReset()

ilObjTermsOfServiceGUI::confirmReset ( )
private

Definition at line 219 of file class.ilObjTermsOfServiceGUI.php.

219 : void
220 {
221 $this->legal_documents->admin()->requireEditable();
222 $this->legal_documents->admin()->setContent((new Confirmation($this->dic->language()))->render(
223 $this->dic->ctrl()->getFormAction($this, 'resetNow'),
224 'resetNow',
225 'documents',
226 $this->dic->language()->txt('tos_sure_reset_tos')
227 ));
228 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ createSettings()

ilObjTermsOfServiceGUI::createSettings ( )
private

Definition at line 240 of file class.ilObjTermsOfServiceGUI.php.

240 : Settings
241 {
242 $blocks = new Blocks($this->config->legalDocuments()->id(), $this->dic, $this->config->legalDocuments());
243 return new Settings($blocks->selectSettingsFrom($blocks->globalStore()));
244 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ documents()

ilObjTermsOfServiceGUI::documents ( )
private

Definition at line 206 of file class.ilObjTermsOfServiceGUI.php.

206 : void
207 {
208 $buttons = $this->config->editable() ?
209 [$this->legal_documents->admin()->resetButton($this->dic->ctrl()->getLinkTarget($this, 'confirmReset'))] :
210 [];
211
212 $reset_date = new DateTimeImmutable('@' . $this->dic->settings()->get('tos_last_reset', '0'));
213
214 $this->tpl->setCurrentBlock('mess');
215 $this->legal_documents->admin()->setVariable('MESSAGE', $this->legal_documents->admin()->resetBox($reset_date, $buttons));
216 $this->tpl->parseCurrentBlock('mess');
217 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ executeCommand()

ilObjTermsOfServiceGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

Definition at line 74 of file class.ilObjTermsOfServiceGUI.php.

74 : void
75 {
76 if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
77 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
78 }
79 $this->prepareOutput();
80 $next_class = $this->ctrl->getNextClass($this) ?? '';
81 $cmd = $this->ctrl->getCmd() ?? '';
82
83 switch (strtolower($next_class)) {
84 case strtolower(ilLegalDocumentsAdministrationGUI::class):
85 switch ($cmd) {
86 case 'documents': $this->documents();
87 // no break.
88 default: $this->ctrl->forwardCommand($this->legal_documents);
89 }
90 return;
91 case strtolower(ilPermissionGUI::class):
92 $this->tabs_gui->activateTab('permissions');
93 $this->ctrl->forwardCommand(new ilPermissionGUI($this));
94 return;
95 default:
96 switch ($cmd) {
97 case 'documents':
98 $this->ctrl->redirectByClass([self::class, ilLegalDocumentsAdministrationGUI::class], 'documents');
99 return;
100 case 'confirmReset': $this->confirmReset();
101 return;
102 case 'resetNow': $this->resetNow();
103 return;
104 case 'documents':
105 $this->ctrl->redirectByClass([self::class, get_class($this->legal_documents)], 'documents');
106 return;
107 default: $this->settings();
108 return;
109 }
110 }
111 }
prepareOutput(bool $show_sub_objects=true)

References confirmReset(), ILIAS\Repository\ctrl(), documents(), error(), ILIAS\Repository\lng(), ilObject2GUI\prepareOutput(), resetNow(), and settings().

+ Here is the call graph for this function:

◆ form()

ilObjTermsOfServiceGUI::form ( )

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

131 : Form
132 {
133 $read_only = !$this->rbac_system->checkAccess('write', $this->object->getRefId());
134
135 $no_documents = $this->config->legalDocuments()->document()->repository()->countAll() === 0;
136 if ($no_documents) {
137 $this->tpl->setOnScreenMessage('info', $this->lng->txt('tos_no_documents_exist'));
138 }
139
140 $enabled = $this->dic->ui()->factory()->input()->field()->optionalGroup(
141 [
142 'reeval_on_login' => $this->dic->ui()->factory()->input()->field()->checkbox(
143 $this->ui->txt('reevaluate_on_login'),
144 $this->ui->txt('reevaluate_on_login_desc')
145 )
146 ],
147 $this->lng->txt('tos_status_enable'),
148 $this->lng->txt('tos_status_desc')
149 );
150 $enabled = $enabled->withValue($this->tos_settings->enabled()->value() ? ['reeval_on_login' => $this->tos_settings->validateOnLogin()->value()] : null);
151 $enabled = $enabled->withDisabled($read_only);
152
153 $form = $this->dic->ui()->factory()->input()->container()->form()->standard(
154 $this->ctrl->getFormAction($this, 'saveSettings'),
155 ['enabled' => $enabled]
156 );
157
158 if ($read_only) {
159 $form = $form->withSubmitLabel($this->lng->txt('refresh'));
160 return $this->legal_documents->admin()->withFormData($form, function () {
161 $this->ctrl->redirect($this, 'settings');
162 });
163 }
164
165 return $this->legal_documents->admin()->withFormData($form, function (array $data) use ($no_documents): void {
166 if ($no_documents && $data['enabled']) {
167 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('tos_no_documents_exist_cant_save'), true);
168 $this->ctrl->redirect($this, 'settings');
169 }
170 $this->tos_settings->enabled()->update(isset($data['enabled']));
171 $this->tos_settings->validateOnLogin()->update($data['enabled']['reeval_on_login'] ?? false);
172 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
173 $this->ctrl->redirect($this, 'settings');
174 });
175 }
This describes commonalities between all forms.
Definition: Form.php:33

References ilObjectGUI\$data, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilObject2GUI\update().

Referenced by settings().

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

◆ getAdminTabs()

ilObjTermsOfServiceGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 113 of file class.ilObjTermsOfServiceGUI.php.

113 : void
114 {
115 $can_edit_permissions = $this->rbac_system->checkAccess('edit_permission', $this->object->getRefId());
116
117 // Read right is already required by self::executeCommand.
118 $this->legal_documents->tabs([
119 'documents' => fn() => $this->tabs_gui->addTab('settings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this, 'settings')),
120 ]);
121
122 if ($can_edit_permissions) {
123 $this->tabs_gui->addTab(
124 'permissions',
125 $this->lng->txt('perm_settings'),
126 $this->ctrl->getLinkTargetByClass([self::class, ilPermissionGUI::class], 'perm')
127 );
128 }
129 }

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

+ Here is the call graph for this function:

◆ getType()

ilObjTermsOfServiceGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 69 of file class.ilObjTermsOfServiceGUI.php.

69 : string
70 {
71 return 'tos';
72 }

◆ resetNow()

ilObjTermsOfServiceGUI::resetNow ( )
private

Definition at line 230 of file class.ilObjTermsOfServiceGUI.php.

230 : void
231 {
232 $this->legal_documents->admin()->requireEditable();
233 $in = $this->dic->database()->in('usr_id', [ANONYMOUS_USER_ID, SYSTEM_USER_ID], true, 'integer');
234 $this->dic->database()->manipulate("UPDATE usr_data SET agree_date = NULL WHERE $in");
235 $this->tos_settings->lastResetDate()->update((new DataFactory())->clock()->system()->now());
236 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
237 $this->dic->ctrl()->redirectByClass([self::class, $this->legal_documents::class], 'documents');
238 }
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
const ANONYMOUS_USER_ID
Definition: constants.php:27

References ANONYMOUS_USER_ID, ILIAS\Repository\lng(), and SYSTEM_USER_ID.

Referenced by executeCommand().

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

◆ settings()

ilObjTermsOfServiceGUI::settings ( )
protected

Definition at line 184 of file class.ilObjTermsOfServiceGUI.php.

184 : void
185 {
186 if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
187 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
188 }
189
190 $this->tabs_gui->activateTab('settings');
191
192 $components = [];
193
194 if ($this->tos_settings->enabled()->value() && $this->config->legalDocuments()->document()->repository()->countAll() === 0) {
195 $components[] = $this->ui->create()->messageBox()->info(
196 $this->ui->txt('no_documents_exist')
197 );
198 }
199
200 $components[] = $this->legal_documents->admin()->externalSettingsMessage($this->tos_settings->deleteUserOnWithdrawal()->value());
201
202 $components[] = $this->form();
203 $this->tpl->setContent($this->dic->ui()->renderer()->render($components));
204 }
$components

References $components, error(), form(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

Referenced by executeCommand().

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

Field Documentation

◆ $config

readonly Config ilObjTermsOfServiceGUI::$config
private

Definition at line 43 of file class.ilObjTermsOfServiceGUI.php.

Referenced by __construct().

◆ $dic

ILIAS DI Container ilObjTermsOfServiceGUI::$dic
protected

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

◆ $error

ilErrorHandling ilObjTermsOfServiceGUI::$error
protected

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

◆ $legal_documents

readonly ilLegalDocumentsAdministrationGUI ilObjTermsOfServiceGUI::$legal_documents
private

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

◆ $tos_settings

readonly Settings ilObjTermsOfServiceGUI::$tos_settings
private

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

◆ $ui

readonly UI ilObjTermsOfServiceGUI::$ui
private

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


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