ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilECSParticipantSettingsGUI Class Reference
+ Collaboration diagram for ilECSParticipantSettingsGUI:

Public Member Functions

 __construct ($a_server_id, $a_mid)
 Constructor. More...
 
 getServerId ()
 
 getMid ()
 
 getTemplate ()
 
 getCtrl ()
 
 getLang ()
 return ilLanguage More...
 
 getParticipant ()
 
 executeCommand ()
 Execute command. More...
 

Protected Member Functions

 abort ()
 Abort editing. More...
 
 settings (ilPropertyFormGUI $form=null)
 Settings. More...
 
 saveSettings ()
 Save settings. More...
 
 initFormSettings ()
 Init settings form. More...
 
 setTabs ()
 Set tabs. More...
 
 initSettings ()
 Init settings. More...
 
 initParticipant ()
 init participant More...
 

Protected Attributes

 $tpl
 
 $lng
 
 $ctrl
 
 $tabs
 

Private Attributes

 $server_id = 0
 
 $mid = 0
 
 $participant = null
 

Detailed Description

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilECSParticipantSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSParticipantSettingsGUI::__construct (   $a_server_id,
  $a_mid 
)

Constructor.

@access public

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

33 {
34 global $DIC;
35
36 $lng = $DIC['lng'];
37 $tpl = $DIC['tpl'];
38 $ilCtrl = $DIC['ilCtrl'];
39 $ilTabs = $DIC['ilTabs'];
40
41 $this->server_id = $a_server_id;
42 $this->mid = $a_mid;
43
44 $this->tpl = $tpl;
45 $this->lng = $lng;
46 $this->lng->loadLanguageModule('ecs');
47 $this->ctrl = $ilCtrl;
48 $this->tabs = $ilTabs;
49
50 $this->initSettings();
51 $this->initParticipant();
52 }
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7

References $DIC, $ilCtrl, $lng, $tpl, initParticipant(), and initSettings().

+ Here is the call graph for this function:

Member Function Documentation

◆ abort()

ilECSParticipantSettingsGUI::abort ( )
protected

Abort editing.

Definition at line 138 of file class.ilECSParticipantSettingsGUI.php.

139 {
140 $this->getCtrl()->returnToParent($this);
141 }

References getCtrl().

+ Here is the call graph for this function:

◆ executeCommand()

ilECSParticipantSettingsGUI::executeCommand ( )

Execute command.

@access public

Parameters

Definition at line 115 of file class.ilECSParticipantSettingsGUI.php.

116 {
117 $this->getCtrl()->saveParameter($this, 'server_id');
118 $this->getCtrl()->saveParameter($this, 'mid');
119
120
121 $next_class = $this->ctrl->getNextClass($this);
122 $cmd = $this->ctrl->getCmd('settings');
123
124 $this->setTabs();
125 switch ($next_class) {
126 default:
127 $this->$cmd();
128 break;
129 }
130
131
132 return true;
133 }

References getCtrl(), and setTabs().

+ Here is the call graph for this function:

◆ getCtrl()

ilECSParticipantSettingsGUI::getCtrl ( )
Returns
ilCtrl

Definition at line 85 of file class.ilECSParticipantSettingsGUI.php.

References $ctrl.

Referenced by abort(), executeCommand(), initFormSettings(), and saveSettings().

+ Here is the caller graph for this function:

◆ getLang()

ilECSParticipantSettingsGUI::getLang ( )

return ilLanguage

Definition at line 93 of file class.ilECSParticipantSettingsGUI.php.

94 {
95 return $this->lng;
96 }

References $lng.

Referenced by initFormSettings(), and saveSettings().

+ Here is the caller graph for this function:

◆ getMid()

ilECSParticipantSettingsGUI::getMid ( )
Returns
int

Definition at line 67 of file class.ilECSParticipantSettingsGUI.php.

References $mid.

Referenced by initParticipant().

+ Here is the caller graph for this function:

◆ getParticipant()

ilECSParticipantSettingsGUI::getParticipant ( )
Returns
ilECSParticipantSetting

Definition at line 102 of file class.ilECSParticipantSettingsGUI.php.

References $participant.

Referenced by initFormSettings(), and saveSettings().

