ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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.

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

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:25
+ 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.

References $DIC.

Referenced by saveSettingsCmd(), and showSettingsCmd().

131  {
132  global $DIC; /* @var \ILIAS\DI\Container $DIC */
133 
134  $form = new ilLTIConsumeProviderFormGUI($provider);
135  $form->initForm(
136  $DIC->ctrl()->getFormAction($this),
137  self::CMD_SAVE_SETTINGS,
138  self::CMD_SHOW_SETTINGS
139  );
140 
141  return $form;
142  }
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ executeCommand()

ilLTIConsumeProviderSettingsGUI::executeCommand ( )

Execute Command.

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

References $DIC.

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  }
global $DIC
Definition: shib_login.php:25

◆ initMetadata()

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

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

References ilObject\getId(), ilObject\getTitle(), and ilObject\getType().

Referenced by saveSettingsCmd().

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  }
+ 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.

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

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)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ showSettingsCmd()

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

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

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

Referenced by saveSettingsCmd().

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  }
global $DIC
Definition: shib_login.php:25
+ 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().

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