ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLTIConsumerAdministrationGUI Class Reference
+ Collaboration diagram for ilLTIConsumerAdministrationGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 

Data Fields

const REDIRECTION_CMD_PARAMETER = 'redirectCmd'
 
const CMD_SHOW_GLOBAL_PROVIDER = 'showGlobalProvider'
 
const CMD_APPLY_GLOBAL_PROVIDER_FILTER = 'applyGlobalProviderFilter'
 
const CMD_RESET_GLOBAL_PROVIDER_FILTER = 'resetGlobalProviderFilter'
 
const CMD_SHOW_GLOBAL_PROVIDER_FORM = 'showGlobalProviderForm'
 
const CMD_SAVE_GLOBAL_PROVIDER_FORM = 'saveGlobalProviderForm'
 
const CMD_SHOW_GLOBAL_PROVIDER_IMPORT = 'showGlobalProviderImport'
 
const CMD_SAVE_GLOBAL_PROVIDER_IMPORT = 'saveGlobalProviderImport'
 
const CMD_SHOW_USER_PROVIDER = 'showUserProvider'
 
const CMD_SHOW_USER_PROVIDER_FORM = 'showUserProviderForm'
 
const CMD_SAVE_USER_PROVIDER_FORM = 'saveUserProviderForm'
 
const CMD_ACCEPT_PROVIDER_AS_GLOBAL = 'acceptProviderAsGlobal'
 
const CMD_ACCEPT_PROVIDER_AS_GLOBAL_MULTI = 'acceptProviderAsGlobalMulti'
 
const CMD_RESET_PROVIDER_TO_USER_SCOPE = 'resetProviderToUserScope'
 
const CMD_RESET_PROVIDER_TO_USER_SCOPE_MULTI = 'resetProviderToUserScopeMulti'
 
const CMD_DELETE_GLOBAL_PROVIDER = 'deleteGlobalProvider'
 
const CMD_DELETE_GLOBAL_PROVIDER_MULTI = 'deleteGlobalProviderMulti'
 
const CMD_DELETE_USER_PROVIDER = 'deleteUserProvider'
 
const CMD_DELETE_USER_PROVIDER_MULTI = 'deleteUserProviderMulti'
 
const CMD_PERFORM_DELETE_PROVIDERS = 'performDeleteProviders'
 
const CMD_SHOW_SETTINGS = 'showSettings'
 
const CMD_SAVE_SETTINGS = 'saveSettings'
 
const CMD_ROLE_AUTOCOMPLETE = 'roleAutocomplete'
 
const CMD_SHOW_USAGES = 'showUsages'
 
const ALLOWED_FILE_EXT = ['jpg', 'jpeg', 'png', 'gif', 'ico', 'svg']
 

Protected Member Functions

 initSubTabs ()
 
 applyGlobalProviderFilterCmd ()
 
 resetGlobalProviderFilterCmd ()
 
 showGlobalProviderCmd ()
 
 showGlobalProviderFormCmd (?ilLTIConsumeProviderFormGUI $form=null)
 
 saveGlobalProviderFormCmd ()
 
 showGlobalProviderImportCmd (?ilPropertyFormGUI $form=null)
 
 saveGlobalProviderImportCmd ()
 
 buildProviderImportForm (string $saveCommand, string $cancelCommand)
 
 performProviderImport (string $providerXml)
 
 showUserProviderCmd ()
 
 showUserProviderFormCmd (?ilLTIConsumeProviderFormGUI $form=null)
 
 saveUserProviderFormCmd ()
 
 acceptProviderAsGlobalMultiCmd ()
 
 acceptProviderAsGlobalCmd ()
 
 performAcceptProvidersAsGlobal (array $providers)
 
 resetProviderToUserScopeMultiCmd ()
 
 resetProviderToUserScopeCmd ()
 
 performResetProvidersToUserScope (array $providers)
 
 deleteGlobalProviderMultiCmd ()
 
 deleteGlobalProviderCmd ()
 
 deleteUserProviderMultiCmd ()
 
 deleteUserProviderCmd ()
 
 validateProviderDeletionSelection (array $providers)
 
 confirmDeleteProviders (array $providers, string $cancelCommand)
 
 performDeleteProvidersCmd ()
 
 buildProviderTable (ilLTIConsumerAdministrationGUI $parentGui, string $parentCmd)
 
 showUsagesCmd ()
 
 buildProviderForm (ilLTIConsumeProvider $provider, string $saveCmd, string $cancelCmd)
 
 fetchProvider ()
 
 fetchProviderMulti ()
 
 showSettingsCmd (?ilPropertyFormGUI $form=null)
 
 saveSettingsCmd ()
 
 buildSettingsForm ()
 
 getProviderListForIds (array $providerIds)
 

Private Member Functions

 prepareProvider ()
 
 getInput ($key)
 
 checkIconFileExtension (string $ext)
 
 checkIconFileVirus (string $ico)
 

Private Attributes

array $_importedXmlData = []
 
ilGlobalTemplateInterface $main_tpl
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilLTIConsumerAdministrationGUI::__construct ( )

Definition at line 70 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC.

71  {
72  global $DIC;
73  $this->main_tpl = $DIC->ui()->mainTemplate(); /* @var \ILIAS\DI\Container $DIC */
74 
75  $DIC->language()->loadLanguageModule("rep");
76 
77  //$this->performProviderImport($this->xml2());
78  }
global $DIC
Definition: shib_login.php:22

Member Function Documentation

◆ acceptProviderAsGlobalCmd()

ilLTIConsumerAdministrationGUI::acceptProviderAsGlobalCmd ( )
protected
Exceptions
ilCtrlException

Definition at line 568 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, fetchProvider(), and performAcceptProvidersAsGlobal().

568  : void
569  {
570  global $DIC; /* @var \ILIAS\DI\Container $DIC */
571 
572  $provider = $this->fetchProvider();
573 
574  if ($provider->isAcceptableAsGlobal()) {
576  }
577 
578  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('lti_success_accept_as_global'), true);
579  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
580  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ acceptProviderAsGlobalMultiCmd()

ilLTIConsumerAdministrationGUI::acceptProviderAsGlobalMultiCmd ( )
protected
Exceptions
ilCtrlException

Definition at line 541 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, fetchProviderMulti(), and performAcceptProvidersAsGlobal().

541  : void
542  {
543  global $DIC; /* @var \ILIAS\DI\Container $DIC */
544 
545  $providers = $this->fetchProviderMulti();
546 
547  if (!count($providers)) {
548  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_no_provider_selected'), true);
549  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
550  }
551 
552  foreach ($providers as $provider) {
553  if (!$provider->isAcceptableAsGlobal()) {
554  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_at_least_one_not_acceptable_as_global'), true);
555  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
556  }
557  }
558 
559  $this->performAcceptProvidersAsGlobal($providers);
560 
561  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('lti_success_accept_as_global_multi'), true);
562  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
563  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ applyGlobalProviderFilterCmd()

ilLTIConsumerAdministrationGUI::applyGlobalProviderFilterCmd ( )
protected

Definition at line 127 of file class.ilLTIConsumerAdministrationGUI.php.

References buildProviderTable(), and showGlobalProviderCmd().

127  : void
128  {
129  $table = $this->buildProviderTable($this, self::CMD_SHOW_GLOBAL_PROVIDER);
130  $table->writeFilterToSession();
131  $table->resetOffset();
132  $this->showGlobalProviderCmd();
133  }
buildProviderTable(ilLTIConsumerAdministrationGUI $parentGui, string $parentCmd)
+ Here is the call graph for this function:

◆ buildProviderForm()

ilLTIConsumerAdministrationGUI::buildProviderForm ( ilLTIConsumeProvider  $provider,
string  $saveCmd,
string  $cancelCmd 
)
protected
Exceptions
ilCtrlException

Definition at line 855 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC.

Referenced by saveGlobalProviderFormCmd(), saveUserProviderFormCmd(), showGlobalProviderFormCmd(), and showUserProviderFormCmd().

856  {
857  global $DIC; /* @var \ILIAS\DI\Container $DIC */
858 
859  $form = new ilLTIConsumeProviderFormGUI($provider);
860  $form->setAdminContext(true);
861  $form->initForm($DIC->ctrl()->getFormAction($this), $saveCmd, $cancelCmd);
862 
863  return $form;
864  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ buildProviderImportForm()

ilLTIConsumerAdministrationGUI::buildProviderImportForm ( string  $saveCommand,
string  $cancelCommand 
)
protected
Exceptions
ilCtrlException

Definition at line 311 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, and ilFormPropertyGUI\setInfo().

Referenced by saveGlobalProviderImportCmd(), and showGlobalProviderImportCmd().

312  {
313  global $DIC; /* @var \ILIAS\DI\Container $DIC */
314 
315  $form = new ilPropertyFormGUI();
316 
317  $form->setTitle($DIC->language()->txt('form_import_provider'));
318 
319  $form->setFormAction($DIC->ctrl()->getFormAction($this));
320 
321  $form->addCommandButton($saveCommand, $DIC->language()->txt('import'));
322  $form->addCommandButton($cancelCommand, $DIC->language()->txt('cancel'));
323 
324  $provXmlUpload = new ilFileInputGUI($DIC->language()->txt('field_provider_xml'), 'provider_xml');
325  $provXmlUpload->setInfo($DIC->language()->txt('field_provider_xml_info'));
326  $provXmlUpload->setRequired(true);
327  $provXmlUpload->setSuffixes(['xml']);
328  $form->addItem($provXmlUpload);
329 
330  return $form;
331  }
This class represents a property form user interface.
This class represents a file property in a property form.
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildProviderTable()

ilLTIConsumerAdministrationGUI::buildProviderTable ( ilLTIConsumerAdministrationGUI  $parentGui,
string  $parentCmd 
)
protected

Definition at line 816 of file class.ilLTIConsumerAdministrationGUI.php.

Referenced by applyGlobalProviderFilterCmd(), resetGlobalProviderFilterCmd(), showGlobalProviderCmd(), and showUserProviderCmd().

817  {
818  $table = new ilLTIConsumerProviderTableGUI(
819  $parentGui,
820  $parentCmd
821  );
822 
823  $table->setFilterCommand(self::CMD_APPLY_GLOBAL_PROVIDER_FILTER);
824  $table->setResetCommand(self::CMD_RESET_GLOBAL_PROVIDER_FILTER);
825 
826  $table->setAvailabilityColumnEnabled(true);
827  $table->setProviderCreatorColumnEnabled(true);
828 
829  $table->setActionsColumnEnabled(true);
830  $table->setDetailedUsagesEnabled(true);
831 
832  return $table;
833  }
+ Here is the caller graph for this function:

◆ buildSettingsForm()

ilLTIConsumerAdministrationGUI::buildSettingsForm ( )
protected
Exceptions
ilCtrlException

Definition at line 943 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC.

Referenced by saveSettingsCmd(), and showSettingsCmd().

944  {
945  global $DIC; /* @var \ILIAS\DI\Container $DIC */
946 
947  $form = new ilPropertyFormGUI();
948 
949  $form->setFormAction($DIC->ctrl()->getFormAction($this));
950  $form->addCommandButton(self::CMD_SAVE_SETTINGS, $DIC->language()->txt('save'));
951  $form->setTitle($DIC->language()->txt('lti_global_settings_form'));
952 
953  return $form;
954  }
This class represents a property form user interface.
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ checkIconFileExtension()

ilLTIConsumerAdministrationGUI::checkIconFileExtension ( string  $ext)
private

Definition at line 441 of file class.ilLTIConsumerAdministrationGUI.php.

References $check.

Referenced by getInput().

441  : bool
442  {
443  // todo - check?
444  return false !== ($check = array_search($ext, self::ALLOWED_FILE_EXT)) ? true : false;
445  }
$check
Definition: buildRTE.php:81
+ Here is the caller graph for this function:

◆ checkIconFileVirus()

ilLTIConsumerAdministrationGUI::checkIconFileVirus ( string  $ico)
private

Definition at line 447 of file class.ilLTIConsumerAdministrationGUI.php.

References ilVirusScannerFactory\_getInstance().

Referenced by getInput().

447  : bool
448  {
450  if (!$virusScan) {
451  return false;
452  }
453  return $virusScan->scanBuffer($ico);
454  // return false === (bool)$virusScan->scanBuffer($ico) ? false : true;
455  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeleteProviders()

ilLTIConsumerAdministrationGUI::confirmDeleteProviders ( array  $providers,
string  $cancelCommand 
)
protected
Exceptions
ilCtrlException

Definition at line 764 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, and ilObject\_getIcon().

Referenced by deleteGlobalProviderCmd(), deleteGlobalProviderMultiCmd(), deleteUserProviderCmd(), and deleteUserProviderMultiCmd().

764  : void
765  {
766  global $DIC; /* @var \ILIAS\DI\Container $DIC */
767 
768  $confirmationGUI = new ilConfirmationGUI();
769 
770  $confirmationGUI->setFormAction($DIC->ctrl()->getFormAction($this));
771  $confirmationGUI->setCancel($DIC->language()->txt('cancel'), $cancelCommand);
772  $confirmationGUI->setConfirm($DIC->language()->txt('confirm'), self::CMD_PERFORM_DELETE_PROVIDERS);
773 
774  $confirmationGUI->setHeaderText($DIC->language()->txt('lti_confirm_delete_providers'));
775 
776  foreach ($providers as $provider) {
777  /* @var ilLTIConsumeProvider $provider */
778 
779  if ($provider->getProviderIcon()->exists()) {
780  $providerIcon = $provider->getProviderIcon()->getAbsoluteFilePath();
781  } else {
782  $providerIcon = ilObject::_getIcon(0, "small", "lti");
783  }
784 
785  $confirmationGUI->addItem(
786  'provider_ids[]',
787  (string) $provider->getId(),
788  htmlspecialchars($provider->getTitle()),
789  $providerIcon
790  );
791  }
792 
793  $DIC->ui()->mainTemplate()->setContent($confirmationGUI->getHTML());
794  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteGlobalProviderCmd()

ilLTIConsumerAdministrationGUI::deleteGlobalProviderCmd ( )
protected
Exceptions
ilCtrlException

Definition at line 681 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, confirmDeleteProviders(), fetchProvider(), and validateProviderDeletionSelection().

681  : void
682  {
683  global $DIC; /* @var \ILIAS\DI\Container $DIC */
684 
685  $DIC->tabs()->activateSubTab('global_provider');
686 
687  $DIC->ctrl()->setParameter($this, self::REDIRECTION_CMD_PARAMETER, self::CMD_SHOW_GLOBAL_PROVIDER);
688 
689  $provider = $this->fetchProvider();
690  $providers = [$provider->getId() => $provider];
691 
692  if (!$this->validateProviderDeletionSelection($providers)) {
693  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
694  }
695 
696  $this->confirmDeleteProviders($providers, self::CMD_SHOW_GLOBAL_PROVIDER);
697  }
confirmDeleteProviders(array $providers, string $cancelCommand)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ deleteGlobalProviderMultiCmd()

ilLTIConsumerAdministrationGUI::deleteGlobalProviderMultiCmd ( )
protected
Exceptions
ilCtrlException

Definition at line 661 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, confirmDeleteProviders(), fetchProviderMulti(), and validateProviderDeletionSelection().

661  : void
662  {
663  global $DIC; /* @var \ILIAS\DI\Container $DIC */
664 
665  $DIC->tabs()->activateSubTab('global_provider');
666 
667  $DIC->ctrl()->setParameter($this, self::REDIRECTION_CMD_PARAMETER, self::CMD_SHOW_GLOBAL_PROVIDER);
668 
669  $providers = $this->fetchProviderMulti();
670 
671  if (!$this->validateProviderDeletionSelection($providers)) {
672  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
673  }
674 
675  $this->confirmDeleteProviders($providers, self::CMD_SHOW_GLOBAL_PROVIDER);
676  }
confirmDeleteProviders(array $providers, string $cancelCommand)
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ deleteUserProviderCmd()

ilLTIConsumerAdministrationGUI::deleteUserProviderCmd ( )
protected
Exceptions
ilCtrlException

Definition at line 722 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, confirmDeleteProviders(), fetchProvider(), and validateProviderDeletionSelection().

722  : void
723  {
724  global $DIC; /* @var \ILIAS\DI\Container $DIC */
725 
726  $DIC->tabs()->activateSubTab('global_provider');
727 
728  $DIC->ctrl()->setParameter($this, self::REDIRECTION_CMD_PARAMETER, self::CMD_SHOW_USER_PROVIDER);
729 
730  $provider = $this->fetchProvider();
731  $providers = [$provider->getId() => $provider];
732 
733  if (!$this->validateProviderDeletionSelection($providers)) {
734  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
735  }
736 
737  $this->confirmDeleteProviders($providers, self::CMD_SHOW_USER_PROVIDER);
738  }
confirmDeleteProviders(array $providers, string $cancelCommand)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ deleteUserProviderMultiCmd()

ilLTIConsumerAdministrationGUI::deleteUserProviderMultiCmd ( )
protected
Exceptions
ilCtrlException

Definition at line 702 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, confirmDeleteProviders(), fetchProviderMulti(), and validateProviderDeletionSelection().

702  : void
703  {
704  global $DIC; /* @var \ILIAS\DI\Container $DIC */
705 
706  $DIC->tabs()->activateSubTab('user_provider');
707 
708  $DIC->ctrl()->setParameter($this, self::REDIRECTION_CMD_PARAMETER, self::CMD_SHOW_USER_PROVIDER);
709 
710  $providers = $this->fetchProviderMulti();
711 
712  if (!$this->validateProviderDeletionSelection($providers)) {
713  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
714  }
715 
716  $this->confirmDeleteProviders($providers, self::CMD_SHOW_USER_PROVIDER);
717  }
confirmDeleteProviders(array $providers, string $cancelCommand)
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ executeCommand()

ilLTIConsumerAdministrationGUI::executeCommand ( )

Definition at line 112 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, and initSubTabs().

112  : void
113  {
114  global $DIC; /* @var \ILIAS\DI\Container $DIC */
115 
116  $this->initSubTabs();
117 
118  switch ($DIC->ctrl()->getNextClass()) {
119  default:
120 
121  $cmd = $DIC->ctrl()->getCmd(self::CMD_SHOW_GLOBAL_PROVIDER) . 'Cmd';
122  $this->{$cmd}();
123  }
124  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ fetchProvider()

ilLTIConsumerAdministrationGUI::fetchProvider ( )
protected
Exceptions

Definition at line 869 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, and $provider.

Referenced by acceptProviderAsGlobalCmd(), deleteGlobalProviderCmd(), deleteUserProviderCmd(), resetProviderToUserScopeCmd(), saveGlobalProviderFormCmd(), and saveUserProviderFormCmd().

870  {
871  global $DIC;
872 
873  if ($DIC->http()->wrapper()->query()->has('provider_id')) {
875  (int) $DIC->http()->wrapper()->query()->retrieve('provider_id', $DIC->refinery()->kindlyTo()->int())
876  );
877  } else {
879  }
880  return $provider;
881  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ fetchProviderMulti()

ilLTIConsumerAdministrationGUI::fetchProviderMulti ( )
protected
Returns
ilLTIConsumeProvider[]
Exceptions

Definition at line 887 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $providerId, and ILIAS\Repository\int().

Referenced by acceptProviderAsGlobalMultiCmd(), deleteGlobalProviderMultiCmd(), deleteUserProviderMultiCmd(), performDeleteProvidersCmd(), and resetProviderToUserScopeMultiCmd().

887  : array
888  {
889  global $DIC;
890  $providers = [];
891 
892  if (!$DIC->http()->wrapper()->post()->has('provider_ids') ||
893  !$DIC->http()->wrapper()->post()->retrieve('provider_ids', $DIC->refinery()->kindlyTo()->listOf($DIC->refinery()->kindlyTo()->int()))
894  ) {
895  return $providers;
896  }
897  $provider_ids = $DIC->http()->wrapper()->post()->retrieve('provider_ids', $DIC->refinery()->kindlyTo()->listOf($DIC->refinery()->kindlyTo()->int()));
898 
899  foreach ($provider_ids as $providerId) {
900  $providers[(int) $providerId] = new ilLTIConsumeProvider((int) $providerId);
901  }
902 
903  return $providers;
904  }
if(empty($clientId)) $providerId
Definition: ltitoken.php:79
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInput()

ilLTIConsumerAdministrationGUI::getInput (   $key)
private
Parameters
mixed$key
Returns
string

Definition at line 391 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $response, $url, checkIconFileExtension(), checkIconFileVirus(), and null.

Referenced by prepareProvider().

391  : string
392  {
393  if (!is_bool($this->_importedXmlData[$key])) {
394  $this->_importedXmlData[$key] = trim($this->_importedXmlData[$key]);
395  }
396  return $this->_importedXmlData[$key];
397  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProviderListForIds()

ilLTIConsumerAdministrationGUI::getProviderListForIds ( array  $providerIds)
protected

Definition at line 956 of file class.ilLTIConsumerAdministrationGUI.php.

Referenced by validateProviderDeletionSelection().

957  {
958  $providerList = new ilLTIConsumeProviderList();
959  $providerList->setIdsFilter($providerIds);
960  $providerList->load();
961  $providerList->loadUsages();
962  return $providerList;
963  }
+ Here is the caller graph for this function:

◆ initSubTabs()

ilLTIConsumerAdministrationGUI::initSubTabs ( )
protected

Definition at line 80 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC.

Referenced by executeCommand().

80  : void
81  {
82  global $DIC; /* @var \ILIAS\DI\Container $DIC */
83 
84  $DIC->tabs()->clearSubTabs();
85 
86  $DIC->tabs()->addSubTab(
87  'global_provider',
88  $DIC->language()->txt('global_provider_subtab'),
89  $DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_GLOBAL_PROVIDER)
90  );
91 
92  $DIC->tabs()->addSubTab(
93  'user_provider',
94  $DIC->language()->txt('user_provider_subtab'),
95  $DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_USER_PROVIDER)
96  );
97 
98  /* currently no settings at all
99  $DIC->tabs()->addSubTab('settings',
100  $DIC->language()->txt('settings_subtab'),
101  $DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_SETTINGS)
102  );*/
103 
104  // TODO: Implement Screen showing all Objects in Reporsitory
105  $DIC->tabs()->addSubTab(
106  'usage',
107  $DIC->language()->txt('usage_subtab'),
108  $DIC->ctrl()->getLinkTarget($this, 'showUsages')
109  );
110  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ performAcceptProvidersAsGlobal()

ilLTIConsumerAdministrationGUI::performAcceptProvidersAsGlobal ( array  $providers)
protected
Parameters
ilLTIConsumeProvider[]$providers
Exceptions

Definition at line 588 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, and $provider.

Referenced by acceptProviderAsGlobalCmd(), and acceptProviderAsGlobalMultiCmd().

588  : void
589  {
590  global $DIC; /* @var \ILIAS\DI\Container $DIC */
591 
592  foreach ($providers as $provider) {
593  $provider->setIsGlobal(true);
594  $provider->setAcceptedBy($DIC->user()->getId());
595  $provider->save();
596  }
597  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ performDeleteProvidersCmd()

ilLTIConsumerAdministrationGUI::performDeleteProvidersCmd ( )
protected
Exceptions
ilCtrlException

Definition at line 799 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, fetchProviderMulti(), and validateProviderDeletionSelection().

799  : void
800  {
801  global $DIC; /* @var \ILIAS\DI\Container $DIC */
802 
803  $providers = $this->fetchProviderMulti();
804 
805  if ($this->validateProviderDeletionSelection($providers)) {
806  foreach ($providers as $provider) {
807  $provider->delete();
808  }
809 
810  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('lti_success_delete_provider'), true);
811  }
812 
813  $DIC->ctrl()->redirect($this, $DIC->http()->wrapper()->query()->retrieve(self::REDIRECTION_CMD_PARAMETER, $DIC->refinery()->kindlyTo()->string()));
814  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ performProviderImport()

ilLTIConsumerAdministrationGUI::performProviderImport ( string  $providerXml)
protected
Exceptions

TODO: parse xml and initialise provider object –> consider two kind xmls

Definition at line 338 of file class.ilLTIConsumerAdministrationGUI.php.

References null, and prepareProvider().

Referenced by saveGlobalProviderImportCmd().

339  {
340  $doc = new DOMDocument();
341  $doc->loadXML($providerXml);
342  $xPath = new DOMXPath($doc);
343  $this->_importedXmlData = [
344  'title' => $xPath->query("//*[local-name() = 'title']")->item(0)->nodeValue,
345  'description' => null !== ($desc = $xPath->query("//*[local-name() = 'description']")->item(0)->nodeValue) ? $desc : '',
346  'provider_url' => $xPath->query("//*[local-name() = 'launch_url']")->item(0)->nodeValue,
347  'provider_icon' => $xPath->query("//*[local-name() = 'icon']")->item(0)->nodeValue,
348  'launch_method' => 'newWin',
349  ];
350 
351  // DONE ?
357  return $this->prepareProvider();
358  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performResetProvidersToUserScope()

ilLTIConsumerAdministrationGUI::performResetProvidersToUserScope ( array  $providers)
protected
Parameters
ilLTIConsumeProvider[]$providers
Exceptions

Definition at line 649 of file class.ilLTIConsumerAdministrationGUI.php.

References $provider.

Referenced by resetProviderToUserScopeCmd(), and resetProviderToUserScopeMultiCmd().

649  : void
650  {
651  foreach ($providers as $provider) {
652  $provider->setIsGlobal(false);
653  $provider->setAcceptedBy(0);
654  $provider->save();
655  }
656  }
$provider
Definition: ltitoken.php:80
+ Here is the caller graph for this function:

◆ prepareProvider()

ilLTIConsumerAdministrationGUI::prepareProvider ( )
private
Exceptions

Definition at line 365 of file class.ilLTIConsumerAdministrationGUI.php.

References $provider, getInput(), and null.

Referenced by performProviderImport().

366  {
368  $provider->setTitle($this->getInput('title'));
369  $provider->setDescription($this->getInput('description'));
370  if (null !== $this->getInput('provider_url')) {
371  $provider->setProviderUrl($this->getInput('provider_url'));
372  }
373  $provider->setIsGlobal(true);
374  $provider->save();
375 
376  // PROVIDER ICON
377  $pId = $provider->getId();
378  if (null !== $pIconFileName = $this->getIconXml($this->getInput('provider_icon'), (string) $pId)) {
379  $provider->setProviderIconFilename($pIconFileName);
380  $provider->update();
381  $provider->update();
382  }
383 
384  return $provider;
385  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$provider
Definition: ltitoken.php:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetGlobalProviderFilterCmd()

ilLTIConsumerAdministrationGUI::resetGlobalProviderFilterCmd ( )
protected

Definition at line 135 of file class.ilLTIConsumerAdministrationGUI.php.

References buildProviderTable(), and showGlobalProviderCmd().

135  : void
136  {
137  $table = $this->buildProviderTable($this, self::CMD_SHOW_GLOBAL_PROVIDER);
138  $table->resetFilter();
139  $table->resetOffset();
140  $this->showGlobalProviderCmd();
141  }
buildProviderTable(ilLTIConsumerAdministrationGUI $parentGui, string $parentCmd)
+ Here is the call graph for this function:

◆ resetProviderToUserScopeCmd()

ilLTIConsumerAdministrationGUI::resetProviderToUserScopeCmd ( )
protected
Exceptions
ilCtrlException

Definition at line 629 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, fetchProvider(), and performResetProvidersToUserScope().

629  : void
630  {
631  global $DIC; /* @var \ILIAS\DI\Container $DIC */
632 
633  $provider = $this->fetchProvider();
634 
635  if ($provider->isResetableToUserDefined()) {
637  }
638 
639  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('lti_success_reset_to_usr_def'), true);
640  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
641  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ resetProviderToUserScopeMultiCmd()

ilLTIConsumerAdministrationGUI::resetProviderToUserScopeMultiCmd ( )
protected
Exceptions
ilCtrlException

Definition at line 602 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, fetchProviderMulti(), and performResetProvidersToUserScope().

602  : void
603  {
604  global $DIC; /* @var \ILIAS\DI\Container $DIC */
605 
606  $providers = $this->fetchProviderMulti();
607 
608  if (!count($providers)) {
609  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_no_provider_selected'), true);
610  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
611  }
612 
613  foreach ($providers as $provider) {
614  if (!$provider->isResetableToUserDefined()) {
615  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_at_least_one_not_resetable_to_usr_def'), true);
616  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
617  }
618  }
619 
620  $this->performResetProvidersToUserScope($providers);
621 
622  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('lti_success_reset_to_usr_def_multi'), true);
623  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
624  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ saveGlobalProviderFormCmd()

ilLTIConsumerAdministrationGUI::saveGlobalProviderFormCmd ( )
protected

Definition at line 234 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, buildProviderForm(), fetchProvider(), and showGlobalProviderFormCmd().

234  : void
235  {
236  global $DIC; /* @var \ILIAS\DI\Container $DIC */
237 
238  $provider = $this->fetchProvider();
239 
240  $form = $this->buildProviderForm(
241  $provider,
242  self::CMD_SAVE_GLOBAL_PROVIDER_FORM,
243  self::CMD_SHOW_GLOBAL_PROVIDER
244  );
245 
246  if ($form->checkInput()) {
247  $form->initProvider($provider);
248 
249  if (!$provider->getCreator()) {
250  $provider->setCreator($DIC->user()->getId());
251  }
252 
253  $provider->setIsGlobal(true);
254  $provider->save();
255 
256  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
257  }
258 
259  $this->showGlobalProviderFormCmd($form);
260  }
buildProviderForm(ilLTIConsumeProvider $provider, string $saveCmd, string $cancelCmd)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
showGlobalProviderFormCmd(?ilLTIConsumeProviderFormGUI $form=null)
+ Here is the call graph for this function:

◆ saveGlobalProviderImportCmd()

ilLTIConsumerAdministrationGUI::saveGlobalProviderImportCmd ( )
protected

Definition at line 278 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, buildProviderImportForm(), performProviderImport(), and showGlobalProviderImportCmd().

278  : void
279  {
280  global $DIC; /* @var \ILIAS\DI\Container $DIC */
281 
282  $form = $this->buildProviderImportForm(
283  self::CMD_SAVE_GLOBAL_PROVIDER_IMPORT,
284  self::CMD_SHOW_GLOBAL_PROVIDER
285  );
286 
287  if (!$form->checkInput()) {
288  $this->showGlobalProviderImportCmd($form);
289  return;
290  }
291 
292  $fileData = (array) $DIC->http()->wrapper()->post()->retrieve('provider_xml', $DIC->refinery()->kindlyTo()->listOf($DIC->refinery()->kindlyTo()->string()));
293 
294  if (!$fileData['tmp_name']) {
295  $this->showGlobalProviderImportCmd($form);
296  return;
297  }
298 
299  $providerXml = file_get_contents($fileData['tmp_name']);
300 
301  $provider = $this->performProviderImport($providerXml);
302 
303  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('provider_import_success_msg'));
304  $DIC->ctrl()->setParameter($this, 'provider_id', $provider->getId());
305  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER_FORM);
306  }
showGlobalProviderImportCmd(?ilPropertyFormGUI $form=null)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
buildProviderImportForm(string $saveCommand, string $cancelCommand)
+ Here is the call graph for this function:

◆ saveSettingsCmd()

ilLTIConsumerAdministrationGUI::saveSettingsCmd ( )
protected

Definition at line 923 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, buildSettingsForm(), and showSettingsCmd().

923  : void
924  {
925  // todo - check
926  global $DIC; /* @var \ILIAS\DI\Container $DIC */
927 
928  return; // no settings at all currently
929 
930  $form = $this->buildSettingsForm();
931 
932  if (!$form->checkInput()) {
933  $this->showSettingsCmd($form);
934  return;
935  }
936 
937  $DIC->ctrl()->redirect($this, self::CMD_SHOW_SETTINGS);
938  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ saveUserProviderFormCmd()

ilLTIConsumerAdministrationGUI::saveUserProviderFormCmd ( )
protected
Exceptions

Definition at line 515 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, buildProviderForm(), fetchProvider(), and showUserProviderFormCmd().

515  : void
516  {
517  global $DIC; /* @var \ILIAS\DI\Container $DIC */
518 
519  $provider = $this->fetchProvider();
520 
521  $form = $this->buildProviderForm(
522  $provider,
523  self::CMD_SAVE_USER_PROVIDER_FORM,
524  self::CMD_SHOW_USER_PROVIDER
525  );
526 
527  if ($form->checkInput()) {
528  $form->initProvider($provider);
529  $provider->setIsGlobal(false);
530  $provider->save();
531 
532  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
533  }
534 
535  $this->showUserProviderFormCmd($form);
536  }
showUserProviderFormCmd(?ilLTIConsumeProviderFormGUI $form=null)
buildProviderForm(ilLTIConsumeProvider $provider, string $saveCmd, string $cancelCmd)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ showGlobalProviderCmd()

ilLTIConsumerAdministrationGUI::showGlobalProviderCmd ( )
protected

Definition at line 143 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, buildProviderTable(), and ilLTIConsumeProviderList\SCOPE_GLOBAL.

Referenced by applyGlobalProviderFilterCmd(), and resetGlobalProviderFilterCmd().

143  : void
144  {
145  global $DIC; /* @var \ILIAS\DI\Container $DIC */
146 
147  $DIC->tabs()->activateSubTab('global_provider');
148 
149  $button = $DIC->ui()->factory()->button()->standard(
150  $DIC->language()->txt('lti_add_global_provider'),
151  $DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_GLOBAL_PROVIDER_FORM)
152  );
153 
154  $DIC->toolbar()->addComponent($button);
155 
156  $button = $DIC->ui()->factory()->button()->standard(
157  $DIC->language()->txt('lti_import_global_provider'),
158  $DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_GLOBAL_PROVIDER_IMPORT)
159  );
160 
161  $DIC->toolbar()->addComponent($button);
162 
163  $table = $this->buildProviderTable($this, self::CMD_SHOW_GLOBAL_PROVIDER);
164  $table->setEditProviderCmd(self::CMD_SHOW_GLOBAL_PROVIDER_FORM);
165  $table->setDeleteProviderCmd(self::CMD_DELETE_GLOBAL_PROVIDER);
166  $table->setDeleteProviderMultiCmd(self::CMD_DELETE_GLOBAL_PROVIDER_MULTI);
167  $table->setResetProviderToUserScopeCmd(self::CMD_RESET_PROVIDER_TO_USER_SCOPE);
168  $table->setResetProviderToUserScopeMultiCmd(self::CMD_RESET_PROVIDER_TO_USER_SCOPE_MULTI);
169 
170  $table->init();
171 
172  $providerList = new ilLTIConsumeProviderList();
173  $providerList->setScopeFilter(ilLTIConsumeProviderList::SCOPE_GLOBAL);
174 
175  if ($table->getFilterItemByPostVar('title')->getValue()) {
176  $providerList->setTitleFilter($table->getFilterItemByPostVar('title')->getValue());
177  }
178 
179  if ($table->getFilterItemByPostVar('category')->getValue()) {
180  $providerList->setCategoryFilter($table->getFilterItemByPostVar('category')->getValue());
181  }
182 
183  if ($table->getFilterItemByPostVar('keyword')->getValue()) {
184  $providerList->setKeywordFilter($table->getFilterItemByPostVar('keyword')->getValue());
185  }
186 
187  if ($table->getFilterItemByPostVar('outcome')->getChecked()) {
188  $providerList->setHasOutcomeFilter(true);
189  }
190 
191  if ($table->getFilterItemByPostVar('internal')->getChecked()) {
192  $providerList->setIsExternalFilter(false);
193  }
194 
195  if ($table->getFilterItemByPostVar('with_key')->getChecked()) {
196  $providerList->setIsProviderKeyCustomizableFilter(false);
197  }
198 
199  $providerList->load();
200 
201  $table->setData($providerList->getTableData());
202 
203  $DIC->ui()->mainTemplate()->setContent($table->getHTML());
204  }
buildProviderTable(ilLTIConsumerAdministrationGUI $parentGui, string $parentCmd)
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showGlobalProviderFormCmd()

ilLTIConsumerAdministrationGUI::showGlobalProviderFormCmd ( ?ilLTIConsumeProviderFormGUI  $form = null)
protected
Exceptions

Definition at line 210 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, buildProviderForm(), and null.

Referenced by saveGlobalProviderFormCmd().

210  : void
211  {
212  global $DIC; /* @var \ILIAS\DI\Container $DIC */
213 
214  $DIC->tabs()->activateSubTab('global_provider');
215 
216  if ($form === null) {
217  if ($DIC->http()->wrapper()->query()->has('provider_id')) {
218  $DIC->ctrl()->saveParameter($this, 'provider_id');
219  $provider = new ilLTIConsumeProvider((int) $DIC->http()->wrapper()->query()->retrieve('provider_id', $DIC->refinery()->kindlyTo()->int()));
220  } else {
222  }
223 
224  $form = $this->buildProviderForm(
225  $provider,
226  self::CMD_SAVE_GLOBAL_PROVIDER_FORM,
227  self::CMD_SHOW_GLOBAL_PROVIDER
228  );
229  }
230 
231  $DIC->ui()->mainTemplate()->setContent($form->getHTML());
232  }
buildProviderForm(ilLTIConsumeProvider $provider, string $saveCmd, string $cancelCmd)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showGlobalProviderImportCmd()

ilLTIConsumerAdministrationGUI::showGlobalProviderImportCmd ( ?ilPropertyFormGUI  $form = null)
protected

Definition at line 262 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, buildProviderImportForm(), and null.

Referenced by saveGlobalProviderImportCmd().

262  : void
263  {
264  global $DIC; /* @var \ILIAS\DI\Container $DIC */
265 
266  $DIC->tabs()->activateSubTab('global_provider');
267 
268  if ($form === null) {
269  $form = $this->buildProviderImportForm(
270  self::CMD_SAVE_GLOBAL_PROVIDER_IMPORT,
271  self::CMD_SHOW_GLOBAL_PROVIDER
272  );
273  }
274 
275  $DIC->ui()->mainTemplate()->setContent($form->getHTML());
276  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
buildProviderImportForm(string $saveCommand, string $cancelCommand)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSettingsCmd()

ilLTIConsumerAdministrationGUI::showSettingsCmd ( ?ilPropertyFormGUI  $form = null)
protected

Definition at line 907 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, buildSettingsForm(), and null.

Referenced by saveSettingsCmd().

907  : void
908  {
909  // todo - check
910  global $DIC; /* @var \ILIAS\DI\Container $DIC */
911 
912  return; // no settings at all currently
913 
914  $DIC->tabs()->activateSubTab('settings');
915 
916  if ($form === null) {
917  $form = $this->buildSettingsForm();
918  }
919 
920  $DIC->ui()->mainTemplate()->setContent($form->getHTML());
921  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUsagesCmd()

ilLTIConsumerAdministrationGUI::showUsagesCmd ( )
protected

Definition at line 835 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, and ilLTIConsumeProviderList\SCOPE_GLOBAL.

835  : void
836  {
837  global $DIC;
838 
839  $DIC->tabs()->activateSubTab('usage');
840 
841  $providerList = new ilLTIConsumeProviderList();
842  $providerList->setScopeFilter(ilLTIConsumeProviderList::SCOPE_GLOBAL);
843  $providerList->load();
844 
845  $table = new ilLTIConsumerProviderUsageTableGUI($this, self::CMD_SHOW_USAGES);
846  $table->setData($providerList->getTableDataUsedBy());
847  $table->init();
848 
849  $DIC->ui()->mainTemplate()->setContent($table->getHTML());
850  }
global $DIC
Definition: shib_login.php:22

◆ showUserProviderCmd()

ilLTIConsumerAdministrationGUI::showUserProviderCmd ( )
protected

Definition at line 457 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, buildProviderTable(), and ilLTIConsumeProviderList\SCOPE_USER.

457  : void
458  {
459  global $DIC; /* @var \ILIAS\DI\Container $DIC */
460 
461  $DIC->tabs()->activateSubTab('user_provider');
462 
463  $providerList = new ilLTIConsumeProviderList();
464  $providerList->setScopeFilter(ilLTIConsumeProviderList::SCOPE_USER);
465  $providerList->load();
466 
467  $table = $this->buildProviderTable($this, self::CMD_SHOW_USER_PROVIDER);
468  $table->setEditProviderCmd(self::CMD_SHOW_USER_PROVIDER_FORM);
469  $table->setAcceptProviderAsGlobalMultiCmd(self::CMD_ACCEPT_PROVIDER_AS_GLOBAL_MULTI);
470  $table->setAcceptProviderAsGlobalCmd(self::CMD_ACCEPT_PROVIDER_AS_GLOBAL);
471  $table->setDeleteProviderCmd(self::CMD_DELETE_USER_PROVIDER);
472  $table->setDeleteProviderMultiCmd(self::CMD_DELETE_USER_PROVIDER_MULTI);
473 
474  $table->setData($providerList->getTableData());
475 
476  $table->init();
477 
478  $DIC->ui()->mainTemplate()->setContent($table->getHTML());
479  }
buildProviderTable(ilLTIConsumerAdministrationGUI $parentGui, string $parentCmd)
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ showUserProviderFormCmd()

ilLTIConsumerAdministrationGUI::showUserProviderFormCmd ( ?ilLTIConsumeProviderFormGUI  $form = null)
protected
Exceptions

Definition at line 485 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, buildProviderForm(), and null.

Referenced by saveUserProviderFormCmd().

485  : void
486  {
487  global $DIC; /* @var \ILIAS\DI\Container $DIC */
488 
489  $DIC->tabs()->activateSubTab('user_provider');
490 
491  if ($form === null) {
492  if ($DIC->http()->wrapper()->query()->has('provider_id')) {
493  $DIC->ctrl()->saveParameter($this, 'provider_id');
494  $provider = new ilLTIConsumeProvider((int) $DIC->http()->wrapper()->query()->retrieve('provider_id', $DIC->refinery()->kindlyTo()->int()));
495  } else {
497  }
498 
499  $form = $this->buildProviderForm(
500  $provider,
501  self::CMD_SAVE_USER_PROVIDER_FORM,
502  self::CMD_SHOW_USER_PROVIDER
503  );
504  }
505 
506  $DIC->ui()->mainTemplate()->setContent($form->getHTML());
507  }
buildProviderForm(ilLTIConsumeProvider $provider, string $saveCmd, string $cancelCmd)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validateProviderDeletionSelection()

ilLTIConsumerAdministrationGUI::validateProviderDeletionSelection ( array  $providers)
protected

Definition at line 740 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, $provider, and getProviderListForIds().

Referenced by deleteGlobalProviderCmd(), deleteGlobalProviderMultiCmd(), deleteUserProviderCmd(), deleteUserProviderMultiCmd(), and performDeleteProvidersCmd().

740  : bool
741  {
742  global $DIC; /* @var \ILIAS\DI\Container $DIC */
743 
744  if (!count($providers)) {
745  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_no_provider_selected'), true);
746  return false;
747  }
748 
749  $providerList = $this->getProviderListForIds(array_keys($providers));
750 
751  foreach ($providers as $provider) {
752  if ($providerList->hasUsages($provider->getId())) {
753  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_at_least_one_prov_has_usages'), true);
754  return false;
755  }
756  }
757 
758  return true;
759  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $_importedXmlData

array ilLTIConsumerAdministrationGUI::$_importedXmlData = []
private

Definition at line 67 of file class.ilLTIConsumerAdministrationGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ilLTIConsumerAdministrationGUI::$main_tpl
private

Definition at line 68 of file class.ilLTIConsumerAdministrationGUI.php.

◆ ALLOWED_FILE_EXT

const ilLTIConsumerAdministrationGUI::ALLOWED_FILE_EXT = ['jpg', 'jpeg', 'png', 'gif', 'ico', 'svg']

Definition at line 65 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_ACCEPT_PROVIDER_AS_GLOBAL

const ilLTIConsumerAdministrationGUI::CMD_ACCEPT_PROVIDER_AS_GLOBAL = 'acceptProviderAsGlobal'

Definition at line 48 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_ACCEPT_PROVIDER_AS_GLOBAL_MULTI

const ilLTIConsumerAdministrationGUI::CMD_ACCEPT_PROVIDER_AS_GLOBAL_MULTI = 'acceptProviderAsGlobalMulti'

Definition at line 49 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_APPLY_GLOBAL_PROVIDER_FILTER

const ilLTIConsumerAdministrationGUI::CMD_APPLY_GLOBAL_PROVIDER_FILTER = 'applyGlobalProviderFilter'

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

◆ CMD_DELETE_GLOBAL_PROVIDER

const ilLTIConsumerAdministrationGUI::CMD_DELETE_GLOBAL_PROVIDER = 'deleteGlobalProvider'

Definition at line 53 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_DELETE_GLOBAL_PROVIDER_MULTI

const ilLTIConsumerAdministrationGUI::CMD_DELETE_GLOBAL_PROVIDER_MULTI = 'deleteGlobalProviderMulti'

Definition at line 54 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_DELETE_USER_PROVIDER

const ilLTIConsumerAdministrationGUI::CMD_DELETE_USER_PROVIDER = 'deleteUserProvider'

Definition at line 55 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_DELETE_USER_PROVIDER_MULTI

const ilLTIConsumerAdministrationGUI::CMD_DELETE_USER_PROVIDER_MULTI = 'deleteUserProviderMulti'

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

◆ CMD_PERFORM_DELETE_PROVIDERS

const ilLTIConsumerAdministrationGUI::CMD_PERFORM_DELETE_PROVIDERS = 'performDeleteProviders'

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

◆ CMD_RESET_GLOBAL_PROVIDER_FILTER

const ilLTIConsumerAdministrationGUI::CMD_RESET_GLOBAL_PROVIDER_FILTER = 'resetGlobalProviderFilter'

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

◆ CMD_RESET_PROVIDER_TO_USER_SCOPE

const ilLTIConsumerAdministrationGUI::CMD_RESET_PROVIDER_TO_USER_SCOPE = 'resetProviderToUserScope'

Definition at line 50 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_RESET_PROVIDER_TO_USER_SCOPE_MULTI

const ilLTIConsumerAdministrationGUI::CMD_RESET_PROVIDER_TO_USER_SCOPE_MULTI = 'resetProviderToUserScopeMulti'

Definition at line 51 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_ROLE_AUTOCOMPLETE

const ilLTIConsumerAdministrationGUI::CMD_ROLE_AUTOCOMPLETE = 'roleAutocomplete'

Definition at line 61 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_SAVE_GLOBAL_PROVIDER_FORM

const ilLTIConsumerAdministrationGUI::CMD_SAVE_GLOBAL_PROVIDER_FORM = 'saveGlobalProviderForm'

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

◆ CMD_SAVE_GLOBAL_PROVIDER_IMPORT

const ilLTIConsumerAdministrationGUI::CMD_SAVE_GLOBAL_PROVIDER_IMPORT = 'saveGlobalProviderImport'

Definition at line 42 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_SAVE_SETTINGS

const ilLTIConsumerAdministrationGUI::CMD_SAVE_SETTINGS = 'saveSettings'

Definition at line 60 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_SAVE_USER_PROVIDER_FORM

const ilLTIConsumerAdministrationGUI::CMD_SAVE_USER_PROVIDER_FORM = 'saveUserProviderForm'

Definition at line 46 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_SHOW_GLOBAL_PROVIDER

const ilLTIConsumerAdministrationGUI::CMD_SHOW_GLOBAL_PROVIDER = 'showGlobalProvider'

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

◆ CMD_SHOW_GLOBAL_PROVIDER_FORM

const ilLTIConsumerAdministrationGUI::CMD_SHOW_GLOBAL_PROVIDER_FORM = 'showGlobalProviderForm'

Definition at line 39 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_SHOW_GLOBAL_PROVIDER_IMPORT

const ilLTIConsumerAdministrationGUI::CMD_SHOW_GLOBAL_PROVIDER_IMPORT = 'showGlobalProviderImport'

Definition at line 41 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_SHOW_SETTINGS

const ilLTIConsumerAdministrationGUI::CMD_SHOW_SETTINGS = 'showSettings'

Definition at line 59 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_SHOW_USAGES

const ilLTIConsumerAdministrationGUI::CMD_SHOW_USAGES = 'showUsages'

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

◆ CMD_SHOW_USER_PROVIDER

const ilLTIConsumerAdministrationGUI::CMD_SHOW_USER_PROVIDER = 'showUserProvider'

Definition at line 44 of file class.ilLTIConsumerAdministrationGUI.php.

◆ CMD_SHOW_USER_PROVIDER_FORM

const ilLTIConsumerAdministrationGUI::CMD_SHOW_USER_PROVIDER_FORM = 'showUserProviderForm'

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

◆ REDIRECTION_CMD_PARAMETER

const ilLTIConsumerAdministrationGUI::REDIRECTION_CMD_PARAMETER = 'redirectCmd'

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


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