+ Here is the caller graph for this function:

◆ getServerId()

ilECSParticipantSettingsGUI::getServerId ( )
Returns
int

Definition at line 58 of file class.ilECSParticipantSettingsGUI.php.

References $server_id.

Referenced by initParticipant(), and initSettings().

+ Here is the caller graph for this function:

◆ getTemplate()

ilECSParticipantSettingsGUI::getTemplate ( )
Returns
ilTemplate

Definition at line 76 of file class.ilECSParticipantSettingsGUI.php.

77 {
78 return $this->tpl;
79 }

References $tpl.

Referenced by settings().

+ Here is the caller graph for this function:

◆ initFormSettings()

ilECSParticipantSettingsGUI::initFormSettings ( )
protected

Init settings form.

Definition at line 183 of file class.ilECSParticipantSettingsGUI.php.

184 {
185 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
186 $form = new ilPropertyFormGUI();
187 $form->setFormAction($this->getCtrl()->getFormAction($this));
188 $form->setTitle($this->getLang()->txt('ecs_part_settings') . ' ' . $this->getParticipant()->getTitle());
189
190
191 $token = new ilCheckboxInputGUI($this->getLang()->txt('ecs_token_mechanism'), 'token');
192 $token->setInfo($this->getLang()->txt('ecs_token_mechanism_info'));
193 $token->setValue(1);
194 $token->setChecked($this->getParticipant()->isTokenEnabled());
195 $form->addItem($token);
196
197 $dtoken = new ilCheckboxInputGUI($this->getLang()->txt('ecs_deprecated_token'), 'dtoken');
198 $dtoken->setInfo($this->getLang()->txt('ecs_deprecated_token_info'));
199 $dtoken->setValue(1);
200 $dtoken->setChecked($this->getParticipant()->isDeprecatedTokenEnabled());
201 $form->addItem($dtoken);
202
203 // Export
204 $export = new ilCheckboxInputGUI($this->getLang()->txt('ecs_tbl_export'), 'export');
205 $export->setValue(1);
206 $export->setChecked($this->getParticipant()->isExportEnabled());
207 $form->addItem($export);
208
209 // Export types
210 $obj_types = new ilCheckboxGroupInputGUI($this->getLang()->txt('ecs_export_types'), 'export_types');
211 $obj_types->setValue($this->getParticipant()->getExportTypes());
212
213
214 include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
215 foreach (ilECSUtils::getPossibleReleaseTypes(true) as $type => $trans) {
216 $obj_types->addOption(new ilCheckboxOption($trans, $type));
217 }
218 $export->addSubItem($obj_types);
219
220
221 // Import
222 $import = new ilCheckboxInputGUI($this->getLang()->txt('ecs_tbl_import'), 'import');
223 $import->setValue(1);
224 $import->setChecked($this->getParticipant()->isImportEnabled());
225 $form->addItem($import);
226
227 // Export types
228 $imp_types = new ilCheckboxGroupInputGUI($this->getLang()->txt('ecs_import_types'), 'import_types');
229 $imp_types->setValue($this->getParticipant()->getImportTypes());
230
231
232 include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
233 foreach (ilECSUtils::getPossibleRemoteTypes(true) as $type => $trans) {
234 $imp_types->addOption(new ilCheckboxOption($trans, $type));
235 }
236 $import->addSubItem($imp_types);
237
238 $form->addCommandButton('saveSettings', $this->getLang()->txt('save'));
239 $form->addCommandButton('abort', $this->getLang()->txt('cancel'));
240 return $form;
241 }
This class represents a property in a property form.
This class represents a checkbox property in a property form.
This class represents an option in a checkbox group.
static getPossibleRemoteTypes($a_with_captions=false)
Get all possible remote object types.
static getPossibleReleaseTypes($a_with_captions=false)
Get all possible release object types.
This class represents a property form user interface.
$type
if(isset($_POST['submit'])) $form

References $form, PHPMailer\PHPMailer\$token, $type, getCtrl(), getLang(), getParticipant(), ilECSUtils\getPossibleReleaseTypes(), and ilECSUtils\getPossibleRemoteTypes().

Referenced by saveSettings(), and settings().

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

◆ initParticipant()

