ILIAS  release_7 Revision v7.30-3-g800a261c036
ilCmiXapiRegistrationGUI Class Reference
+ Collaboration diagram for ilCmiXapiRegistrationGUI:

Public Member Functions

 __construct (ilObjCmiXapi $object)
 ilCmiXapiRegistrationGUI constructor. More...
 
 executeCommand ()
 

Data Fields

const CMD_SHOW_FORM = 'showForm'
 
const CMD_SAVE_FORM = 'saveForm'
 
const CMD_CANCEL = 'cancel'
 
const DEFAULT_CMD = self::CMD_SHOW_FORM
 

Protected Member Functions

 cancelCmd ()
 
 showFormCmd (ilPropertyFormGUI $form=null)
 
 saveFormCmd ()
 
 buildForm ()
 
 hasRegistration ()
 
 saveRegistration (ilPropertyFormGUI $form)
 

Protected Attributes

 $object
 
 $cmixUser
 

Detailed Description

Definition at line 15 of file class.ilCmiXapiRegistrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilCmiXapiRegistrationGUI::__construct ( ilObjCmiXapi  $object)

ilCmiXapiRegistrationGUI constructor.

Parameters
ilObjCmiXapi$object

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

38 {
39 global $DIC; /* @var \ILIAS\DI\Container $DIC */
40
41 $this->object = $object;
42
43 $this->cmixUser = new ilCmiXapiUser($object->getId(), $DIC->user()->getId(), $object->getPrivacyIdent());
44 }
global $DIC
Definition: goto.php:24

References $DIC, and $object.

Member Function Documentation

◆ buildForm()

ilCmiXapiRegistrationGUI::buildForm ( )
protected
Returns
ilPropertyFormGUI

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

97 {
98 global $DIC; /* @var \ILIAS\DI\Container $DIC */
99
100 $form = new ilPropertyFormGUI();
101
102 $form->setFormAction($DIC->ctrl()->getFormAction($this, self::CMD_SHOW_FORM));
103
104 if (!$this->hasRegistration()) {
105 $form->setTitle($DIC->language()->txt('form_create_registration'));
106 $form->addCommandButton(self::CMD_SAVE_FORM, $DIC->language()->txt('btn_create_registration'));
107 } else {
108 $form->setTitle($DIC->language()->txt('form_change_registration'));
109 $form->addCommandButton(self::CMD_SAVE_FORM, $DIC->language()->txt('btn_change_registration'));
110 }
111
112 $form->addCommandButton(self::CMD_CANCEL, $DIC->language()->txt('cancel'));
113
114 $userIdent = new ilEMailInputGUI($DIC->language()->txt('field_user_ident'), 'user_ident');
115 $userIdent->setInfo($DIC->language()->txt('field_user_ident_info'));
116 $userIdent->setRequired(true);
117 $userIdent->setValue($this->cmixUser->getUsrIdent());
118 $form->addItem($userIdent);
119
120 return $form;
121 }
This class represents a email property in a property form.
This class represents a property form user interface.

References $DIC, and hasRegistration().

Referenced by saveFormCmd(), and showFormCmd().

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

◆ cancelCmd()

ilCmiXapiRegistrationGUI::cancelCmd ( )
protected

Definition at line 57 of file class.ilCmiXapiRegistrationGUI.php.

58 {
59 global $DIC; /* @var \ILIAS\DI\Container $DIC */
60
61 $DIC->ctrl()->redirectByClass(ilObjCmiXapiGUI::class, ilObjCmiXapiGUI::CMD_INFO_SCREEN);
62 }

References $DIC, and ilObjCmiXapiGUI\CMD_INFO_SCREEN.

◆ executeCommand()

ilCmiXapiRegistrationGUI::executeCommand ( )

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

47 {
48 global $DIC; /* @var \ILIAS\DI\Container $DIC */
49
50 switch ($DIC->ctrl()->getNextClass()) {
51 default:
52 $command = $DIC->ctrl()->getCmd(self::DEFAULT_CMD) . 'Cmd';
53 $this->{$command}();
54 }
55 }

References $DIC.

◆ hasRegistration()

ilCmiXapiRegistrationGUI::hasRegistration ( )
protected

Definition at line 123 of file class.ilCmiXapiRegistrationGUI.php.

124 {
125 return strlen($this->cmixUser->getUsrIdent());
126 }

Referenced by buildForm().

+ Here is the caller graph for this function:

◆ saveFormCmd()

ilCmiXapiRegistrationGUI::saveFormCmd ( )
protected

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

76 {
77 global $DIC; /* @var \ILIAS\DI\Container $DIC */
78
79 $form = $this->buildForm();
80
81 if (!$form->checkInput()) {
82 $form->setValuesByPost();
83 $this->showFormCmd($form);
84 return;
85 }
86
87 $this->saveRegistration($form);
88
89 ilUtil::sendSuccess($DIC->language()->txt('registration_saved_successfully'), true);
90 $DIC->ctrl()->redirectByClass(ilObjCmiXapiGUI::class, ilObjCmiXapiGUI::CMD_INFO_SCREEN);
91 }
saveRegistration(ilPropertyFormGUI $form)
showFormCmd(ilPropertyFormGUI $form=null)

References $DIC, buildForm(), ilObjCmiXapiGUI\CMD_INFO_SCREEN, saveRegistration(), and showFormCmd().

+ Here is the call graph for this function:

◆ saveRegistration()

ilCmiXapiRegistrationGUI::saveRegistration ( ilPropertyFormGUI  $form)
protected

Definition at line 128 of file class.ilCmiXapiRegistrationGUI.php.

129 {
130 $this->cmixUser->setUsrIdent($form->getInput('user_ident'));
131 $this->cmixUser->save();
132 }
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.

References ilPropertyFormGUI\getInput().

Referenced by saveFormCmd().

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

◆ showFormCmd()

ilCmiXapiRegistrationGUI::showFormCmd ( ilPropertyFormGUI  $form = null)
protected

Definition at line 64 of file class.ilCmiXapiRegistrationGUI.php.

65 {
66 global $DIC; /* @var \ILIAS\DI\Container $DIC */
67
68 if ($form === null) {
69 $form = $this->buildForm();
70 }
71
72 $DIC->ui()->mainTemplate()->setContent($form->getHTML());
73 }

References $DIC, and buildForm().

Referenced by saveFormCmd().

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

Field Documentation

◆ $cmixUser

ilCmiXapiRegistrationGUI::$cmixUser
protected

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

◆ $object

ilCmiXapiRegistrationGUI::$object
protected

Definition at line 26 of file class.ilCmiXapiRegistrationGUI.php.

Referenced by __construct().

◆ CMD_CANCEL

const ilCmiXapiRegistrationGUI::CMD_CANCEL = 'cancel'

Definition at line 19 of file class.ilCmiXapiRegistrationGUI.php.

◆ CMD_SAVE_FORM

const ilCmiXapiRegistrationGUI::CMD_SAVE_FORM = 'saveForm'

Definition at line 18 of file class.ilCmiXapiRegistrationGUI.php.

◆ CMD_SHOW_FORM

const ilCmiXapiRegistrationGUI::CMD_SHOW_FORM = 'showForm'

Definition at line 17 of file class.ilCmiXapiRegistrationGUI.php.

◆ DEFAULT_CMD

const ilCmiXapiRegistrationGUI::DEFAULT_CMD = self::CMD_SHOW_FORM

Definition at line 21 of file class.ilCmiXapiRegistrationGUI.php.


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