ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjCertificateSettingsGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs ()
 Get tabs. More...
 
 settings ()
 Edit settings. More...
 
 save ()
 
- 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...
 
 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...
 
 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 ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Attributes

 $hierarchical_access
 
 $access
 
 $error
 
 $httpState
 
 $upload
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Private Attributes

 $type
 

Static Private Attributes

static $ERROR_MESSAGE
 

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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $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 inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 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...
 
 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...
 
 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...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Certificate Settings.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
$Id$

ilObjCertificateSettingsGUI: ilPermissionGUI ilObjCertificateSettingsGUI: ilAdministrationGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

Contructor.

public

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

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

64  {
65  global $DIC;
66 
67  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
68  $this->httpState = $DIC->http();
69  $this->upload = $DIC->upload();
70  $this->type = 'cert';
71  $this->lng->loadLanguageModule("certificate");
72  $this->lng->loadLanguageModule("trac");
73 
74  $this->access = $DIC['rbacsystem'];
75  $this->error = $DIC['ilErr'];
76  $this->hierarchical_access = $DIC['ilAccess'];
77  }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilObjCertificateSettingsGUI::executeCommand ( )

Execute command.

public

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

References ilObjectGUI\prepareOutput().

87  {
88  $next_class = $this->ctrl->getNextClass($this);
89  $cmd = $this->ctrl->getCmd();
90 
91  $this->prepareOutput();
92 
93  if (!$this->hierarchical_access->checkAccess('read', '', $this->object->getRefId())) {
94  $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
95  }
96 
97  switch ($next_class) {
98  case 'ilpermissiongui':
99  $this->tabs_gui->setTabActive('perm_settings');
100  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
101  $perm_gui = new ilPermissionGUI($this);
102  $this->ctrl->forwardCommand($perm_gui);
103  break;
104 
105  default:
106  if (!$cmd || $cmd == 'view') {
107  $cmd = "settings";
108  }
109 
110  $this->$cmd();
111  break;
112  }
113 
114  return true;
115  }
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()

ilObjCertificateSettingsGUI::getAdminTabs ( )

Get tabs.

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

122  {
123  if ($this->access->checkAccess("visible,read", $this->object->getRefId())) {
124  $this->tabs_gui->addTarget(
125  "settings",
126  $this->ctrl->getLinkTarget($this, "settings"),
127  array("settings", "view")
128  );
129  }
130 
131  if ($this->access->checkAccess('edit_permission', $this->object->getRefId())) {
132  $this->tabs_gui->addTarget(
133  "perm_settings",
134  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
135  array(),
136  'ilpermissiongui'
137  );
138  }
139  }

◆ save()

ilObjCertificateSettingsGUI::save ( )

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

References $_POST, $cron, and settings().

246  {
247  $form_settings = new ilSetting("certificate");
248 
249  $mode = $_POST["persistent_certificate_mode"];
250  $previousMode = $form_settings->get('persistent_certificate_mode', 'persistent_certificate_mode_cron');
251  if ($mode !== $previousMode && $mode === 'persistent_certificate_mode_instant') {
252  $cron = new ilCertificateCron();
253  $cron->init();
254  $cron->run();
255  }
256 
257  $form_settings->set("pageformat", $_POST["pageformat"]);
258  $form_settings->set("active", $_POST["active"]);
259  $form_settings->set("persistent_certificate_mode", $mode);
260 
261  ilUtil::sendSuccess($this->lng->txt("settings_saved"));
262  $this->settings();
263  }
$cron
Definition: cron.php:16
$_POST["username"]
+ Here is the call graph for this function:

◆ settings()

ilObjCertificateSettingsGUI::settings ( )

Edit settings.

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

References $_POST, $format, $result, $results, ilObjUserTracking\_enabledLearningProgress(), ilAdministrationSettingsFormHandler\addFieldsToForm(), ilAdministrationSettingsFormHandler\FORM_CERTIFICATE, ilCheckboxInputGUI\setChecked(), ilRadioOption\setInfo(), ilFormPropertyGUI\setRequired(), ilWACSignedPath\setTokenMaxLifetimeInSeconds(), ilNonEditableValueGUI\setValue(), and ilWACSignedPath\signFile().

Referenced by save().

146  {
147  $this->tabs_gui->setTabActive('settings');
148  $form_settings = new ilSetting("certificate");
149 
150  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
151  $form = new ilPropertyFormGUI();
152  $form->setFormAction($this->ctrl->getFormAction($this));
153  $form->setTitle($this->lng->txt('certificate_settings'));
154 
155  $active = new ilCheckboxInputGUI($this->lng->txt("active"), "active");
156  $active->setChecked($form_settings->get("active"));
157  $form->addItem($active);
158 
159  $info = new ilNonEditableValueGUI($this->lng->txt("info"), "info");
160  $info->setValue($this->lng->txt("certificate_usage"));
161  $form->addItem($info);
162 
163  $bgimage = new ilImageFileInputGUI($this->lng->txt("certificate_background_image"), "background");
164  $bgimage->setRequired(false);
165 
166  if (strcmp($this->ctrl->getCmd(), "save") == 0) {
167  if ($_POST["background_delete"]) {
168  $this->object->deleteBackgroundImage();
169  }
170  }
171 
172  if (
173  $this->upload->hasUploads() &&
174  $this->httpState->request()->getMethod() === 'POST' &&
175  $bgimage->checkInput()
176  ) {
177  if (!$this->upload->hasBeenProcessed()) {
178  $this->upload->process();
179  }
180 
181  if (is_array($this->upload->getResults()) && $this->upload->getResults() !== []) {
182  $results = $this->upload->getResults();
183  $file = array_pop($results);
184  if ($file->isOK()) {
185  $result = $this->object->uploadBackgroundImage($file->getPath());
186  if ($result === false) {
187  $bgimage->setAlert($this->lng->txt('certificate_error_upload_bgimage'));
188  }
189  }
190  }
191  }
192 
193  if (strlen($this->object->hasBackgroundImage())) {
194  require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
196  $bgimage->setImage(ilWACSignedPath::signFile($this->object->getDefaultBackgroundImagePathWeb()));
197  }
198  $bgimage->setInfo($this->lng->txt("default_background_info"));
199  $form->addItem($bgimage);
200  $format = new ilSelectInputGUI($this->lng->txt("certificate_page_format"), "pageformat");
201  $defaultformats = array(
202  "a4" => $this->lng->txt("certificate_a4"), // (297 mm x 210 mm)
203  "a4landscape" => $this->lng->txt("certificate_a4_landscape"), // (210 mm x 297 mm)",
204  "a5" => $this->lng->txt("certificate_a5"), // (210 mm x 148.5 mm)
205  "a5landscape" => $this->lng->txt("certificate_a5_landscape"), // (148.5 mm x 210 mm)
206  "letter" => $this->lng->txt("certificate_letter"), // (11 inch x 8.5 inch)
207  "letterlandscape" => $this->lng->txt("certificate_letter_landscape") // (11 inch x 8.5 inch)
208  );
209  $format->setOptions($defaultformats);
210  $format->setValue($form_settings->get("pageformat"));
211  $format->setInfo($this->lng->txt("certificate_page_format_info"));
212  $form->addItem($format);
213 
214  if ($this->hierarchical_access->checkAccess('write', '', $this->object->getRefId())) {
215  $form->addCommandButton('save', $this->lng->txt('save'));
216  }
217 
221  $form,
222  $this
223  );
224  }
225 
226  $persistentCertificateMode = new ilRadioGroupInputGUI($this->lng->txt('persistent_certificate_mode'), 'persistent_certificate_mode');
227  $persistentCertificateMode->setRequired(true);
228 
229  $cronJobMode = new ilRadioOption($this->lng->txt('persistent_certificate_mode_cron'), 'persistent_certificate_mode_cron');
230  $cronJobMode->setInfo($this->lng->txt('persistent_certificate_mode_cron_info'));
231 
232  $instantMode = new ilRadioOption($this->lng->txt('persistent_certificate_mode_instant'), 'persistent_certificate_mode_instant');
233  $instantMode->setInfo($this->lng->txt('persistent_certificate_mode_instant_info'));
234 
235  $persistentCertificateMode->addOption($cronJobMode);
236  $persistentCertificateMode->addOption($instantMode);
237 
238  $persistentCertificateMode->setValue($form_settings->get('persistent_certificate_mode', 'persistent_certificate_mode_cron'));
239 
240  $form->addItem($persistentCertificateMode);
241 
242  $this->tpl->setContent($form->getHTML());
243  }
This class represents an option in a radio group.
$result
This class represents a property form user interface.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Info.
static addFieldsToForm($a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
setChecked($a_checked)
Set Checked.
static _enabledLearningProgress()
check wether learing progress is enabled or not
This class represents a property in a property form.
$format
Definition: metadata.php:218
$results
static signFile($path_to_file)
This class represents an image file property in a property form.
This class represents a non editable value in a property form.
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
$_POST["username"]
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilObjCertificateSettingsGUI::$access
protected

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

◆ $error

ilObjCertificateSettingsGUI::$error
protected

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

◆ $ERROR_MESSAGE

ilObjCertificateSettingsGUI::$ERROR_MESSAGE
staticprivate

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

◆ $hierarchical_access

ilObjCertificateSettingsGUI::$hierarchical_access
protected

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

◆ $httpState

ilObjCertificateSettingsGUI::$httpState
protected

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

◆ $type

ilObjCertificateSettingsGUI::$type
private

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

◆ $upload

ilObjCertificateSettingsGUI::$upload
protected

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


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