ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilStudyProgrammeTypeGUI Class Reference
+ Collaboration diagram for ilStudyProgrammeTypeGUI:

Public Member Functions

 __construct (public ilGlobalTemplateInterface $tpl, public ilCtrl $ctrl, protected ilAccess $access, protected ilToolbarGUI $toolbar, protected ilLanguage $lng, protected ILIAS $ilias, protected ilTabsGUI $tabs, protected ilObjUser $user, protected ilStudyProgrammeTypeRepository $type_repository, protected UIFactory $ui_factory, protected Renderer $renderer, DataFactory $data_factory, protected Psr\Http\Message\ServerRequestInterface $request, protected Refinery\Factory $refinery, protected RequestWrapper $request_wrapper)
 
 executeCommand ()
 
 setParentGUI ($parent_gui)
 

Protected Member Functions

 getCommandFromQueryToken (string $default)
 
 getTypeIdFromQueryToken ()
 
 getUrl (string $action, ?int $type_id=null)
 
 checkAccess ()
 
 setSubTabsEdit (string $active_tab_id)
 
 getIconForm (?string $section_title=null, ?string $current_identifier=null)
 
 editCustomIcons ()
 
 updateCustomIcons ()
 
 editAMD ()
 
 updateAMD ()
 
 listTypes ()
 
 buildForm (string $submit_action, string $type_action)
 
 add ()
 
 edit (int $type_id)
 
 create ()
 
 update ()
 
 delete ()
 
 buildModalHeading (string $title, string $default_lng)
 
 buildLanguagesForms (?ilStudyProgrammeType $type=null)
 
 getInstalledLanguages ()
 

Protected Attributes

 $parent_gui
 
array $installed_languages = null
 
Input Factory $input_factory
 
ilStudyProgrammeType $type = null
 
URLBuilder $url_builder
 
URLBuilderToken $action_token
 
URLBuilderToken $id_token
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeTypeGUI::__construct ( public ilGlobalTemplateInterface  $tpl,
public ilCtrl  $ctrl,
protected ilAccess  $access,
protected ilToolbarGUI  $toolbar,
protected ilLanguage  $lng,
protected ILIAS  $ilias,
protected ilTabsGUI  $tabs,
protected ilObjUser  $user,
protected ilStudyProgrammeTypeRepository  $type_repository,
protected UIFactory  $ui_factory,
protected Renderer  $renderer,
DataFactory  $data_factory,
protected Psr\Http\Message\ServerRequestInterface  $request,
protected Refinery\Factory  $refinery,
protected RequestWrapper  $request_wrapper 
)

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

References $action_token, $id_token, $namespace, $url_builder, ILIAS\UI\URLBuilder\acquireParameters(), and ILIAS\Repository\lng().

68  {
69  $this->lng->loadLanguageModule('prg');
70  $this->lng->loadLanguageModule('meta');
71  $this->input_factory = $ui_factory->input();
72 
73  $here_uri = $data_factory->uri($this->request->getUri()->__toString());
74  $url_builder = new URLBuilder($here_uri);
75  $namespace = ['prgtypes'];
78  $namespace,
79  "table_action",
80  "type_ids"
81  );
82 
83  $this->url_builder = $url_builder;
84  $this->action_token = $action_token;
85  $this->id_token = $id_token;
86  }
if($err=$client->getError()) $namespace
acquireParameters(array $namespace, string ... $names)
Definition: URLBuilder.php:138
URLBuilder.
Definition: URLBuilder.php:40
+ Here is the call graph for this function:

Member Function Documentation

◆ add()

ilStudyProgrammeTypeGUI::add ( )
protected

Definition at line 386 of file class.ilStudyProgrammeTypeGUI.php.

References buildForm(), getUrl(), ILIAS\Repository\lng(), and renderer().

Referenced by executeCommand().