ilECSParticipantSettingsGUI::initParticipant ( )
protected

init participant

Definition at line 270 of file class.ilECSParticipantSettingsGUI.php.

271 {
272 include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
273 $this->participant = new ilECSParticipantSetting($this->getServerId(), $this->getMid());
274 }

References getMid(), and getServerId().

Referenced by __construct().

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

◆ initSettings()

ilECSParticipantSettingsGUI::initSettings ( )
protected

Init settings.

@access protected

Definition at line 261 of file class.ilECSParticipantSettingsGUI.php.

262 {
263 include_once('Services/WebServices/ECS/classes/class.ilECSSetting.php');
265 }
settings(ilPropertyFormGUI $form=null)
Settings.
static getInstanceByServerId($a_server_id)
Get singleton instance per server.

References ilECSSetting\getInstanceByServerId(), getServerId(), and settings().

Referenced by __construct().

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

◆ saveSettings()

ilECSParticipantSettingsGUI::saveSettings ( )
protected

Save settings.

Definition at line 159 of file class.ilECSParticipantSettingsGUI.php.

160 {
161 $form = $this->initFormSettings();
162 if ($form->checkInput()) {
163 $this->getParticipant()->enableToken($form->getInput('token'));
164 $this->getParticipant()->enableDeprecatedToken($form->getInput('dtoken'));
165 $this->getParticipant()->enableExport($form->getInput('export'));
166 $this->getParticipant()->setExportTypes($form->getInput('export_types'));
167 $this->getParticipant()->enableImport($form->getInput('import'));
168 $this->getParticipant()->setImportTypes($form->getInput('import_types'));
169 $this->getParticipant()->update();
170
171 ilUtil::sendSuccess($this->getLang()->txt('settings_saved'), true);
172 $this->getCtrl()->redirect($this, 'settings');
173 return true;
174 }
175 $form->setValuesByPost();
176 ilUtil::sendFailure($this->getLang()->txt('err_check_input'));
177 $this->settings($form);
178 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $form, getCtrl(), getLang(), getParticipant(), initFormSettings(), ilUtil\sendFailure(), and settings().

+ Here is the call graph for this function:

◆ setTabs()

ilECSParticipantSettingsGUI::setTabs ( )
protected

Set tabs.

Definition at line 247 of file class.ilECSParticipantSettingsGUI.php.

248 {
249 $this->tabs->clearTargets();
250 $this->tabs->setBackTarget(
251 $this->lng->txt('back'),
252 $this->ctrl->getParentReturn($this)
253 );
254 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ settings()

ilECSParticipantSettingsGUI::settings ( ilPropertyFormGUI  $form = null)
protected

Settings.

Parameters
ilPropertyFormGUI$form

Definition at line 148 of file class.ilECSParticipantSettingsGUI.php.

149 {
150 if (!$form instanceof ilPropertyFormGUI) {
151 $form = $this->initFormSettings();
152 }
153 $this->getTemplate()->setContent($form->getHTML());
154 }

References $form, getTemplate(), and initFormSettings().

Referenced by initSettings(), and saveSettings().

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

Field Documentation

◆ $ctrl

ilECSParticipantSettingsGUI::$ctrl
protected

Definition at line 23 of file class.ilECSParticipantSettingsGUI.php.

Referenced by getCtrl().

◆ $lng

ilECSParticipantSettingsGUI::$lng
protected

Definition at line 22 of file class.ilECSParticipantSettingsGUI.php.

Referenced by __construct(), and getLang().

◆ $mid

ilECSParticipantSettingsGUI::$mid = 0
private

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

Referenced by getMid().

◆ $participant

ilECSParticipantSettingsGUI::$participant = null
private

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

Referenced by getParticipant().

◆ $server_id

ilECSParticipantSettingsGUI::$server_id = 0
private

Definition at line 16 of file class.ilECSParticipantSettingsGUI.php.

Referenced by getServerId().

◆ $tabs

ilECSParticipantSettingsGUI::$tabs
protected

Definition at line 24 of file class.ilECSParticipantSettingsGUI.php.

◆ $tpl

ilECSParticipantSettingsGUI::$tpl
protected

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

Referenced by __construct(), and getTemplate().


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