ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLTIConsumeProviderSettingsGUI Class Reference
+ Collaboration diagram for ilLTIConsumeProviderSettingsGUI:

Public Member Functions

 __construct (ilObjLTIConsumer $object, ilLTIConsumerAccess $access)
 ilLTIConsumerAccess constructor. More...
 
 executeCommand ()
 Execute Command. More...
 
 initMetadata (\ilObject $object)
 

Data Fields

const CMD_SHOW_SETTINGS = 'showSettings'
 
const CMD_SAVE_SETTINGS = 'saveSettings'
 

Protected Member Functions

 showSettingsCmd (ilLTIConsumeProviderFormGUI $form=null)
 
 saveSettingsCmd ()
 
 buildForm (ilLTIConsumeProvider $provider)
 

Protected Attributes

ilObjLTIConsumer $object
 
ilLTIConsumerAccess $access
 
LOMServices $lom_services
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilLTIConsumeProviderSettingsGUI::__construct ( ilObjLTIConsumer  $object,
ilLTIConsumerAccess  $access 
)

ilLTIConsumerAccess constructor.

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

53 {
54 global $DIC;
55 $this->object = $object;
56 $this->access = $access;
57 $this->lom_services = $DIC->learningObjectMetadata();
58 }
global $DIC
Definition: shib_login.php:26

References $access, $DIC, $object, and ILIAS\Repository\access().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildForm()

ilLTIConsumeProviderSettingsGUI::buildForm ( ilLTIConsumeProvider  $provider)
protected
Exceptions
ilCtrlException

Definition at line 130 of file class.ilLTIConsumeProviderSettingsGUI.php.

131 {
132 global $DIC; /* @var \ILIAS\DI\Container $DIC */
133
135 $form->initForm(
136 $DIC->ctrl()->getFormAction($this),
137 self::CMD_SAVE_SETTINGS,
138 self::CMD_SHOW_SETTINGS
139 );
140
141 return $form;
142 }
$provider
Definition: ltitoken.php:80

References $DIC, and $provider.

Referenced by saveSettingsCmd(), and showSettingsCmd().

+ Here is the caller graph for this function:

◆ executeCommand()

ilLTIConsumeProviderSettingsGUI::executeCommand ( )

Execute Command.

Definition at line 63 of file class.ilLTIConsumeProviderSettingsGUI.php.

63 : void
64 {
65 global $DIC; /* @var \ILIAS\DI\Container $DIC */
66
67 switch ($DIC->ctrl()->getNextClass()) {
68 default:
69
70 $command = $DIC->ctrl()->getCmd(self::CMD_SHOW_SETTINGS) . 'Cmd';
71 $this->{$command}();
72 }
73 }

References $DIC.

◆ initMetadata()

ilLTIConsumeProviderSettingsGUI::initMetadata ( \ilObject  $object)
Exceptions
ilMDServicesException

Definition at line 106 of file class.ilLTIConsumeProviderSettingsGUI.php.

106 : void
107 {
108 // create LOM set from scratch
109 $this->lom_services->derive()
110 ->fromBasicProperties($object->getTitle())
111 ->forObject($object->getId(), $object->getId(), $object->getType());
112
113 // in a second step, set the keywords
114 $keywords = [];
115 foreach ($object->getProvider()->getKeywordsArray() as $keyword) {
116 if ($keyword !== '') {
117 $keywords[] = $keyword;
118 }
119 }
120 $this->lom_services->manipulate($object->getId(), $object->getId(), $object->getType())
121 ->prepareCreateOrUpdate(
122 $this->lom_services->paths()->keywords(),
123 ...$keywords
124 )->execute();
125 }

References $object, ilObject\getId(), ilObjLTIConsumer\getProvider(), ilObject\getTitle(), and ilObject\getType().

Referenced by saveSettingsCmd().

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

◆ saveSettingsCmd()

ilLTIConsumeProviderSettingsGUI::saveSettingsCmd ( )
protected

Definition at line 86 of file class.ilLTIConsumeProviderSettingsGUI.php.

86 : void
87 {
88 global $DIC; /* @var \ILIAS\DI\Container $DIC */
89
90 $provider = $this->object->getProvider();
91 $form = $this->buildForm($provider);
92 if ($form->checkInput()) {
93 $form->initProvider($provider);
94 $this->object->getProvider()->save();
95 $this->initMetadata($this->object);
96 $DIC->ctrl()->redirect($this, self::CMD_SHOW_SETTINGS);
97 }
98
99 $this->showSettingsCmd($form);
100 }
showSettingsCmd(ilLTIConsumeProviderFormGUI $form=null)

References $DIC, $provider, buildForm(), initMetadata(), and showSettingsCmd().

+ Here is the call graph for this function:

◆ showSettingsCmd()

ilLTIConsumeProviderSettingsGUI::showSettingsCmd ( ilLTIConsumeProviderFormGUI  $form = null)
protected

Definition at line 75 of file class.ilLTIConsumeProviderSettingsGUI.php.

75 : void
76 {
77 global $DIC; /* @var \ILIAS\DI\Container $DIC */
78
79 if ($form === null) {
80 $form = $this->buildForm($this->object->getProvider());
81 }
82
83 $DIC->ui()->mainTemplate()->setContent($form->getHTML());
84 }

References $DIC, buildForm(), and ILIAS\Repository\object().

Referenced by saveSettingsCmd().

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

Field Documentation

◆ $access

ilLTIConsumerAccess ilLTIConsumeProviderSettingsGUI::$access
protected

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

Referenced by __construct().

◆ $lom_services

LOMServices ilLTIConsumeProviderSettingsGUI::$lom_services
protected

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

◆ $object

ilObjLTIConsumer ilLTIConsumeProviderSettingsGUI::$object
protected

Definition at line 40 of file class.ilLTIConsumeProviderSettingsGUI.php.

Referenced by __construct(), and initMetadata().

◆ CMD_SAVE_SETTINGS

const ilLTIConsumeProviderSettingsGUI::CMD_SAVE_SETTINGS = 'saveSettings'

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

◆ CMD_SHOW_SETTINGS

const ilLTIConsumeProviderSettingsGUI::CMD_SHOW_SETTINGS = 'showSettings'

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


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