ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

public

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

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

33  {
34  global $lng,$tpl,$ilCtrl,$ilTabs;
35 
36  $this->server_id = $a_server_id;
37  $this->mid = $a_mid;
38 
39  $this->tpl = $tpl;
40  $this->lng = $lng;
41  $this->lng->loadLanguageModule('ecs');
42  $this->ctrl = $ilCtrl;
43  $this->tabs = $ilTabs;
44 
45  $this->initSettings();
46  $this->initParticipant();
47  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

Member Function Documentation

◆ abort()

ilECSParticipantSettingsGUI::abort ( )
protected

Abort editing.

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

References getCtrl().

134  {
135  $this->getCtrl()->returnToParent($this);
136  }
+ Here is the call graph for this function:

◆ executeCommand()

ilECSParticipantSettingsGUI::executeCommand ( )

Execute command.

public

Parameters

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

References getCtrl(), and setTabs().

111  {
112  $this->getCtrl()->saveParameter($this, 'server_id');
113  $this->getCtrl()->saveParameter($this, 'mid');
114 
115 
116  $next_class = $this->ctrl->getNextClass($this);
117  $cmd = $this->ctrl->getCmd('settings');
118 
119  $this->setTabs();
120  switch ($next_class) {
121  default:
122  $this->$cmd();
123  break;
124  }
125 
126 
127  return true;
128  }
+ Here is the call graph for this function:

◆ getCtrl()

ilECSParticipantSettingsGUI::getCtrl ( )
Returns
ilCtrl

Definition at line 80 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 88 of file class.ilECSParticipantSettingsGUI.php.

References $lng.

Referenced by initFormSettings(), and saveSettings().

+ Here is the caller graph for this function:

◆ getMid()

ilECSParticipantSettingsGUI::getMid ( )
Returns
int

Definition at line 62 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 97 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 53 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 71 of file class.ilECSParticipantSettingsGUI.php.

References $tpl.

Referenced by settings().

+ Here is the caller graph for this function:

◆ initFormSettings()

ilECSParticipantSettingsGUI::initFormSettings ( )
protected

Init settings form.

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

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

Referenced by saveSettings(), and settings().

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

References getMid(), and getServerId().

Referenced by __construct().

266  {
267  include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
268  $this->participant = new ilECSParticipantSetting($this->getServerId(), $this->getMid());
269  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettings()

ilECSParticipantSettingsGUI::initSettings ( )
protected

Init settings.

protected

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

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

Referenced by __construct().

257  {
258  include_once('Services/WebServices/ECS/classes/class.ilECSSetting.php');
260  }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
settings(ilPropertyFormGUI $form=null)
Settings.
+ 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 154 of file class.ilECSParticipantSettingsGUI.php.

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

155  {
156  $form = $this->initFormSettings();
157  if ($form->checkInput()) {
158  $this->getParticipant()->enableToken($form->getInput('token'));
159  $this->getParticipant()->enableDeprecatedToken($form->getInput('dtoken'));
160  $this->getParticipant()->enableExport($form->getInput('export'));
161  $this->getParticipant()->setExportTypes($form->getInput('export_types'));
162  $this->getParticipant()->enableImport($form->getInput('import'));
163  $this->getParticipant()->setImportTypes($form->getInput('import_types'));
164  $this->getParticipant()->update();
165 
166  ilUtil::sendSuccess($this->getLang()->txt('settings_saved'), true);
167  $this->getCtrl()->redirect($this, 'settings');
168  return true;
169  }
170  $form->setValuesByPost();
171  ilUtil::sendFailure($this->getLang()->txt('err_check_input'));
172  $this->settings($form);
173  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
if(isset($_POST['submit'])) $form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
settings(ilPropertyFormGUI $form=null)
Settings.
+ Here is the call graph for this function:

◆ setTabs()

ilECSParticipantSettingsGUI::setTabs ( )
protected

Set tabs.

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

Referenced by executeCommand().

243  {
244  $this->tabs->clearTargets();
245  $this->tabs->setBackTarget(
246  $this->lng->txt('back'),
247  $this->ctrl->getParentReturn($this)
248  );
249  }
+ Here is the caller graph for this function:

◆ settings()

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

Settings.

Parameters
ilPropertyFormGUI$form

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

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

Referenced by initSettings(), and saveSettings().

144  {
145  if (!$form instanceof ilPropertyFormGUI) {
146  $form = $this->initFormSettings();
147  }
148  $this->getTemplate()->setContent($form->getHTML());
149  }
This class represents a property form user interface.
+ 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: