ILIAS  release_8 Revision v8.24
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 25 of file class.ilExtIdGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExtIdGUI::__construct ( ilObjectGUI  $parent_gui)

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

39 {
40 global $DIC;
41 $main_tpl = $DIC->ui()->mainTemplate();
42
43 $this->tpl = $DIC->ui()->mainTemplate();
44 $this->ctrl = $DIC->ctrl();
45 $this->parent_gui = $parent_gui;
46 $this->parent_object = $parent_gui->getObject();
47 $this->tabs_gui = $DIC->tabs();
48 $this->toolbar = $DIC->toolbar();
49 $this->lng = $DIC->language();
50 $this->ilAccess = $DIC->access();
51 $this->lng->loadLanguageModule('user');
52 if (!$this->ilAccess->checkaccess("write", "", $this->parent_gui->getObject()->getRefId())) {
53 $main_tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
54 }
55 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjectGUI $parent_gui
global $DIC
Definition: feed.php:28

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

+ Here is the call graph for this function:

Member Function Documentation

◆ edit()

ilExtIdGUI::edit ( )

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

73 : void
74 {
75 $form = $this->initForm();
76 $this->tpl->setContent($form->getHTML());
77 }
ilPropertyFormGUI $form

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

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilExtIdGUI::executeCommand ( )

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

57 : bool
58 {
59 $cmd = $this->ctrl->getCmd();
60
61 switch ($cmd) {
62 case 'edit':
63 $this->edit();
64 break;
65 case 'update':
66 $this->update();
67 break;
68 }
69
70 return true;
71 }

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

+ Here is the call graph for this function:

◆ initForm()

ilExtIdGUI::initForm ( )

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

80 {
82 $input = new ilTextInputGUI($this->lng->txt("ext_id"), "ext_id");
83 $input->setValue($this->parent_object->getImportId());
84 $form->addItem($input);
85 $form->setFormAction($this->ctrl->getFormAction($this));
86 $form->addCommandButton("update", $this->lng->txt("save"));
87
88 return $form;
89 }
setFormAction(string $a_formaction)
This class represents a property form user interface.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This class represents a text property in a property form.

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

Referenced by edit(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilExtIdGUI::update ( )

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

91 : void
92 {
93 $form = $this->initForm();
95 if ($form->checkInput()) {
96 $this->parent_object->setImportId($form->getItemByPostVar("ext_id")->getValue());
97 $this->parent_object->update();
98 $this->tpl->setOnScreenMessage('success', $this->lng->txt("ext_id_updated"), true);
99 $this->ctrl->redirect($this, "edit");
100 } else {
101 $this->tpl->setContent($form->getHTML());
102 }
103 }
getItemByPostVar(string $a_post_var)

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

Referenced by executeCommand().

+ 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 29 of file class.ilExtIdGUI.php.

◆ $form

ilPropertyFormGUI ilExtIdGUI::$form
protected

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

Referenced by edit(), initForm(), and update().

◆ $ilAccess

ilAccessHandler ilExtIdGUI::$ilAccess
protected

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

◆ $lng

ilLanguage ilExtIdGUI::$lng
protected

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

◆ $object

ilObjCategory ilExtIdGUI::$object
protected

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

◆ $parent_gui

ilObjectGUI ilExtIdGUI::$parent_gui
protected

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

Referenced by __construct().

◆ $parent_object

ilObject ilExtIdGUI::$parent_object
protected

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

◆ $tabs_gui

ilTabsGUI ilExtIdGUI::$tabs_gui
protected

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

◆ $toolbar

ilToolbarGUI ilExtIdGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilExtIdGUI::$tpl
protected

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


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