ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjCertificateSettingsGUI Class Reference

Certificate Settings. More...

+ Inheritance diagram for ilObjCertificateSettingsGUI:
+ Collaboration diagram for ilObjCertificateSettingsGUI:

Public Member Functions

 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 executeCommand ()
 
 getAdminTabs ()
 
 settings ()
 
 save ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 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] don't belong to the current 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 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)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Attributes

ILIAS HTTP GlobalHttpState $httpState
 
ILIAS FileUpload FileUpload $upload
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
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
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 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...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 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 ()
 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...
 
 fillCloneTemplate (?string $tpl_name, string $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...
 
 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...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjCertificateSettingsGUI::__construct (   $data,
int  $id = 0,
bool  $call_by_reference = true,
bool  $prepare_output = true 
)

Definition at line 34 of file class.ilObjCertificateSettingsGUI.php.

References ilObjectGUI\$call_by_reference, ilObjectGUI\$data, $DIC, ilObjectGUI\$id, ilObjectGUI\$prepare_output, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), and ILIAS\Repository\upload().

35  {
36  global $DIC;
37 
39 
40  $this->httpState = $DIC->http();
41  $this->upload = $DIC->upload();
42  $this->type = 'cert';
43  $this->lng->loadLanguageModule('certificate');
44  $this->lng->loadLanguageModule('trac');
45  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilObjCertificateSettingsGUI::executeCommand ( )

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

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

47  : void
48  {
49  $next_class = $this->ctrl->getNextClass($this);
50  $cmd = $this->ctrl->getCmd();
51 
52  $this->prepareOutput();
53 
54  if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
55  $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
56  }
57 
58  switch (strtolower($next_class)) {
59  case strtolower(ilPermissionGUI::class):
60  $this->tabs_gui->setTabActive('perm_settings');
61  $perm_gui = new ilPermissionGUI($this);
62  $this->ctrl->forwardCommand($perm_gui);
63  break;
64 
65  default:
66  if (!$cmd || $cmd === 'view') {
67  $cmd = 'settings';
68  }
69 
70  $this->$cmd();
71  break;
72  }
73  }
prepareOutput(bool $show_sub_objects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjCertificateSettingsGUI::getAdminTabs ( )

Definition at line 75 of file class.ilObjCertificateSettingsGUI.php.

References ILIAS\Repository\ctrl().

75  : void
76  {
77  if ($this->rbac_system->checkAccess('visible,read', $this->object->getRefId())) {
78  $this->tabs_gui->addTarget(
79  'settings',
80  $this->ctrl->getLinkTarget($this, 'settings'),
81  ['settings', 'view']
82  );
83  }
84 
85  if ($this->rbac_system->checkAccess('edit_permission', $this->object->getRefId())) {
86  $this->tabs_gui->addTarget(
87  'perm_settings',
88  $this->ctrl->getLinkTargetByClass(ilPermissionGUI::class, 'perm'),
89  [],
90  strtolower(ilPermissionGUI::class)
91  );
92  }
93  }
+ Here is the call graph for this function:

◆ save()

ilObjCertificateSettingsGUI::save ( )

Definition at line 209 of file class.ilObjCertificateSettingsGUI.php.

References $cron, ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and settings().

209  : void
210  {
211  $form_settings = new ilSetting("certificate");
212 
213  $mode = $this->httpState->wrapper()->post()->retrieve(
214  'persistent_certificate_mode',
215  $this->refinery->kindlyTo()->string()
216  );
217  $previousMode = $form_settings->get('persistent_certificate_mode', 'persistent_certificate_mode_cron');
218  if ($mode !== $previousMode && $mode === 'persistent_certificate_mode_instant') {
219  $cron = new ilCertificateCron();
220  $cron->init();
221  $cron->run();
222  }
223 
224  $form_settings->set(
225  'pageformat',
226  $this->httpState->wrapper()->post()->retrieve('pageformat', $this->refinery->kindlyTo()->string())
227  );
228  $form_settings->set(
229  'active',
230  (string) ($this->httpState->wrapper()->post()->has('active') && $this->httpState->wrapper()->post()->retrieve(
231  'active',
232  $this->refinery->kindlyTo()->bool()
233  ))
234  );
235  $form_settings->set('persistent_certificate_mode', $mode);
236 
237  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
238  $this->settings();
239  }
$cron
Definition: cron.php:17
+ Here is the call graph for this function:

◆ settings()

ilObjCertificateSettingsGUI::settings ( )

Definition at line 95 of file class.ilObjCertificateSettingsGUI.php.

References $format, $results, ilObjUserTracking\_enabledLearningProgress(), ilAdministrationSettingsFormHandler\addFieldsToForm(), ILIAS\Repository\ctrl(), ilAdministrationSettingsFormHandler\FORM_CERTIFICATE, ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\refinery(), ilCheckboxInputGUI\setChecked(), ilRadioOption\setInfo(), ilFormPropertyGUI\setRequired(), ilWACSignedPath\setTokenMaxLifetimeInSeconds(), ilNonEditableValueGUI\setValue(), ilWACSignedPath\signFile(), and ILIAS\Repository\upload().

Referenced by save().

95  : void
96  {
97  $this->tabs_gui->setTabActive('settings');
98  $form_settings = new ilSetting('certificate');
99 
100  $form = new ilPropertyFormGUI();
101  $form->setFormAction($this->ctrl->getFormAction($this));
102  $form->setTitle($this->lng->txt('certificate_settings'));
103 
104  $active = new ilCheckboxInputGUI($this->lng->txt('active'), 'active');
105  $active->setChecked((bool) $form_settings->get('active', '0'));
106  $form->addItem($active);
107 
108  $info = new ilNonEditableValueGUI($this->lng->txt('info'), 'info');
109  $info->setValue($this->lng->txt('certificate_usage'));
110  $form->addItem($info);
111 
112  $bgimage = new ilImageFileInputGUI($this->lng->txt('certificate_background_image'), 'background');
113  $bgimage->setRequired(false);
114 
115  if (strcmp($this->ctrl->getCmd(), 'save') === 0) {
116  $backgroundDelete = $this->httpState->wrapper()->post()->has('background_delete') && $this->httpState->wrapper()->post()->retrieve(
117  'background_delete',
118  $this->refinery->kindlyTo()->bool()
119  );
120  if ($backgroundDelete) {
121  $this->object->deleteBackgroundImage();
122  }
123  }
124 
125  if (
126  $this->upload->hasUploads() &&
127  $this->httpState->request()->getMethod() === 'POST' &&
128  $bgimage->checkInput()
129  ) {
130  if (!$this->upload->hasBeenProcessed()) {
131  $this->upload->process();
132  }
133 
134  if (is_array($this->upload->getResults()) && $this->upload->getResults() !== []) {
135  $results = $this->upload->getResults();
136  $file = array_pop($results);
137  if ($file->isOK()) {
138  $result = $this->object->uploadBackgroundImage($file);
139  if ($result === false) {
140  $bgimage->setAlert($this->lng->txt('certificate_error_upload_bgimage'));
141  }
142  }
143  }
144  }
145 
146  if ($this->object->hasBackgroundImage()) {
148  $bgimage->setImage(ilWACSignedPath::signFile($this->object->getDefaultBackgroundImagePathWeb()));
149  }
150  $bgimage->setInfo($this->lng->txt('default_background_info'));
151  $form->addItem($bgimage);
152  $format = new ilSelectInputGUI($this->lng->txt('certificate_page_format'), 'pageformat');
153  $defaultformats = [
154  'a4' => $this->lng->txt('certificate_a4'), // (297 mm x 210 mm)
155  'a4landscape' => $this->lng->txt('certificate_a4_landscape'), // (210 mm x 297 mm)',
156  'a5' => $this->lng->txt('certificate_a5'), // (210 mm x 148.5 mm)
157  'a5landscape' => $this->lng->txt('certificate_a5_landscape'), // (148.5 mm x 210 mm)
158  'letter' => $this->lng->txt('certificate_letter'), // (11 inch x 8.5 inch)
159  'letterlandscape' => $this->lng->txt('certificate_letter_landscape') // (11 inch x 8.5 inch)
160  ];
161  $format->setOptions($defaultformats);
162  $format->setValue($form_settings->get("pageformat", ''));
163  $format->setInfo($this->lng->txt("certificate_page_format_info"));
164  $form->addItem($format);
165 
166  if ($this->rbac_system->checkAccess('write', $this->object->getRefId())) {
167  $form->addCommandButton('save', $this->lng->txt('save'));
168  }
169 
173  $form,
174  $this
175  );
176  }
177 
178  $persistentCertificateMode = new ilRadioGroupInputGUI(
179  $this->lng->txt('persistent_certificate_mode'),
180  'persistent_certificate_mode'
181  );
182  $persistentCertificateMode->setRequired(true);
183 
184  $cronJobMode = new ilRadioOption(
185  $this->lng->txt('persistent_certificate_mode_cron'),
186  'persistent_certificate_mode_cron'
187  );
188  $cronJobMode->setInfo($this->lng->txt('persistent_certificate_mode_cron_info'));
189 
190  $instantMode = new ilRadioOption(
191  $this->lng->txt('persistent_certificate_mode_instant'),
192  'persistent_certificate_mode_instant'
193  );
194  $instantMode->setInfo($this->lng->txt('persistent_certificate_mode_instant_info'));
195 
196  $persistentCertificateMode->addOption($cronJobMode);
197  $persistentCertificateMode->addOption($instantMode);
198 
199  $persistentCertificateMode->setValue($form_settings->get(
200  'persistent_certificate_mode',
201  'persistent_certificate_mode_cron'
202  ));
203 
204  $form->addItem($persistentCertificateMode);
205 
206  $this->tpl->setContent($form->getHTML());
207  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setInfo(string $a_info)
This class represents a checkbox property in a property form.
static setTokenMaxLifetimeInSeconds(int $token_max_lifetime_in_seconds)
This class represents a property in a property form.
$format
Definition: metadata.php:235
$results
setRequired(bool $a_required)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static addFieldsToForm(int $a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
static signFile(string $path_to_file)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $httpState

ILIAS HTTP GlobalHttpState ilObjCertificateSettingsGUI::$httpState
protected

Definition at line 31 of file class.ilObjCertificateSettingsGUI.php.

◆ $upload

ILIAS FileUpload FileUpload ilObjCertificateSettingsGUI::$upload
protected

Definition at line 32 of file class.ilObjCertificateSettingsGUI.php.


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