ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ($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 ()
 

Protected Attributes

 $hierarchical_access
 
 $access
 
 $error
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

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

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->type = 'cert';
69  $this->lng->loadLanguageModule("certificate");
70  $this->lng->loadLanguageModule("trac");
71 
72  $this->access = $DIC['rbacsystem'];
73  $this->error = $DIC['ilErr'];
74  $this->hierarchical_access = $DIC['ilAccess'];
75  }
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilObjCertificateSettingsGUI::executeCommand ( )

Execute command.

public

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

References ilObjectGUI\prepareOutput().

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

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

◆ save()

ilObjCertificateSettingsGUI::save ( )

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

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

233  {
234  $form_settings = new ilSetting("certificate");
235 
236  $mode = $_POST["persistent_certificate_mode"];
237  $previousMode = $form_settings->get('persistent_certificate_mode', 'persistent_certificate_mode_cron');
238  if ($mode !== $previousMode && $mode === 'persistent_certificate_mode_instant') {
239  $cron = new ilCertificateCron();
240  $cron->init();
241  $cron->run();
242  }
243 
244  $form_settings->set("pageformat", $_POST["pageformat"]);
245  $form_settings->set("active", $_POST["active"]);
246  $form_settings->set("persistent_certificate_mode", $mode);
247 
248  ilUtil::sendSuccess($this->lng->txt("settings_saved"));
249  $this->settings();
250  }
$cron
Definition: cron.php:16
$_POST["username"]
+ Here is the call graph for this function:

◆ settings()

ilObjCertificateSettingsGUI::settings ( )

Edit settings.

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

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

Referenced by save().

144  {
145  $this->tabs_gui->setTabActive('settings');
146  $form_settings = new ilSetting("certificate");
147 
148  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
149  $form = new ilPropertyFormGUI();
150  $form->setFormAction($this->ctrl->getFormAction($this));
151  $form->setTitle($this->lng->txt('certificate_settings'));
152 
153  $active = new ilCheckboxInputGUI($this->lng->txt("active"), "active");
154  $active->setChecked($form_settings->get("active"));
155  $form->addItem($active);
156 
157  $info = new ilNonEditableValueGUI($this->lng->txt("info"), "info");
158  $info->setValue($this->lng->txt("certificate_usage"));
159  $form->addItem($info);
160 
161  $bgimage = new ilImageFileInputGUI($this->lng->txt("certificate_background_image"), "background");
162  $bgimage->setRequired(false);
163  if (count($_POST)) {
164  // handle the background upload
165  if (strlen($_FILES["background"]["tmp_name"])) {
166  if ($bgimage->checkInput()) {
167  $result = $this->object->uploadBackgroundImage($_FILES["background"]["tmp_name"]);
168  if ($result == false) {
169  $bgimage->setAlert($this->lng->txt("certificate_error_upload_bgimage"));
170  }
171  }
172  }
173  }
174  if (strlen($this->object->hasBackgroundImage())) {
175  require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
177  $bgimage->setImage(ilWACSignedPath::signFile($this->object->getDefaultBackgroundImagePathWeb()));
178  }
179  $bgimage->setInfo($this->lng->txt("default_background_info"));
180  $form->addItem($bgimage);
181  $format = new ilSelectInputGUI($this->lng->txt("certificate_page_format"), "pageformat");
182  $defaultformats = array(
183  "a4" => $this->lng->txt("certificate_a4"), // (297 mm x 210 mm)
184  "a4landscape" => $this->lng->txt("certificate_a4_landscape"), // (210 mm x 297 mm)",
185  "a5" => $this->lng->txt("certificate_a5"), // (210 mm x 148.5 mm)
186  "a5landscape" => $this->lng->txt("certificate_a5_landscape"), // (148.5 mm x 210 mm)
187  "letter" => $this->lng->txt("certificate_letter"), // (11 inch x 8.5 inch)
188  "letterlandscape" => $this->lng->txt("certificate_letter_landscape") // (11 inch x 8.5 inch)
189  );
190  $format->setOptions($defaultformats);
191  $format->setValue($form_settings->get("pageformat"));
192  $format->setInfo($this->lng->txt("certificate_page_format_info"));
193  $form->addItem($format);
194 
195  if ($this->hierarchical_access->checkAccess('write', '', $this->object->getRefId())) {
196  $form->addCommandButton('save', $this->lng->txt('save'));
197  }
198 
202  $form,
203  $this
204  );
205  }
206 
207  $persistentCertificateMode = new ilRadioGroupInputGUI($this->lng->txt('persistent_certificate_mode'), 'persistent_certificate_mode');
208  $persistentCertificateMode->setRequired(true);
209 
210  $cronJobMode = new ilRadioOption($this->lng->txt('persistent_certificate_mode_cron'), 'persistent_certificate_mode_cron');
211  $cronJobMode->setInfo($this->lng->txt('persistent_certificate_mode_cron_info'));
212 
213  $instantMode = new ilRadioOption($this->lng->txt('persistent_certificate_mode_instant'), 'persistent_certificate_mode_instant');
214  $instantMode->setInfo($this->lng->txt('persistent_certificate_mode_instant_info'));
215 
216  $persistentCertificateMode->addOption($cronJobMode);
217  $persistentCertificateMode->addOption($instantMode);
218 
219  $persistentCertificateMode->setValue($form_settings->get('persistent_certificate_mode', 'persistent_certificate_mode_cron'));
220 
221  $form->addItem($persistentCertificateMode);
222 
223  $this->tpl->setContent($form->getHTML());
224 
225  if (strcmp($this->ctrl->getCmd(), "save") == 0) {
226  if ($_POST["background_delete"]) {
227  $this->object->deleteBackgroundImage();
228  }
229  }
230  }
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
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 50 of file class.ilObjCertificateSettingsGUI.php.

◆ $error

ilObjCertificateSettingsGUI::$error
protected

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

◆ $ERROR_MESSAGE

ilObjCertificateSettingsGUI::$ERROR_MESSAGE
staticprivate

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

◆ $hierarchical_access

ilObjCertificateSettingsGUI::$hierarchical_access
protected

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

◆ $type

ilObjCertificateSettingsGUI::$type
private

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


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