|
|
|
@ -23,22 +23,22 @@ class LtiProviderPlugin extends Plugin |
|
|
|
$version = '1.0'; |
|
|
|
$version = '1.0'; |
|
|
|
$author = 'Christian Beeznest'; |
|
|
|
$author = 'Christian Beeznest'; |
|
|
|
|
|
|
|
|
|
|
|
$publicKey = $this->getPublicKey(); |
|
|
|
|
|
|
|
$message = Display::return_message($this->get_lang('Description')); |
|
|
|
$message = Display::return_message($this->get_lang('Description')); |
|
|
|
|
|
|
|
|
|
|
|
if (empty($publicKey)) { |
|
|
|
if ($this->areTablesCreated()) { |
|
|
|
$publicKey = $this->get_lang('GenerateKeyPairInfo'); |
|
|
|
$publicKey = $this->getPublicKey(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$pkHtml = '<div class="form-group "> |
|
|
|
$pkHtml = '<div class="form-group"> |
|
|
|
<label for="lti_provider_public_key" class="col-sm-2 control-label">' |
|
|
|
<label for="lti_provider_public_key" class="col-sm-2 control-label">' |
|
|
|
.$this->get_lang('PublicKey').'</label> |
|
|
|
.$this->get_lang('PublicKey').'</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<pre>'.$publicKey.'</pre> |
|
|
|
<pre>'.$publicKey.'</pre> |
|
|
|
<p class="help-block"></p> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="col-sm-2"></div> |
|
|
|
<div class="col-sm-2"></div> |
|
|
|
</div>'; |
|
|
|
</div>'; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$pkHtml = $this->get_lang('GenerateKeyPairInfo'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$settings = [ |
|
|
|
$settings = [ |
|
|
|
$message => 'html', |
|
|
|
$message => 'html', |
|
|
|
@ -137,10 +137,7 @@ class LtiProviderPlugin extends Plugin |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private function createPluginTables(): void |
|
|
|
private function createPluginTables(): void |
|
|
|
{ |
|
|
|
{ |
|
|
|
$entityManager = Database::getManager(); |
|
|
|
if ($this->areTablesCreated()) { |
|
|
|
$connection = $entityManager->getConnection(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($connection->getSchemaManager()->tablesExist(self::TABLE_PLATFORM)) { |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -171,6 +168,14 @@ class LtiProviderPlugin extends Plugin |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private function areTablesCreated(): bool |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$entityManager = Database::getManager(); |
|
|
|
|
|
|
|
$connection = $entityManager->getConnection(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $connection->getSchemaManager()->tablesExist(self::TABLE_PLATFORM); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Save configuration for plugin. |
|
|
|
* Save configuration for plugin. |
|
|
|
* |
|
|
|
* |
|
|
|
|