ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 24 of file class.ilExtIdGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExtIdGUI::__construct ( ilObjectGUI  $parent_gui)

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

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

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

Member Function Documentation

◆ edit()

ilExtIdGUI::edit ( )

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

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

Referenced by executeCommand().

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

◆ executeCommand()

ilExtIdGUI::executeCommand ( )

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

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

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

◆ initForm()

ilExtIdGUI::initForm ( )

Definition at line 78 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().

79  {
80  $form = new ilPropertyFormGUI();
81  $input = new ilTextInputGUI($this->lng->txt("ext_id"), "ext_id");
82  $input->setValue($this->parent_object->getImportId());
83  $form->addItem($input);
84  $form->setFormAction($this->ctrl->getFormAction($this));
85  $form->addCommandButton("update", $this->lng->txt("save"));
86 
87  return $form;
88  }
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 90 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().

90  : void
91  {
92  $form = $this->initForm();
94  if ($form->checkInput()) {
95  $this->parent_object->setImportId($form->getItemByPostVar("ext_id")->getValue());
96  $this->parent_object->update();
97  $this->tpl->setOnScreenMessage('success', $this->lng->txt("ext_id_updated"), true);
98  $this->ctrl->redirect($this, "edit");
99  } else {
100  $this->tpl->setContent($form->getHTML());
101  }
102  }
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 28 of file class.ilExtIdGUI.php.

◆ $form

ilPropertyFormGUI ilExtIdGUI::$form
protected

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

Referenced by initForm().

◆ $ilAccess

ilAccessHandler ilExtIdGUI::$ilAccess
protected

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

◆ $lng

ilLanguage ilExtIdGUI::$lng
protected

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

◆ $object

ilObjCategory ilExtIdGUI::$object
protected

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

◆ $parent_gui

ilObjectGUI ilExtIdGUI::$parent_gui
protected

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

Referenced by __construct().

◆ $parent_object

ilObject ilExtIdGUI::$parent_object
protected

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

◆ $tabs_gui

ilTabsGUI ilExtIdGUI::$tabs_gui
protected

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

◆ $toolbar

ilToolbarGUI ilExtIdGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilExtIdGUI::$tpl
protected

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


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