386  : void
387  {
388  $form = $this->buildForm(
389  $this->getUrl('create'),
390  $this->lng->txt('prg_type_add')
391  );
392 
393  $this->tpl->setContent($this->renderer->render($form));
394  }
renderer()
buildForm(string $submit_action, string $type_action)
getUrl(string $action, ?int $type_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildForm()

ilStudyProgrammeTypeGUI::buildForm ( string  $submit_action,
string  $type_action 
)
protected

Definition at line 363 of file class.ilStudyProgrammeTypeGUI.php.

References buildLanguagesForms(), buildModalHeading(), ILIAS\Repository\refinery(), and ILIAS\UI\Component\Input\Input\withAdditionalTransformation().

Referenced by add(), create(), edit(), and update().

366  : Input\Container\Form\Form {
367  $default_lng = $this->type ? $this->type->getDefaultLang() : "";
368  return $this->input_factory->container()->form()->standard(
369  $submit_action,
370  [
371  "default_lang" => $this->buildModalHeading($type_action, $default_lng),
372  "info" => $this->buildLanguagesForms($this->type)
373  ]
374  )->withAdditionalTransformation(
375  $this->refinery->custom()->transformation(
376  function ($values) {
377  return [
378  'default_lang' => $values['default_lang']['default_lang'],
379  'info' => $values['info']
380  ];
381  }
382  )
383  );
384  }
buildModalHeading(string $title, string $default_lng)
buildLanguagesForms(?ilStudyProgrammeType $type=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildLanguagesForms()

ilStudyProgrammeTypeGUI::buildLanguagesForms ( ?ilStudyProgrammeType  $type = null)
protected

Definition at line 493 of file class.ilStudyProgrammeTypeGUI.php.

References $lng, ILIAS\UI\examples\Layout\Page\Standard\$refinery, ilStudyProgrammeType\getDescription(), getInstalledLanguages(), ilStudyProgrammeType\getTitle(), and null.

Referenced by buildForm().

493  : InputField
494  {
495  $return = [];
496  foreach ($this->getInstalledLanguages() as $lng_code) {
497  $title = null;
498  $description = null;
499  if (!is_null($type)) {
500  $title = $type->getTitle($lng_code);
501  $description = $type->getDescription($lng_code);
502  }
503  $lng_field = new ilStudyProgrammeTypeInfo($title, $description, $lng_code);
504  $return[] = $lng_field->toFormInput(
505  $this->input_factory->field(),
506  $this->lng,
508  );
509  }
510 
511  return $this->input_factory->field()->group($return);
512  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getTitle(string $a_lang_code='')
Get the title of an StudyProgramme type.
global $lng
Definition: privfeed.php:31
getDescription(string $lang_code='')
Get the description of an StudyProgramme type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildModalHeading()

ilStudyProgrammeTypeGUI::buildModalHeading ( string  $title,
string  $default_lng 
)
protected

Definition at line 476 of file class.ilStudyProgrammeTypeGUI.php.

References getInstalledLanguages(), ILIAS\Repository\lng(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by buildForm().

476  : InputField
477  {
478  $options = [];
479  foreach ($this->getInstalledLanguages() as $lang_code) {
480  $options[$lang_code] = $this->lng->txt("meta_l_$lang_code");
481  }
482 
483  $select = $this->input_factory->field()->select(
484  $this->lng->txt('default_language'),
485  $options,
486  ''
487  )->withValue($default_lng)
488  ->withRequired(true);
489 
490  return $this->input_factory->field()->section(['default_lang' => $select], $title);
491  }
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkAccess()

ilStudyProgrammeTypeGUI::checkAccess ( )
protected

Definition at line 189 of file class.ilStudyProgrammeTypeGUI.php.

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by executeCommand().

189  : void
190  {
191  if (!$this->access->checkAccess("read", "", $this->parent_gui->getObject()->getRefId())) {
192  $this->tpl->setOnScreenMessage("failure", $this->lng->txt("permission_denied"), true);
193  $this->ctrl->redirect($this->parent_gui);
194  }
195  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilStudyProgrammeTypeGUI::create ( )
protected

Definition at line 407 of file class.ilStudyProgrammeTypeGUI.php.

References buildForm(), ILIAS\Repository\ctrl(), getUrl(), ILIAS\Repository\lng(), and renderer().

Referenced by executeCommand().

407  : void
408  {
409  $form = $this->buildForm(
410  $this->getUrl('create'),
411  $this->lng->txt('prg_type_add')
412  )->withRequest($this->request);
413 
414  $result = $form->getData();
415  if (!is_null($result)) {
416  $type = $this->type_repository->createType($this->lng->getDefaultLanguage());
417  $this->updateTypeFromFormResult($type, $result);
418  $this->tpl->setOnScreenMessage("success", $this->lng->txt('msg_obj_modified'), true);
419  $this->ctrl->redirect($this, 'view');
420  } else {
421  $this->tpl->setOnScreenMessage("failure", $this->lng->txt("msg_fill_required"), true);
422  $this->tpl->setContent($this->renderer->render($form));
423  }
424  }
renderer()
buildForm(string $submit_action, string $type_action)
getUrl(string $action, ?int $type_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilStudyProgrammeTypeGUI::delete ( )
protected

Definition at line 462 of file class.ilStudyProgrammeTypeGUI.php.

References Vendor\Package\$e, ILIAS\Repository\ctrl(), getTypeIdFromQueryToken(), and ILIAS\Repository\lng().

462  : void
463  {
464  $type_id = $this->getTypeIdFromQueryToken();
465  try {
466  $type = $this->type_repository->getType($type_id);
467  $this->type_repository->deleteType($type);
468  $this->tpl->setOnScreenMessage("success", $this->lng->txt('prg_type_msg_deleted'), true);
469  $this->ctrl->redirect($this);
470  } catch (Exception $e) {
471  $this->tpl->setOnScreenMessage("failure", $e->getMessage(), true);
472  $this->ctrl->redirect($this);
473  }
474  }
+ Here is the call graph for this function:

◆ edit()

ilStudyProgrammeTypeGUI::edit ( int  $type_id)
protected

Definition at line 396 of file class.ilStudyProgrammeTypeGUI.php.

References buildForm(), getUrl(), ILIAS\Repository\lng(), and renderer().

Referenced by executeCommand().

396  : void
397  {
398  $this->type = $this->type_repository->getType($type_id);
399  $form = $this->buildForm(
400  $this->getUrl('update', $type_id),
401  $this->lng->txt('prg_type_edit')
402  );
403 
404  $this->tpl->setContent($this->renderer->render($form));
405  }
renderer()
buildForm(string $submit_action, string $type_action)
getUrl(string $action, ?int $type_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editAMD()

ilStudyProgrammeTypeGUI::editAMD ( )
protected

Definition at line 299 of file class.ilStudyProgrammeTypeGUI.php.

References getTypeIdFromQueryToken(), getUrl(), and ILIAS\Repository\lng().

Referenced by executeCommand().

299  : void
300  {
301  $type_id = $this->getTypeIdFromQueryToken();
302  $type = $this->type_repository->getType($type_id);
304  $this->getUrl('updateAMD', $type_id),
305  $this->type_repository,
306  $this->tpl,
307  $this->lng
308  );
309  $form->fillForm($type);
310  $this->tpl->setContent($form->getHTML());
311  }
getUrl(string $action, ?int $type_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editCustomIcons()

ilStudyProgrammeTypeGUI::editCustomIcons ( )
protected

Definition at line 265 of file class.ilStudyProgrammeTypeGUI.php.

References getIconForm(), ilStudyProgrammeType\getIconIdentifier(), ilStudyProgrammeType\getTitle(), getTypeIdFromQueryToken(), and renderer().

Referenced by executeCommand().

265  : void
266  {
267  $type = $this->type_repository->getType($this->getTypeIdFromQueryToken());
268  $form = $this->getIconForm(
269  $type->getTitle() . ': ',
271  );
272  $this->tpl->setContent($this->renderer->render($form));
273  }
renderer()
getTitle(string $a_lang_code='')
Get the title of an StudyProgramme type.
getIconForm(?string $section_title=null, ?string $current_identifier=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilStudyProgrammeTypeGUI::executeCommand ( )

Definition at line 122 of file class.ilStudyProgrammeTypeGUI.php.

References add(), checkAccess(), create(), ILIAS\Repository\ctrl(), edit(), editAMD(), editCustomIcons(), getCommandFromQueryToken(), ilStudyProgrammeType\getIconIdentifier(), getTypeIdFromQueryToken(), listTypes(), setSubTabsEdit(), update(), updateAMD(), and updateCustomIcons().

122  : void
123  {
124  $next_class = $this->ctrl->getNextClass($this);
125  switch ($next_class) {
126  case strtolower(ilStudyProgrammeTypeUploadHandlerGUI::class):
127  $type_id = $this->getTypeIdFromQueryToken();
128  $type = $this->type_repository->getType($type_id);
129  $this->ctrl->forwardCommand(
131  );
132  break;
133  }
134 
135  $this->checkAccess();
136  $cmd = $this->getCommandFromQueryToken('view');
137 
138  switch ($cmd) {
139  case 'view':
140  case 'listTypes':
141  $this->listTypes();
142  break;
143  case 'add':
144  $this->add();
145  break;
146  case 'edit':
147  $this->setSubTabsEdit('general');
148  $this->edit($this->getTypeIdFromQueryToken());
149  break;
150  case 'editCustomIcons':
151  $this->setSubTabsEdit('custom_icons');
152  $this->editCustomIcons();
153  break;
154  case 'editAMD':
155  $this->setSubTabsEdit('amd');
156  $this->editAMD();
157  break;
158  case 'updateAMD':
159  $this->setSubTabsEdit('amd');
160  $this->updateAMD();
161  break;
162  case 'updateCustomIcons':
163  $this->setSubTabsEdit('custom_icons');
164  $this->updateCustomIcons();
165  break;
166  case 'create':
167  $this->create();
168  break;
169  case 'update':
170  $this->setSubTabsEdit('general');
171  $this->update();
172  break;
173  case 'delete':
174  $this->delete();
175  break;
176  case 'cancel':
177  $this->ctrl->redirect($this->parent_gui);
178  break;
179  default:
180  throw new LogicException("Unknown command: $cmd");
181  }
182  }
ilStudyProgrammeTypeUploadHandlerGUI: ilStudyProgrammeTypeGUI
+ Here is the call graph for this function:

◆ getCommandFromQueryToken()

ilStudyProgrammeTypeGUI::getCommandFromQueryToken ( string  $default)
protected

Definition at line 89 of file class.ilStudyProgrammeTypeGUI.php.

References ILIAS\Repository\refinery().

Referenced by executeCommand().

89  : string
90  {
91  if($this->request_wrapper->has($this->action_token->getName())) {
92  return $this->request_wrapper->retrieve($this->action_token->getName(), $this->refinery->to()->string());
93  }
94  return $default;
95  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIconForm()

ilStudyProgrammeTypeGUI::getIconForm ( ?string  $section_title = null,
?string  $current_identifier = null 
)
protected

Definition at line 225 of file class.ilStudyProgrammeTypeGUI.php.

References ILIAS\Repository\ctrl(), getTypeIdFromQueryToken(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

Referenced by editCustomIcons(), and updateCustomIcons().

228  : StandardForm {
229  $handler_gui = new ilStudyProgrammeTypeUploadHandlerGUI();
230 
231  $input = $this->ui_factory->input()->field()->file(
232  $handler_gui,
233  $this->lng->txt('icon'),
234  $this->lng->txt('file_allowed_suffixes') . ' .svg'
235  );
236 
237  if($current_identifier) {
238  $input = $input->withValue([$current_identifier]);
239  }
240 
241  $section = $this->ui_factory->input()->field()->section(
242  ['iconfile' => $input],
243  $section_title . $this->lng->txt('prg_type_custom_icon'),
244  $this->lng->txt('prg_type_custom_icon_info')
245  );
246 
247  $this->ctrl->setParameter($this, $this->id_token->getName(), $this->getTypeIdFromQueryToken());
248  $this->ctrl->setParameter($this, $this->action_token->getName(), 'updateCustomIcons');
249  $form_action = $this->ctrl->getFormAction($this, 'updateCustomIcons');
250  $form = $this->ui_factory->input()->container()->form()->standard(
251  $form_action,
252  [$section]
253  );
254 
255  $form = $form->withAdditionalTransformation(
256  $this->refinery->custom()->transformation(
257  function ($values) {
258  return array_shift($values)['iconfile'];
259  }
260  )
261  );
262  return $form;
263  }
ilStudyProgrammeTypeUploadHandlerGUI: ilStudyProgrammeTypeGUI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstalledLanguages()

ilStudyProgrammeTypeGUI::getInstalledLanguages ( )
protected

Definition at line 514 of file class.ilStudyProgrammeTypeGUI.php.

References $installed_languages, and ILIAS\Repository\lng().

Referenced by buildLanguagesForms(), and buildModalHeading().

514  : array
515  {
516  if (is_null($this->installed_languages)) {
517  $this->installed_languages = $this->lng->getInstalledLanguages();
518  }
519 
521  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTypeIdFromQueryToken()

ilStudyProgrammeTypeGUI::getTypeIdFromQueryToken ( )
protected

Definition at line 97 of file class.ilStudyProgrammeTypeGUI.php.

References ILIAS\Repository\refinery().

Referenced by delete(), editAMD(), editCustomIcons(), executeCommand(), getIconForm(), setSubTabsEdit(), update(), updateAMD(), and updateCustomIcons().

97  : int
98  {
99  if($this->request_wrapper->has($this->id_token->getName())) {
100  $type_id = $this->request_wrapper->retrieve(
101  $this->id_token->getName(),
102  $this->refinery->byTrying([
103  $this->refinery->kindlyTo()->int(),
104  $this->refinery->custom()->transformation(static fn($v): int => (int)current($v)),
105  ])
106  );
107  return $type_id;
108  }
109  throw new \Exception('No type id found in query.');
110  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUrl()

ilStudyProgrammeTypeGUI::getUrl ( string  $action,
?int  $type_id = null 
)
protected

Definition at line 112 of file class.ilStudyProgrammeTypeGUI.php.

References ILIAS\UI\URLBuilder\buildURI(), and ILIAS\UI\URLBuilder\withParameter().

Referenced by add(), create(), edit(), editAMD(), listTypes(), setSubTabsEdit(), update(), updateAMD(), and updateCustomIcons().

112  : string
113  {
114  $url_builder = $this->url_builder->withParameter($this->action_token, $action);
115  if($type_id) {
116  $url_builder = $url_builder->withParameter($this->id_token, [$type_id]);
117  }
118  return $url_builder->buildURI()->__toString();
119  }
buildURI()
Get a URI representation of the full URL including query string and fragment/hash.
Definition: URLBuilder.php:212
withParameter(URLBuilderToken $token, string|array $value)
Change an acquired parameter's value if the supplied token is valid.
Definition: URLBuilder.php:166
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listTypes()

ilStudyProgrammeTypeGUI::listTypes ( )
protected

Definition at line 332 of file class.ilStudyProgrammeTypeGUI.php.

References $id_token, ILIAS\Repository\access(), getUrl(), ILIAS\Repository\lng(), renderer(), and ILIAS\Repository\toolbar().

Referenced by executeCommand().

332  : void
333  {
334  $table = $this->type_repository->getTable();
335 
336  if ($this->access->checkAccess("write", "", $this->parent_gui->getObject()->getRefId())) {
337  $link = $this->ui_factory->link()->standard(
338  $this->lng->txt('prg_subtype_add'),
339  $this->getUrl('add')
340  );
341  $this->toolbar->addComponent($link);
342 
343  $actions = [
344  'edit' => $this->ui_factory->table()->action()->single(
345  $this->lng->txt('edit'),
346  $this->url_builder->withParameter($this->action_token, "edit"),
348  ),
349  'delete' => $this->ui_factory->table()->action()->single(
350  $this->lng->txt('delete'),
351  $this->url_builder->withParameter($this->action_token, "delete"),
353  )
354  ];
355  $table = $table->withActions($actions);
356  }
357 
358  $this->tpl->setContent(
359  $this->renderer->render($table->withRequest($this->request))
360  );
361  }
renderer()
getUrl(string $action, ?int $type_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setParentGUI()

ilStudyProgrammeTypeGUI::setParentGUI (   $parent_gui)

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

References $parent_gui.

184  : void
185  {
186  $this->parent_gui = $parent_gui;
187  }

◆ setSubTabsEdit()

ilStudyProgrammeTypeGUI::setSubTabsEdit ( string  $active_tab_id)
protected

Definition at line 197 of file class.ilStudyProgrammeTypeGUI.php.

References getTypeIdFromQueryToken(), getUrl(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by executeCommand().

197  : void
198  {
199  $type_id = $this->getTypeIdFromQueryToken();
200  $this->tabs->addSubTab(
201  'general',
202  $this->lng->txt('meta_general'),
203  $this->getUrl('edit', $type_id)
204  );
205 
206  if ($this->ilias->getSetting('custom_icons')) {
207  $this->tabs->addSubTab(
208  'custom_icons',
209  $this->lng->txt('icon_settings'),
210  $this->getUrl('editCustomIcons', $type_id)
211  );
212  }
213 
214  if (count($this->type_repository->getAllAMDRecordIds()) > 0) {
215  $this->tabs->addSubTab(
216  'amd',
217  $this->lng->txt('md_advanced'),
218  $this->getUrl('editAMD', $type_id)
219  );
220  }
221 
222  $this->tabs->activateSubTab($active_tab_id);
223  }
Class ilObjForumAdministration.
getUrl(string $action, ?int $type_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilStudyProgrammeTypeGUI::update ( )
protected

Definition at line 426 of file class.ilStudyProgrammeTypeGUI.php.

References buildForm(), ILIAS\Repository\ctrl(), getTypeIdFromQueryToken(), getUrl(), ILIAS\Repository\lng(), renderer(), ilStudyProgrammeType\setDefaultLang(), ilStudyProgrammeType\setDescription(), and ilStudyProgrammeType\setTitle().

Referenced by executeCommand().

426  : void
427  {
428  $type_id = $this->getTypeIdFromQueryToken();
429  $form = $this->buildForm(
430  $this->getUrl('update', $type_id),
431  $this->lng->txt('prg_type_edit')
432  )->withRequest($this->request);
433 
434  $result = $form->getData();
435  if (!is_null($result)) {
436  $type = $this->type_repository->getType($type_id);
437  $this->updateTypeFromFormResult($type, $result);
438  $this->tpl->setOnScreenMessage("success", $this->lng->txt('msg_obj_modified'), true);
439  $this->ctrl->redirect($this, 'view');
440  } else {
441  $this->tpl->setOnScreenMessage("failure", $this->lng->txt("msg_fill_required"), true);
442  $this->tpl->setContent($this->renderer->render($form));
443  }
444  }
renderer()
buildForm(string $submit_action, string $type_action)
getUrl(string $action, ?int $type_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateAMD()

ilStudyProgrammeTypeGUI::updateAMD ( )
protected

Definition at line 313 of file class.ilStudyProgrammeTypeGUI.php.

References ILIAS\Repository\ctrl(), getTypeIdFromQueryToken(), getUrl(), and ILIAS\Repository\lng().

Referenced by executeCommand().

313  : void
314  {
315  $type_id = $this->getTypeIdFromQueryToken();
316  $type = $this->type_repository->getType($type_id);
318  $this->getUrl('updateAMD', $type_id),
319  $this->type_repository,
320  $this->tpl,
321  $this->lng
322  );
323 
324  if ($form->saveObject($type)) {
325  $this->tpl->setOnScreenMessage("success", $this->lng->txt('msg_obj_modified'), true);
326  $this->ctrl->redirectToURL($this->getUrl('editAMD', $type_id));
327  } else {
328  $this->tpl->setContent($form->getHTML());
329  }
330  }
getUrl(string $action, ?int $type_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCustomIcons()

ilStudyProgrammeTypeGUI::updateCustomIcons ( )
protected

Definition at line 275 of file class.ilStudyProgrammeTypeGUI.php.

References $data, ILIAS\Repository\ctrl(), getIconForm(), ilStudyProgrammeType\getIconIdentifier(), getTypeIdFromQueryToken(), getUrl(), ILIAS\Repository\lng(), null, ilStudyProgrammeType\updateAssignedStudyProgrammesIcons(), and ilStudyProgrammeType\withIconIdentifier().

Referenced by executeCommand().

275  : void
276  {
277  $type_id = $this->getTypeIdFromQueryToken();
278  $type = $this->type_repository->getType($type_id);
279 
280  $data = $this->getIconForm()
281  ->withRequest($this->request)
282  ->getData();
283 
284  if($data) {
285  $type = $type->withIconIdentifier(current($data));
286  $this->tpl->setOnScreenMessage("success", $this->lng->txt('msg_obj_modified'), true);
287  } else {
288  if($identifier = $type->getIconIdentifier()) {
289  $this->type_repository->removeIconFromIrss($identifier);
290  }
292  $this->tpl->setOnScreenMessage("success", $this->lng->txt('icon_removed'), true);
293  }
294  $this->type_repository->updateType($type);
296  $this->ctrl->redirectToURL($this->getUrl('editCustomIcons', $type_id));
297  }
updateAssignedStudyProgrammesIcons()
Update the Icons of assigned objects.
withIconIdentifier(?string $identifier)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getUrl(string $action, ?int $type_id=null)
getIconForm(?string $section_title=null, ?string $current_identifier=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $action_token

URLBuilderToken ilStudyProgrammeTypeGUI::$action_token
protected

Definition at line 49 of file class.ilStudyProgrammeTypeGUI.php.

Referenced by __construct().

◆ $id_token

URLBuilderToken ilStudyProgrammeTypeGUI::$id_token
protected

Definition at line 50 of file class.ilStudyProgrammeTypeGUI.php.

Referenced by __construct(), and listTypes().

◆ $input_factory

Input Factory ilStudyProgrammeTypeGUI::$input_factory
protected

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

◆ $installed_languages

array ilStudyProgrammeTypeGUI::$installed_languages = null
protected

Definition at line 45 of file class.ilStudyProgrammeTypeGUI.php.

Referenced by getInstalledLanguages().

◆ $parent_gui

ilStudyProgrammeTypeGUI::$parent_gui
protected

Definition at line 44 of file class.ilStudyProgrammeTypeGUI.php.

Referenced by setParentGUI().

◆ $type

ilStudyProgrammeType ilStudyProgrammeTypeGUI::$type = null
protected

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

◆ $url_builder

URLBuilder ilStudyProgrammeTypeGUI::$url_builder
protected

Definition at line 48 of file class.ilStudyProgrammeTypeGUI.php.

Referenced by __construct().


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