ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilExtIdGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilExtIdGUI:

Public Member Functions

 __construct (ilObjectGUI $parent_gui)
 
 executeCommand ()
 
 edit ()
 
 initForm ()
 
 update ()
 

Protected Attributes

ilTabsGUI $tabs_gui
 
ilPropertyFormGUI $form
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilObjCategory $object
 
ilLanguage $lng
 
ilAccessHandler $ilAccess
 
ilObjectGUI $parent_gui
 
ilObject $parent_object
 
ilToolbarGUI $toolbar
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilExtIdGUI

Author
Oskar Truffer ot@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Martin Studer ms@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 26 of file class.ilExtIdGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExtIdGUI::__construct ( ilObjectGUI  $parent_gui)

Definition at line 39 of file class.ilExtIdGUI.php.

References $DIC, $parent_gui, ILIAS\Repository\ctrl(), ilObjectGUI\getObject(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

40  {
41  global $DIC;
42  $main_tpl = $DIC->ui()->mainTemplate();
43 
44  $this->tpl = $DIC->ui()->mainTemplate();
45  $this->ctrl = $DIC->ctrl();
46  $this->parent_gui = $parent_gui;
47  $this->parent_object = $parent_gui->getObject();
48  $this->tabs_gui = $DIC->tabs();
49  $this->toolbar = $DIC->toolbar();
50  $this->lng = $DIC->language();
51  $this->ilAccess = $DIC->access();
52  $this->lng->loadLanguageModule('user');
53  if (!$this->ilAccess->checkaccess("write", "", $this->parent_gui->getObject()->getRefId())) {
54  $main_tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
55  }
56  }
ilObjectGUI $parent_gui
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

Member Function Documentation

◆ edit()

ilExtIdGUI::edit ( )

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

References ilPropertyFormGUI\getHTML(), and initForm().

Referenced by executeCommand().

74  : void
75  {
76  $form = $this->initForm();
77  $this->tpl->setContent($form->getHTML());
78  }
ilPropertyFormGUI $form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilExtIdGUI::executeCommand ( )

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

References ILIAS\Repository\ctrl(), edit(), and update().

58  : bool
59  {
60  $cmd = $this->ctrl->getCmd();
61 
62  switch ($cmd) {
63  case 'edit':
64  $this->edit();
65  break;
66  case 'update':
67  $this->update();
68  break;
69  }
70 
71  return true;
72  }
+ Here is the call graph for this function:

◆ initForm()

ilExtIdGUI::initForm ( )

Definition at line 80 of file class.ilExtIdGUI.php.

References $form, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilFormGUI\setFormAction().

Referenced by edit(), and update().

81  {
82  $form = new ilPropertyFormGUI();
83  $input = new ilTextInputGUI($this->lng->txt("ext_id"), "ext_id");
84  $input->setValue($this->parent_object->getImportId());
85  $form->addItem($input);
86  $form->setFormAction($this->ctrl->getFormAction($this));
87  $form->addCommandButton("update", $this->lng->txt("save"));
88 
89  return $form;
90  }
ilPropertyFormGUI $form
setFormAction(string $a_formaction)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilExtIdGUI::update ( )

Definition at line 92 of file class.ilExtIdGUI.php.

References ilPropertyFormGUI\checkInput(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getHTML(), ilPropertyFormGUI\getItemByPostVar(), initForm(), ILIAS\Repository\lng(), and ilPropertyFormGUI\setValuesByPost().

Referenced by executeCommand().

92  : void
93  {
94  $form = $this->initForm();
96  if ($form->checkInput()) {
97  $this->parent_object->setImportId($form->getItemByPostVar("ext_id")->getValue());
98  $this->parent_object->update();
99  $this->tpl->setOnScreenMessage('success', $this->lng->txt("ext_id_updated"), true);
100  $this->ctrl->redirect($this, "edit");
101  } else {
102  $this->tpl->setContent($form->getHTML());
103  }
104  }
getItemByPostVar(string $a_post_var)
ilPropertyFormGUI $form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilExtIdGUI::$ctrl
protected

Definition at line 30 of file class.ilExtIdGUI.php.

◆ $form

ilPropertyFormGUI ilExtIdGUI::$form
protected

Definition at line 29 of file class.ilExtIdGUI.php.

Referenced by initForm().

◆ $ilAccess

ilAccessHandler ilExtIdGUI::$ilAccess
protected

Definition at line 34 of file class.ilExtIdGUI.php.

◆ $lng

ilLanguage ilExtIdGUI::$lng
protected

Definition at line 33 of file class.ilExtIdGUI.php.

◆ $object

ilObjCategory ilExtIdGUI::$object
protected

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

◆ $parent_gui

ilObjectGUI ilExtIdGUI::$parent_gui
protected

Definition at line 35 of file class.ilExtIdGUI.php.

Referenced by __construct().

◆ $parent_object

ilObject ilExtIdGUI::$parent_object
protected

Definition at line 36 of file class.ilExtIdGUI.php.

◆ $tabs_gui

ilTabsGUI ilExtIdGUI::$tabs_gui
protected

Definition at line 28 of file class.ilExtIdGUI.php.

◆ $toolbar

ilToolbarGUI ilExtIdGUI::$toolbar
protected

Definition at line 37 of file class.ilExtIdGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilExtIdGUI::$tpl
protected

Definition at line 31 of file class.ilExtIdGUI.php.


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