ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 134 of file class.ilECSParticipantSettingsGUI.php.

References getCtrl().

135  {
136  $this->getCtrl()->returnToParent($this);
137  }
+ 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 $cmd, 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  {
122  default:
123  $this->$cmd();
124  break;
125  }
126 
127 
128  return true;
129  }
$cmd
Definition: sahs_server.php:35
+ 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 181 of file class.ilECSParticipantSettingsGUI.php.

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

Referenced by saveSettings(), and settings().

182  {
183  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
184  $form = new ilPropertyFormGUI();
185  $form->setFormAction($this->getCtrl()->getFormAction($this));
186  $form->setTitle($this->getLang()->txt('ecs_part_settings').' '.$this->getParticipant()->getTitle());
187 
188 
189  $token = new ilCheckboxInputGUI($this->getLang()->txt('ecs_token_mechanism'),'token');
190  $token->setInfo($this->getLang()->txt('ecs_token_mechanism_info'));
191  $token->setValue(1);
192  $token->setChecked($this->getParticipant()->isTokenEnabled());
193  $form->addItem($token);
194 
195  $dtoken = new ilCheckboxInputGUI($this->getLang()->txt('ecs_deprecated_token'),'dtoken');
196  $dtoken->setInfo($this->getLang()->txt('ecs_deprecated_token_info'));
197  $dtoken->setValue(1);
198  $dtoken->setChecked($this->getParticipant()->isDeprecatedTokenEnabled());
199  $form->addItem($dtoken);
200 
201  // Export
202  $export = new ilCheckboxInputGUI($this->getLang()->txt('ecs_tbl_export'), 'export');
203  $export->setValue(1);
204  $export->setChecked($this->getParticipant()->isExportEnabled());
205  $form->addItem($export);
206 
207  // Export types
208  $obj_types = new ilCheckboxGroupInputGUI($this->getLang()->txt('ecs_export_types'), 'export_types');
209  $obj_types->setValue($this->getParticipant()->getExportTypes());
210 
211 
212  include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
213  foreach(ilECSUtils::getPossibleReleaseTypes(TRUE) as $type => $trans)
214  {
215  $obj_types->addOption(new ilCheckboxOption($trans, $type));
216  }
217  $export->addSubItem($obj_types);
218 
219 
220  // Import
221  $import = new ilCheckboxInputGUI($this->getLang()->txt('ecs_tbl_import'), 'import');
222  $import->setValue(1);
223  $import->setChecked($this->getParticipant()->isImportEnabled());
224  $form->addItem($import);
225 
226  // Export types
227  $imp_types = new ilCheckboxGroupInputGUI($this->getLang()->txt('ecs_import_types'), 'import_types');
228  $imp_types->setValue($this->getParticipant()->getImportTypes());
229 
230 
231  include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
232  foreach(ilECSUtils::getPossibleRemoteTypes(TRUE) as $type => $trans)
233  {
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  }
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.
This class represents a checkbox property in a property 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 270 of file class.ilECSParticipantSettingsGUI.php.

References getMid(), and getServerId().

Referenced by __construct().

271  {
272  include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
273  $this->participant = new ilECSParticipantSetting($this->getServerId(),$this->getMid());
274  }
+ 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 261 of file class.ilECSParticipantSettingsGUI.php.

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

Referenced by __construct().

262  {
263  include_once('Services/WebServices/ECS/classes/class.ilECSSetting.php');
265  }
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 156 of file class.ilECSParticipantSettingsGUI.php.

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

157  {
158  $form = $this->initFormSettings();
159  if($form->checkInput())
160  {
161  $this->getParticipant()->enableToken($form->getInput('token'));
162  $this->getParticipant()->enableDeprecatedToken($form->getInput('dtoken'));
163  $this->getParticipant()->enableExport($form->getInput('export'));
164  $this->getParticipant()->setExportTypes($form->getInput('export_types'));
165  $this->getParticipant()->enableImport($form->getInput('import'));
166  $this->getParticipant()->setImportTypes($form->getInput('import_types'));
167  $this->getParticipant()->update();
168 
169  ilUtil::sendSuccess($this->getLang()->txt('settings_saved'),TRUE);
170  $this->getCtrl()->redirect($this,'settings');
171  return TRUE;
172  }
173  $form->setValuesByPost();
174  ilUtil::sendFailure($this->getLang()->txt('err_check_input'));
175  $this->settings($form);
176  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 247 of file class.ilECSParticipantSettingsGUI.php.

Referenced by executeCommand().

248  {
249  $this->tabs->clearTargets();
250  $this->tabs->setBackTarget(
251  $this->lng->txt('back'),
252  $this->ctrl->getParentReturn($this)
253  );
254  }
+ Here is the caller graph for this function:

◆ settings()

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

Settings.

Parameters
ilPropertyFormGUI$form

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

References getTemplate(), and initFormSettings().

Referenced by initSettings(), and saveSettings().

145  {
146  if(!$form instanceof ilPropertyFormGUI)
147  {
148  $form = $this->initFormSettings();
149  }
150  $this->getTemplate()->setContent($form->getHTML());
151  }
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: