ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilIndividualAssessmentSettingsGUI Class Reference

ilIndividualAssessmentSettingsGUI: ilIndividualAssessmentCommonSettingsGUI More...

+ Collaboration diagram for ilIndividualAssessmentSettingsGUI:

Public Member Functions

 __construct (ilObjIndividualAssessment $object, ilCtrl $ctrl, ilGlobalPageTemplate $tpl, ilLanguage $lng, ilTabsGUI $tabs_gui, Input\Factory $factory, Refinery\Factory $refinery, UI\Renderer $ui_renderer, $http_request, ilErrorHandling $error_object, ilIndividualAssessmentCommonSettingsGUI $common_settings_gui)
 
 executeCommand ()
 
 handleAccessViolation ()
 

Data Fields

const TAB_EDIT = 'settings'
 
const TAB_EDIT_INFO = 'infoSettings'
 
const TAB_COMMON_SETTINGS = 'commonSettings'
 

Protected Member Functions

 getSubTabs (ilTabsGUI $tabs)
 
 buildForm ()
 
 edit ()
 
 update ()
 
 editInfo ()
 
 updateInfo ()
 
 buildInfoSettingsForm ()
 

Protected Attributes

 $ctrl
 
 $object
 
 $tpl
 
 $lng
 
 $tabs_gui
 
 $iass_access
 
 $input_factory
 
 $refinery
 
 $ui_renderer
 
 $http_request
 
 $error_object
 
 $common_settings_gui
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentSettingsGUI::__construct ( ilObjIndividualAssessment  $object,
ilCtrl  $ctrl,
ilGlobalPageTemplate  $tpl,
ilLanguage  $lng,
ilTabsGUI  $tabs_gui,
Input\Factory  $factory,
Refinery\Factory  $refinery,
UI\Renderer  $ui_renderer,
  $http_request,
ilErrorHandling  $error_object,
ilIndividualAssessmentCommonSettingsGUI  $common_settings_gui 
)

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

References $common_settings_gui, $ctrl, $error_object, $factory, $http_request, $lng, $object, $refinery, $tabs_gui, $tpl, $ui_renderer, and getSubTabs().

88  {
89  $this->ctrl = $ctrl;
90  $this->object = $object;
91  $this->tpl = $tpl;
92  $this->lng = $lng;
93  $this->tabs_gui = $tabs_gui;
94  $this->iass_access = $this->object->accessHandler();
95 
96  $this->input_factory = $factory;
97  $this->refinery = $refinery;
98  $this->ui_renderer = $ui_renderer;
99  $this->http_request = $http_request;
100 
101  $this->error_object = $error_object;
102  $this->common_settings_gui = $common_settings_gui;
103 
104  $this->getSubTabs($this->tabs_gui);
105  $this->lng->loadLanguageModule('content');
106  $this->lng->loadLanguageModule('obj');
107  $this->lng->loadLanguageModule('cntr');
108  }
$factory
Definition: metadata.php:58
+ Here is the call graph for this function:

Member Function Documentation

◆ buildForm()

ilIndividualAssessmentSettingsGUI::buildForm ( )
protected

Definition at line 165 of file class.ilIndividualAssessmentSettingsGUI.php.

References $lng, and $refinery.

Referenced by edit(), and update().

165  : Form\Form
166  {
167  $settings = $this->object->getSettings();
168  $field = $settings->toFormInput(
169  $this->input_factory->field(),
170  $this->lng,
172  );
173  return $this->input_factory->container()->form()->standard(
174  $this->ctrl->getFormAction($this, "update"),
175  [$field]
176  )
177  ->withAdditionalTransformation(
178  $this->refinery->custom()->transformation(function ($v) {
179  return array_shift($v);
180  })
181  );
182  }
+ Here is the caller graph for this function:

◆ buildInfoSettingsForm()

ilIndividualAssessmentSettingsGUI::buildInfoSettingsForm ( )
protected

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

References $lng, and $refinery.

Referenced by editInfo(), and updateInfo().

232  : Form\Form
233  {
234  $info_settings = $this->object->getInfoSettings();
235  $field = $info_settings->toFormInput(
236  $this->input_factory->field(),
237  $this->lng,
239  );
240  return $this->input_factory->container()->form()->standard(
241  $this->ctrl->getFormAction($this, "updateInfo"),
242  [$field]
243  )
244  ->withAdditionalTransformation(
245  $this->refinery->custom()->transformation(function ($v) {
246  return array_shift($v);
247  })
248  );
249  }
+ Here is the caller graph for this function:

◆ edit()

ilIndividualAssessmentSettingsGUI::edit ( )
protected

Definition at line 184 of file class.ilIndividualAssessmentSettingsGUI.php.

References buildForm().

Referenced by executeCommand().

185  {
186  $this->tabs_gui->setSubTabActive(self::TAB_EDIT);
187  $form = $this->buildForm();
188  $this->tpl->setContent($this->ui_renderer->render($form));
189  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editInfo()

ilIndividualAssessmentSettingsGUI::editInfo ( )
protected

Definition at line 208 of file class.ilIndividualAssessmentSettingsGUI.php.

References buildInfoSettingsForm().

Referenced by executeCommand().

209  {
210  $this->tabs_gui->setSubTabActive(self::TAB_EDIT_INFO);
211  $form = $this->buildInfoSettingsForm();
212  $this->tpl->setContent($this->ui_renderer->render($form));
213  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilIndividualAssessmentSettingsGUI::executeCommand ( )

Definition at line 135 of file class.ilIndividualAssessmentSettingsGUI.php.

References edit(), editInfo(), handleAccessViolation(), update(), and updateInfo().

136  {
137  if (!$this->iass_access->mayEditObject()) {
138  $this->handleAccessViolation();
139  }
140  $next_class = $this->ctrl->getNextClass();
141  $cmd = $this->ctrl->getCmd();
142  switch ($next_class) {
143  case 'ilindividualassessmentcommonsettingsgui':
144  $this->tabs_gui->activateSubTab(self::TAB_COMMON_SETTINGS);
145  $this->ctrl->forwardCommand($this->common_settings_gui);
146  break;
147  default:
148  switch ($cmd) {
149  case 'edit':
150  $this->edit();
151  break;
152  case 'update':
153  $this->update();
154  break;
155  case 'editInfo':
156  $this->editInfo();
157  break;
158  case 'updateInfo':
159  $this->updateInfo();
160  break;
161  }
162  }
163  }
+ Here is the call graph for this function:

◆ getSubTabs()

ilIndividualAssessmentSettingsGUI::getSubTabs ( ilTabsGUI  $tabs)
protected

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

References ilTabsGUI\addSubTab(), and ilIndividualAssessmentCommonSettingsGUI\CMD_EDIT.

Referenced by __construct().

111  {
112  $tabs->addSubTab(
113  self::TAB_EDIT,
114  $this->lng->txt("edit"),
115  $this->ctrl->getLinkTarget($this, 'edit')
116  );
117  $tabs->addSubTab(
118  self::TAB_COMMON_SETTINGS,
119  $this->lng->txt("obj_features"),
120  $this->ctrl->getLinkTargetByClass(
121  [
122  self::class,
123  ilIndividualAssessmentCommonSettingsGUI::class
124  ],
126  )
127  );
128  $tabs->addSubTab(
129  self::TAB_EDIT_INFO,
130  $this->lng->txt("iass_edit_info"),
131  $this->ctrl->getLinkTarget($this, 'editInfo')
132  );
133  }
addSubTab($a_id, $a_text, $a_link, $a_frame="")
Add a Subtab.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleAccessViolation()

ilIndividualAssessmentSettingsGUI::handleAccessViolation ( )

Definition at line 251 of file class.ilIndividualAssessmentSettingsGUI.php.

Referenced by executeCommand().

252  {
253  $this->error_object->raiseError($this->txt("msg_no_perm_read"), $this->error_object->WARNING);
254  }
+ Here is the caller graph for this function:

◆ update()

ilIndividualAssessmentSettingsGUI::update ( )
protected

Definition at line 191 of file class.ilIndividualAssessmentSettingsGUI.php.

References buildForm().

Referenced by executeCommand().

192  {
193  $form = $this->buildForm();
194  $form = $form->withRequest($this->http_request);
195 
196  $settings = $form->getData();
197 
198  if (!is_null($settings)) {
199  $this->object->setSettings($settings);
200  $this->object->update();
201  ilUtil::sendSuccess($this->lng->txt("iass_settings_saved"), true);
202  $this->ctrl->redirect($this, "edit");
203  } else {
204  $this->tpl->setContent($this->ui_renderer->render($form));
205  }
206  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateInfo()

ilIndividualAssessmentSettingsGUI::updateInfo ( )
protected

Definition at line 215 of file class.ilIndividualAssessmentSettingsGUI.php.

References buildInfoSettingsForm().

Referenced by executeCommand().

216  {
217  $form = $this->buildInfoSettingsForm();
218  $form = $form->withRequest($this->http_request);
219 
220  $info_settings = $form->getData();
221 
222  if (!is_null($info_settings)) {
223  $this->object->setInfoSettings($info_settings);
224  $this->object->updateInfo();
225  ilUtil::sendSuccess($this->lng->txt("iass_settings_saved"), true);
226  $this->ctrl->redirect($this, "editInfo");
227  } else {
228  $this->tpl->setContent($this->ui_renderer->render($form));
229  }
230  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $common_settings_gui

ilIndividualAssessmentSettingsGUI::$common_settings_gui
protected

Definition at line 74 of file class.ilIndividualAssessmentSettingsGUI.php.

Referenced by __construct().

◆ $ctrl

ilIndividualAssessmentSettingsGUI::$ctrl
protected

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

Referenced by __construct().

◆ $error_object

ilIndividualAssessmentSettingsGUI::$error_object
protected

Definition at line 72 of file class.ilIndividualAssessmentSettingsGUI.php.

Referenced by __construct().

◆ $http_request

ilIndividualAssessmentSettingsGUI::$http_request
protected

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

Referenced by __construct().

◆ $iass_access

ilIndividualAssessmentSettingsGUI::$iass_access
protected

Definition at line 47 of file class.ilIndividualAssessmentSettingsGUI.php.

◆ $input_factory

ilIndividualAssessmentSettingsGUI::$input_factory
protected

Definition at line 52 of file class.ilIndividualAssessmentSettingsGUI.php.

◆ $lng

ilIndividualAssessmentSettingsGUI::$lng
protected

◆ $object

ilIndividualAssessmentSettingsGUI::$object
protected

Definition at line 27 of file class.ilIndividualAssessmentSettingsGUI.php.

Referenced by __construct().

◆ $refinery

ilIndividualAssessmentSettingsGUI::$refinery
protected

◆ $tabs_gui

ilIndividualAssessmentSettingsGUI::$tabs_gui
protected

Definition at line 42 of file class.ilIndividualAssessmentSettingsGUI.php.

Referenced by __construct().

◆ $tpl

ilIndividualAssessmentSettingsGUI::$tpl
protected

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

Referenced by __construct().

◆ $ui_renderer

ilIndividualAssessmentSettingsGUI::$ui_renderer
protected

Definition at line 62 of file class.ilIndividualAssessmentSettingsGUI.php.

Referenced by __construct().

◆ TAB_COMMON_SETTINGS

const ilIndividualAssessmentSettingsGUI::TAB_COMMON_SETTINGS = 'commonSettings'

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

◆ TAB_EDIT

const ilIndividualAssessmentSettingsGUI::TAB_EDIT = 'settings'

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

◆ TAB_EDIT_INFO

const ilIndividualAssessmentSettingsGUI::TAB_EDIT_INFO = 'infoSettings'

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


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