ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilLTIConsumerAdministrationGUI Class Reference
+ Collaboration diagram for ilLTIConsumerAdministrationGUI:

Public Member Functions

 __construct (bool $hasWritePermission=false)
 
 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
 
bool $hasWritePermission
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilLTIConsumerAdministrationGUI::__construct ( bool  $hasWritePermission = false)

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

References $DIC, and $hasWritePermission.

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

Member Function Documentation

◆ acceptProviderAsGlobalCmd()

ilLTIConsumerAdministrationGUI::acceptProviderAsGlobalCmd ( )
protected
Exceptions
ilCtrlException

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

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

582  : void
583  {
584  global $DIC; /* @var \ILIAS\DI\Container $DIC */
585 
586  $provider = $this->fetchProvider();
587 
588  if ($provider->isAcceptableAsGlobal()) {
590  }
591 
592  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('lti_success_accept_as_global'), true);
593  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
594  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ acceptProviderAsGlobalMultiCmd()

ilLTIConsumerAdministrationGUI::acceptProviderAsGlobalMultiCmd ( )
protected
Exceptions
ilCtrlException

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

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

555  : void
556  {
557  global $DIC; /* @var \ILIAS\DI\Container $DIC */
558 
559  $providers = $this->fetchProviderMulti();
560 
561  if (!count($providers)) {
562  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_no_provider_selected'), true);
563  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
564  }
565 
566  foreach ($providers as $provider) {
567  if (!$provider->isAcceptableAsGlobal()) {
568  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_at_least_one_not_acceptable_as_global'), true);
569  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
570  }
571  }
572 
573  $this->performAcceptProvidersAsGlobal($providers);
574 
575  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('lti_success_accept_as_global_multi'), true);
576  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
577  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ applyGlobalProviderFilterCmd()

ilLTIConsumerAdministrationGUI::applyGlobalProviderFilterCmd ( )
protected

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

References buildProviderTable(), and showGlobalProviderCmd().

129  : void
130  {
131  $table = $this->buildProviderTable($this, self::CMD_SHOW_GLOBAL_PROVIDER);
132  $table->writeFilterToSession();
133  $table->resetOffset();
134  $this->showGlobalProviderCmd();
135  }
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 870 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC.

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

871  {
872  global $DIC; /* @var \ILIAS\DI\Container $DIC */
873 
874  $form = new ilLTIConsumeProviderFormGUI($provider);
875  $form->setAdminContext(true);
876  $form->initForm($DIC->ctrl()->getFormAction($this), $saveCmd, $cancelCmd);
877 
878  return $form;
879  }
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ buildProviderImportForm()

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

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

References $DIC, and ilFormPropertyGUI\setInfo().

Referenced by saveGlobalProviderImportCmd(), and showGlobalProviderImportCmd().

322  {
323  global $DIC; /* @var \ILIAS\DI\Container $DIC */
324 
325  $form = new ilPropertyFormGUI();
326 
327  $form->setTitle($DIC->language()->txt('form_import_provider'));
328 
329  $form->setFormAction($DIC->ctrl()->getFormAction($this));
330 
331  $form->addCommandButton($saveCommand, $DIC->language()->txt('import'));
332  $form->addCommandButton($cancelCommand, $DIC->language()->txt('cancel'));
333 
334  $provXmlUpload = new ilFileInputGUI($DIC->language()->txt('field_provider_xml'), 'provider_xml');
335  $provXmlUpload->setInfo($DIC->language()->txt('field_provider_xml_info'));
336  $provXmlUpload->setRequired(true);
337  $provXmlUpload->setSuffixes(['xml']);
338  $form->addItem($provXmlUpload);
339 
340  return $form;
341  }
This class represents a property form user interface.
This class represents a file property in a property form.
global $DIC
Definition: shib_login.php:25
+ 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 830 of file class.ilLTIConsumerAdministrationGUI.php.

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

831  {
832  $table = new ilLTIConsumerProviderTableGUI(
833  $parentGui,
834  $parentCmd
835  );
836 
837 
838  $table->setFilterCommand(self::CMD_APPLY_GLOBAL_PROVIDER_FILTER);
839  $table->setResetCommand(self::CMD_RESET_GLOBAL_PROVIDER_FILTER);
840 
841  $table->setAvailabilityColumnEnabled(true);
842  $table->setProviderCreatorColumnEnabled(true);
843 
844  $table->setActionsColumnEnabled($this->hasWritePermission);
845  $table->setDetailedUsagesEnabled(true);
846 
847  return $table;
848  }
+ Here is the caller graph for this function:

◆ buildSettingsForm()

ilLTIConsumerAdministrationGUI::buildSettingsForm ( )
protected
Exceptions
ilCtrlException

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

References $DIC.

Referenced by saveSettingsCmd(), and showSettingsCmd().

959  {
960  global $DIC; /* @var \ILIAS\DI\Container $DIC */
961 
962  $form = new ilPropertyFormGUI();
963 
964  $form->setFormAction($DIC->ctrl()->getFormAction($this));
965  $form->addCommandButton(self::CMD_SAVE_SETTINGS, $DIC->language()->txt('save'));
966  $form->setTitle($DIC->language()->txt('lti_global_settings_form'));
967 
968  return $form;
969  }
This class represents a property form user interface.
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ checkIconFileExtension()

ilLTIConsumerAdministrationGUI::checkIconFileExtension ( string  $ext)
private

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

References $check.

Referenced by getInput().

451  : bool
452  {
453  // todo - check?
454  return false !== ($check = array_search($ext, self::ALLOWED_FILE_EXT)) ? true : false;
455  }
$check
Definition: buildRTE.php:81
+ Here is the caller graph for this function:

◆ checkIconFileVirus()

ilLTIConsumerAdministrationGUI::checkIconFileVirus ( string  $ico)
private

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

References ilVirusScannerFactory\_getInstance().

Referenced by getInput().

457  : bool
458  {
460  if (!$virusScan) {
461  return false;
462  }
463  return $virusScan->scanBuffer($ico);
464  // return false === (bool)$virusScan->scanBuffer($ico) ? false : true;
465  }
+ 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 778 of file class.ilLTIConsumerAdministrationGUI.php.

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

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

778  : void
779  {
780  global $DIC; /* @var \ILIAS\DI\Container $DIC */
781 
782  $confirmationGUI = new ilConfirmationGUI();
783 
784  $confirmationGUI->setFormAction($DIC->ctrl()->getFormAction($this));
785  $confirmationGUI->setCancel($DIC->language()->txt('cancel'), $cancelCommand);
786  $confirmationGUI->setConfirm($DIC->language()->txt('confirm'), self::CMD_PERFORM_DELETE_PROVIDERS);
787 
788  $confirmationGUI->setHeaderText($DIC->language()->txt('lti_confirm_delete_providers'));
789 
790  foreach ($providers as $provider) {
791  /* @var ilLTIConsumeProvider $provider */
792 
793  if ($provider->getProviderIcon()->exists()) {
794  $providerIcon = $provider->getProviderIcon()->getAbsoluteFilePath();
795  } else {
796  $providerIcon = ilObject::_getIcon(0, "small", "lti");
797  }
798 
799  $confirmationGUI->addItem(
800  'provider_ids[]',
801  (string) $provider->getId(),
802  htmlspecialchars($provider->getTitle()),
803  $providerIcon
804  );
805  }
806 
807  $DIC->ui()->mainTemplate()->setContent($confirmationGUI->getHTML());
808  }
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:25
+ 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 695 of file class.ilLTIConsumerAdministrationGUI.php.

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

695  : void
696  {
697  global $DIC; /* @var \ILIAS\DI\Container $DIC */
698 
699  $DIC->tabs()->activateSubTab('global_provider');
700 
701  $DIC->ctrl()->setParameter($this, self::REDIRECTION_CMD_PARAMETER, self::CMD_SHOW_GLOBAL_PROVIDER);
702 
703  $provider = $this->fetchProvider();
704  $providers = [$provider->getId() => $provider];
705 
706  if (!$this->validateProviderDeletionSelection($providers)) {
707  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
708  }
709 
710  $this->confirmDeleteProviders($providers, self::CMD_SHOW_GLOBAL_PROVIDER);
711  }
confirmDeleteProviders(array $providers, string $cancelCommand)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ deleteGlobalProviderMultiCmd()

ilLTIConsumerAdministrationGUI::deleteGlobalProviderMultiCmd ( )
protected
Exceptions
ilCtrlException

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

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

675  : void
676  {
677  global $DIC; /* @var \ILIAS\DI\Container $DIC */
678 
679  $DIC->tabs()->activateSubTab('global_provider');
680 
681  $DIC->ctrl()->setParameter($this, self::REDIRECTION_CMD_PARAMETER, self::CMD_SHOW_GLOBAL_PROVIDER);
682 
683  $providers = $this->fetchProviderMulti();
684 
685  if (!$this->validateProviderDeletionSelection($providers)) {
686  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
687  }
688 
689  $this->confirmDeleteProviders($providers, self::CMD_SHOW_GLOBAL_PROVIDER);
690  }
confirmDeleteProviders(array $providers, string $cancelCommand)
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ deleteUserProviderCmd()

ilLTIConsumerAdministrationGUI::deleteUserProviderCmd ( )
protected
Exceptions
ilCtrlException

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

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

736  : void
737  {
738  global $DIC; /* @var \ILIAS\DI\Container $DIC */
739 
740  $DIC->tabs()->activateSubTab('global_provider');
741 
742  $DIC->ctrl()->setParameter($this, self::REDIRECTION_CMD_PARAMETER, self::CMD_SHOW_USER_PROVIDER);
743 
744  $provider = $this->fetchProvider();
745  $providers = [$provider->getId() => $provider];
746 
747  if (!$this->validateProviderDeletionSelection($providers)) {
748  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
749  }
750 
751  $this->confirmDeleteProviders($providers, self::CMD_SHOW_USER_PROVIDER);
752  }
confirmDeleteProviders(array $providers, string $cancelCommand)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ deleteUserProviderMultiCmd()

ilLTIConsumerAdministrationGUI::deleteUserProviderMultiCmd ( )
protected
Exceptions
ilCtrlException

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

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

716  : void
717  {
718  global $DIC; /* @var \ILIAS\DI\Container $DIC */
719 
720  $DIC->tabs()->activateSubTab('user_provider');
721 
722  $DIC->ctrl()->setParameter($this, self::REDIRECTION_CMD_PARAMETER, self::CMD_SHOW_USER_PROVIDER);
723 
724  $providers = $this->fetchProviderMulti();
725 
726  if (!$this->validateProviderDeletionSelection($providers)) {
727  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
728  }
729 
730  $this->confirmDeleteProviders($providers, self::CMD_SHOW_USER_PROVIDER);
731  }
confirmDeleteProviders(array $providers, string $cancelCommand)
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ executeCommand()

ilLTIConsumerAdministrationGUI::executeCommand ( )

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

References $DIC, and initSubTabs().

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

◆ fetchProvider()

ilLTIConsumerAdministrationGUI::fetchProvider ( )
protected
Exceptions

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

References $DIC, and $provider.

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

885  {
886  global $DIC;
887 
888  if ($DIC->http()->wrapper()->query()->has('provider_id')) {
890  (int) $DIC->http()->wrapper()->query()->retrieve('provider_id', $DIC->refinery()->kindlyTo()->int())
891  );
892  } else {
894  }
895  return $provider;
896  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ fetchProviderMulti()

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

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

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

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

902  : array
903  {
904  global $DIC;
905  $providers = [];
906 
907  if (!$DIC->http()->wrapper()->post()->has('provider_ids') ||
908  !$DIC->http()->wrapper()->post()->retrieve('provider_ids', $DIC->refinery()->kindlyTo()->listOf($DIC->refinery()->kindlyTo()->int()))
909  ) {
910  return $providers;
911  }
912  $provider_ids = $DIC->http()->wrapper()->post()->retrieve('provider_ids', $DIC->refinery()->kindlyTo()->listOf($DIC->refinery()->kindlyTo()->int()));
913 
914  foreach ($provider_ids as $providerId) {
915  $providers[(int) $providerId] = new ilLTIConsumeProvider((int) $providerId);
916  }
917 
918  return $providers;
919  }
if(empty($clientId)) $providerId
Definition: ltitoken.php:79
global $DIC
Definition: shib_login.php:25
+ 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 401 of file class.ilLTIConsumerAdministrationGUI.php.

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

Referenced by prepareProvider().

401  : string
402  {
403  if (!is_bool($this->_importedXmlData[$key])) {
404  $this->_importedXmlData[$key] = trim($this->_importedXmlData[$key]);
405  }
406  return $this->_importedXmlData[$key];
407  }
+ 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 971 of file class.ilLTIConsumerAdministrationGUI.php.

Referenced by validateProviderDeletionSelection().

972  {
973  $providerList = new ilLTIConsumeProviderList();
974  $providerList->setIdsFilter($providerIds);
975  $providerList->load();
976  $providerList->loadUsages();
977  return $providerList;
978  }
+ Here is the caller graph for this function:

◆ initSubTabs()

ilLTIConsumerAdministrationGUI::initSubTabs ( )
protected

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

References $DIC.

Referenced by executeCommand().

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

◆ performAcceptProvidersAsGlobal()

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

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

References $DIC, and $provider.

Referenced by acceptProviderAsGlobalCmd(), and acceptProviderAsGlobalMultiCmd().

602  : void
603  {
604  global $DIC; /* @var \ILIAS\DI\Container $DIC */
605 
606  foreach ($providers as $provider) {
607  $provider->setIsGlobal(true);
608  $provider->setAcceptedBy($DIC->user()->getId());
609  $provider->save();
610  }
611  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ performDeleteProvidersCmd()

ilLTIConsumerAdministrationGUI::performDeleteProvidersCmd ( )
protected
Exceptions
ilCtrlException

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

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

813  : void
814  {
815  global $DIC; /* @var \ILIAS\DI\Container $DIC */
816 
817  $providers = $this->fetchProviderMulti();
818 
819  if ($this->validateProviderDeletionSelection($providers)) {
820  foreach ($providers as $provider) {
821  $provider->delete();
822  }
823 
824  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('lti_success_delete_provider'), true);
825  }
826 
827  $DIC->ctrl()->redirect($this, $DIC->http()->wrapper()->query()->retrieve(self::REDIRECTION_CMD_PARAMETER, $DIC->refinery()->kindlyTo()->string()));
828  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ 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 348 of file class.ilLTIConsumerAdministrationGUI.php.

References prepareProvider().

Referenced by saveGlobalProviderImportCmd().

349  {
350  $doc = new DOMDocument();
351  $doc->loadXML($providerXml);
352  $xPath = new DOMXPath($doc);
353  $this->_importedXmlData = [
354  'title' => $xPath->query("//*[local-name() = 'title']")->item(0)->nodeValue,
355  'description' => null !== ($desc = $xPath->query("//*[local-name() = 'description']")->item(0)->nodeValue) ? $desc : '',
356  'provider_url' => $xPath->query("//*[local-name() = 'launch_url']")->item(0)->nodeValue,
357  'provider_icon' => $xPath->query("//*[local-name() = 'icon']")->item(0)->nodeValue,
358  'launch_method' => 'newWin',
359  ];
360 
361  // DONE ?
367  return $this->prepareProvider();
368  }
+ 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 663 of file class.ilLTIConsumerAdministrationGUI.php.

References $provider.

Referenced by resetProviderToUserScopeCmd(), and resetProviderToUserScopeMultiCmd().

663  : void
664  {
665  foreach ($providers as $provider) {
666  $provider->setIsGlobal(false);
667  $provider->setAcceptedBy(0);
668  $provider->save();
669  }
670  }
$provider
Definition: ltitoken.php:80
+ Here is the caller graph for this function:

◆ prepareProvider()

ilLTIConsumerAdministrationGUI::prepareProvider ( )
private
Exceptions

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

References $provider, and getInput().

Referenced by performProviderImport().

376  {
378  $provider->setTitle($this->getInput('title'));
379  $provider->setDescription($this->getInput('description'));
380  if (null !== $this->getInput('provider_url')) {
381  $provider->setProviderUrl($this->getInput('provider_url'));
382  }
383  $provider->setIsGlobal(true);
384  $provider->save();
385 
386  // PROVIDER ICON
387  $pId = $provider->getId();
388  if (null !== $pIconFileName = $this->getIconXml($this->getInput('provider_icon'), (string) $pId)) {
389  $provider->setProviderIconFilename($pIconFileName);
390  $provider->update();
391  $provider->update();
392  }
393 
394  return $provider;
395  }
$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 137 of file class.ilLTIConsumerAdministrationGUI.php.

References buildProviderTable(), and showGlobalProviderCmd().

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

◆ resetProviderToUserScopeCmd()

ilLTIConsumerAdministrationGUI::resetProviderToUserScopeCmd ( )
protected
Exceptions
ilCtrlException

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

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

643  : void
644  {
645  global $DIC; /* @var \ILIAS\DI\Container $DIC */
646 
647  $provider = $this->fetchProvider();
648 
649  if ($provider->isResetableToUserDefined()) {
651  }
652 
653  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('lti_success_reset_to_usr_def'), true);
654  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
655  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ resetProviderToUserScopeMultiCmd()

ilLTIConsumerAdministrationGUI::resetProviderToUserScopeMultiCmd ( )
protected
Exceptions
ilCtrlException

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

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

616  : void
617  {
618  global $DIC; /* @var \ILIAS\DI\Container $DIC */
619 
620  $providers = $this->fetchProviderMulti();
621 
622  if (!count($providers)) {
623  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_no_provider_selected'), true);
624  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
625  }
626 
627  foreach ($providers as $provider) {
628  if (!$provider->isResetableToUserDefined()) {
629  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_at_least_one_not_resetable_to_usr_def'), true);
630  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
631  }
632  }
633 
634  $this->performResetProvidersToUserScope($providers);
635 
636  $this->main_tpl->setOnScreenMessage('success', $DIC->language()->txt('lti_success_reset_to_usr_def_multi'), true);
637  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
638  }
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ saveGlobalProviderFormCmd()

ilLTIConsumerAdministrationGUI::saveGlobalProviderFormCmd ( )
protected

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

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

244  : void
245  {
246  global $DIC; /* @var \ILIAS\DI\Container $DIC */
247 
248  $provider = $this->fetchProvider();
249 
250  $form = $this->buildProviderForm(
251  $provider,
252  self::CMD_SAVE_GLOBAL_PROVIDER_FORM,
253  self::CMD_SHOW_GLOBAL_PROVIDER
254  );
255 
256  if ($form->checkInput()) {
257  $form->initProvider($provider);
258 
259  if (!$provider->getCreator()) {
260  $provider->setCreator($DIC->user()->getId());
261  }
262 
263  $provider->setIsGlobal(true);
264  $provider->save();
265 
266  $DIC->ctrl()->redirect($this, self::CMD_SHOW_GLOBAL_PROVIDER);
267  }
268 
269  $this->showGlobalProviderFormCmd($form);
270  }
buildProviderForm(ilLTIConsumeProvider $provider, string $saveCmd, string $cancelCmd)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
showGlobalProviderFormCmd(?ilLTIConsumeProviderFormGUI $form=null)
+ Here is the call graph for this function:

◆ saveGlobalProviderImportCmd()

ilLTIConsumerAdministrationGUI::saveGlobalProviderImportCmd ( )
protected

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

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

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

◆ saveSettingsCmd()

ilLTIConsumerAdministrationGUI::saveSettingsCmd ( )
protected

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

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

938  : void
939  {
940  // todo - check
941  global $DIC; /* @var \ILIAS\DI\Container $DIC */
942 
943  return; // no settings at all currently
944 
945  $form = $this->buildSettingsForm();
946 
947  if (!$form->checkInput()) {
948  $this->showSettingsCmd($form);
949  return;
950  }
951 
952  $DIC->ctrl()->redirect($this, self::CMD_SHOW_SETTINGS);
953  }
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ saveUserProviderFormCmd()

ilLTIConsumerAdministrationGUI::saveUserProviderFormCmd ( )
protected
Exceptions

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

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

529  : void
530  {
531  global $DIC; /* @var \ILIAS\DI\Container $DIC */
532 
533  $provider = $this->fetchProvider();
534 
535  $form = $this->buildProviderForm(
536  $provider,
537  self::CMD_SAVE_USER_PROVIDER_FORM,
538  self::CMD_SHOW_USER_PROVIDER
539  );
540 
541  if ($form->checkInput()) {
542  $form->initProvider($provider);
543  $provider->setIsGlobal(false);
544  $provider->save();
545 
546  $DIC->ctrl()->redirect($this, self::CMD_SHOW_USER_PROVIDER);
547  }
548 
549  $this->showUserProviderFormCmd($form);
550  }
showUserProviderFormCmd(?ilLTIConsumeProviderFormGUI $form=null)
buildProviderForm(ilLTIConsumeProvider $provider, string $saveCmd, string $cancelCmd)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ showGlobalProviderCmd()

ilLTIConsumerAdministrationGUI::showGlobalProviderCmd ( )
protected

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

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

Referenced by applyGlobalProviderFilterCmd(), and resetGlobalProviderFilterCmd().

145  : void
146  {
147  global $DIC; /* @var \ILIAS\DI\Container $DIC */
148 
149  $DIC->tabs()->activateSubTab('global_provider');
150 
151  if ($this->hasWritePermission) {
152  $button = $DIC->ui()->factory()->button()->standard(
153  $DIC->language()->txt('lti_add_global_provider'),
154  $DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_GLOBAL_PROVIDER_FORM)
155  );
156 
157  $DIC->toolbar()->addComponent($button);
158 
159  $button = $DIC->ui()->factory()->button()->standard(
160  $DIC->language()->txt('lti_import_global_provider'),
161  $DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_GLOBAL_PROVIDER_IMPORT)
162  );
163 
164  $DIC->toolbar()->addComponent($button);
165  }
166 
167 
168 
169  $table = $this->buildProviderTable($this, self::CMD_SHOW_GLOBAL_PROVIDER);
170 
171  // Only set modification commands if user has write permission
172  if ($this->hasWritePermission) {
173  $table->setEditProviderCmd(self::CMD_SHOW_GLOBAL_PROVIDER_FORM);
174  $table->setDeleteProviderCmd(self::CMD_DELETE_GLOBAL_PROVIDER);
175  $table->setDeleteProviderMultiCmd(self::CMD_DELETE_GLOBAL_PROVIDER_MULTI);
176  $table->setResetProviderToUserScopeCmd(self::CMD_RESET_PROVIDER_TO_USER_SCOPE);
177  $table->setResetProviderToUserScopeMultiCmd(self::CMD_RESET_PROVIDER_TO_USER_SCOPE_MULTI);
178  }
179 
180  $table->init();
181 
182  $providerList = new ilLTIConsumeProviderList();
183  $providerList->setScopeFilter(ilLTIConsumeProviderList::SCOPE_GLOBAL);
184 
185  if ($table->getFilterItemByPostVar('title')->getValue()) {
186  $providerList->setTitleFilter($table->getFilterItemByPostVar('title')->getValue());
187  }
188 
189  if ($table->getFilterItemByPostVar('category')->getValue()) {
190  $providerList->setCategoryFilter($table->getFilterItemByPostVar('category')->getValue());
191  }
192 
193  if ($table->getFilterItemByPostVar('keyword')->getValue()) {
194  $providerList->setKeywordFilter($table->getFilterItemByPostVar('keyword')->getValue());
195  }
196 
197  if ($table->getFilterItemByPostVar('outcome')->getChecked()) {
198  $providerList->setHasOutcomeFilter(true);
199  }
200 
201  if ($table->getFilterItemByPostVar('internal')->getChecked()) {
202  $providerList->setIsExternalFilter(false);
203  }
204 
205  if ($table->getFilterItemByPostVar('with_key')->getChecked()) {
206  $providerList->setIsProviderKeyCustomizableFilter(false);
207  }
208 
209  $providerList->load();
210 
211  $table->setData($providerList->getTableData());
212 
213  $DIC->ui()->mainTemplate()->setContent($table->getHTML());
214  }
buildProviderTable(ilLTIConsumerAdministrationGUI $parentGui, string $parentCmd)
global $DIC
Definition: shib_login.php:25
+ 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 220 of file class.ilLTIConsumerAdministrationGUI.php.

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

Referenced by saveGlobalProviderFormCmd().

220  : void
221  {
222  global $DIC; /* @var \ILIAS\DI\Container $DIC */
223 
224  $DIC->tabs()->activateSubTab('global_provider');
225 
226  if ($form === null) {
227  if ($DIC->http()->wrapper()->query()->has('provider_id')) {
228  $DIC->ctrl()->saveParameter($this, 'provider_id');
229  $provider = new ilLTIConsumeProvider((int) $DIC->http()->wrapper()->query()->retrieve('provider_id', $DIC->refinery()->kindlyTo()->int()));
230  } else {
232  }
233 
234  $form = $this->buildProviderForm(
235  $provider,
236  self::CMD_SAVE_GLOBAL_PROVIDER_FORM,
237  self::CMD_SHOW_GLOBAL_PROVIDER
238  );
239  }
240 
241  $DIC->ui()->mainTemplate()->setContent($form->getHTML());
242  }
buildProviderForm(ilLTIConsumeProvider $provider, string $saveCmd, string $cancelCmd)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ 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 272 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, and buildProviderImportForm().

Referenced by saveGlobalProviderImportCmd().

272  : void
273  {
274  global $DIC; /* @var \ILIAS\DI\Container $DIC */
275 
276  $DIC->tabs()->activateSubTab('global_provider');
277 
278  if ($form === null) {
279  $form = $this->buildProviderImportForm(
280  self::CMD_SAVE_GLOBAL_PROVIDER_IMPORT,
281  self::CMD_SHOW_GLOBAL_PROVIDER
282  );
283  }
284 
285  $DIC->ui()->mainTemplate()->setContent($form->getHTML());
286  }
global $DIC
Definition: shib_login.php:25
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 922 of file class.ilLTIConsumerAdministrationGUI.php.

References $DIC, and buildSettingsForm().

Referenced by saveSettingsCmd().

922  : void
923  {
924  // todo - check
925  global $DIC; /* @var \ILIAS\DI\Container $DIC */
926 
927  return; // no settings at all currently
928 
929  $DIC->tabs()->activateSubTab('settings');
930 
931  if ($form === null) {
932  $form = $this->buildSettingsForm();
933  }
934 
935  $DIC->ui()->mainTemplate()->setContent($form->getHTML());
936  }
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUsagesCmd()

ilLTIConsumerAdministrationGUI::showUsagesCmd ( )
protected

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

References $DIC, and ilLTIConsumeProviderList\SCOPE_GLOBAL.

850  : void
851  {
852  global $DIC;
853 
854  $DIC->tabs()->activateSubTab('usage');
855 
856  $providerList = new ilLTIConsumeProviderList();
857  $providerList->setScopeFilter(ilLTIConsumeProviderList::SCOPE_GLOBAL);
858  $providerList->load();
859 
860  $table = new ilLTIConsumerProviderUsageTableGUI($this, self::CMD_SHOW_USAGES);
861  $table->setData($providerList->getTableDataUsedBy());
862  $table->init();
863 
864  $DIC->ui()->mainTemplate()->setContent($table->getHTML());
865  }
global $DIC
Definition: shib_login.php:25

◆ showUserProviderCmd()

ilLTIConsumerAdministrationGUI::showUserProviderCmd ( )
protected

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

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

467  : void
468  {
469  global $DIC; /* @var \ILIAS\DI\Container $DIC */
470 
471  $DIC->tabs()->activateSubTab('user_provider');
472 
473  $providerList = new ilLTIConsumeProviderList();
474  $providerList->setScopeFilter(ilLTIConsumeProviderList::SCOPE_USER);
475  $providerList->load();
476 
477  $table = $this->buildProviderTable($this, self::CMD_SHOW_USER_PROVIDER);
478 
479  // Only set modification commands if user has write permission
480  if ($this->hasWritePermission) {
481  $table->setEditProviderCmd(self::CMD_SHOW_USER_PROVIDER_FORM);
482  $table->setAcceptProviderAsGlobalMultiCmd(self::CMD_ACCEPT_PROVIDER_AS_GLOBAL_MULTI);
483  $table->setAcceptProviderAsGlobalCmd(self::CMD_ACCEPT_PROVIDER_AS_GLOBAL);
484  $table->setDeleteProviderCmd(self::CMD_DELETE_USER_PROVIDER);
485  $table->setDeleteProviderMultiCmd(self::CMD_DELETE_USER_PROVIDER_MULTI);
486  }
487 
488  $table->setData($providerList->getTableData());
489 
490  $table->init();
491 
492  $DIC->ui()->mainTemplate()->setContent($table->getHTML());
493  }
buildProviderTable(ilLTIConsumerAdministrationGUI $parentGui, string $parentCmd)
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ showUserProviderFormCmd()

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

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

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

Referenced by saveUserProviderFormCmd().

499  : void
500  {
501  global $DIC; /* @var \ILIAS\DI\Container $DIC */
502 
503  $DIC->tabs()->activateSubTab('user_provider');
504 
505  if ($form === null) {
506  if ($DIC->http()->wrapper()->query()->has('provider_id')) {
507  $DIC->ctrl()->saveParameter($this, 'provider_id');
508  $provider = new ilLTIConsumeProvider((int) $DIC->http()->wrapper()->query()->retrieve('provider_id', $DIC->refinery()->kindlyTo()->int()));
509  } else {
511  }
512 
513  $form = $this->buildProviderForm(
514  $provider,
515  self::CMD_SAVE_USER_PROVIDER_FORM,
516  self::CMD_SHOW_USER_PROVIDER
517  );
518  }
519 
520  $DIC->ui()->mainTemplate()->setContent($form->getHTML());
521  }
buildProviderForm(ilLTIConsumeProvider $provider, string $saveCmd, string $cancelCmd)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:25
+ 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 754 of file class.ilLTIConsumerAdministrationGUI.php.

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

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

754  : bool
755  {
756  global $DIC; /* @var \ILIAS\DI\Container $DIC */
757 
758  if (!count($providers)) {
759  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_no_provider_selected'), true);
760  return false;
761  }
762 
763  $providerList = $this->getProviderListForIds(array_keys($providers));
764 
765  foreach ($providers as $provider) {
766  if ($providerList->hasUsages($provider->getId())) {
767  $this->main_tpl->setOnScreenMessage('failure', $DIC->language()->txt('lti_at_least_one_prov_has_usages'), true);
768  return false;
769  }
770  }
771 
772  return true;
773  }
$provider
Definition: ltitoken.php:80
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

◆ $_importedXmlData

array ilLTIConsumerAdministrationGUI::$_importedXmlData = []
private

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

◆ $hasWritePermission

bool ilLTIConsumerAdministrationGUI::$hasWritePermission
private

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

Referenced by __construct().

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