ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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 }
Class ilAccessHandler Checks access for ILIAS objects.
ilObjectGUI $parent_gui
global $DIC
Definition: shib_login.php:26

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

72 : void
73 {
74 $form = $this->initForm();
75 $this->tpl->setContent($form->getHTML());
76 }
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 56 of file class.ilExtIdGUI.php.

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 }

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

+ Here is the call graph for this function:

◆ initForm()

ilExtIdGUI::initForm ( )

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

79 {
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 }
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 90 of file class.ilExtIdGUI.php.

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)

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

◆ $form

ilPropertyFormGUI ilExtIdGUI::$form
protected

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

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

◆ $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: