2020-04-26 11:36:41 +02:00
|
|
|
<?php
|
2020-06-19 09:28:58 +02:00
|
|
|
|
2020-04-26 11:36:41 +02:00
|
|
|
namespace OCA\BigBlueButton\Settings;
|
|
|
|
|
|
|
|
use OCP\AppFramework\Http\TemplateResponse;
|
|
|
|
use OCP\IConfig;
|
|
|
|
use OCP\Settings\ISettings;
|
|
|
|
|
2020-06-19 09:28:58 +02:00
|
|
|
class Admin implements ISettings {
|
2020-04-26 11:36:41 +02:00
|
|
|
|
2020-05-17 12:29:44 +02:00
|
|
|
/** @var IConfig */
|
2020-04-26 11:36:41 +02:00
|
|
|
private $config;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Admin constructor.
|
|
|
|
*
|
|
|
|
* @param IConfig $config
|
|
|
|
*/
|
2020-06-19 09:28:58 +02:00
|
|
|
public function __construct(IConfig $config) {
|
2020-04-26 11:36:41 +02:00
|
|
|
$this->config = $config;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return TemplateResponse
|
|
|
|
*/
|
2020-06-19 09:28:58 +02:00
|
|
|
public function getForm() {
|
2020-04-26 11:36:41 +02:00
|
|
|
$parameters = [
|
2020-06-19 09:28:58 +02:00
|
|
|
'api.url' => $this->config->getAppValue('bbb', 'api.url'),
|
|
|
|
'api.secret' => $this->config->getAppValue('bbb', 'api.secret'),
|
2020-08-26 10:57:31 +02:00
|
|
|
'app.navigation' => $this->config->getAppValue('bbb', 'app.navigation') === 'true' ? 'checked' : '',
|
2021-04-18 13:14:05 +02:00
|
|
|
'join.theme' => $this->config->getAppValue('bbb', 'join.theme') === 'true' ? 'checked' : '',
|
2020-09-23 09:13:26 +02:00
|
|
|
'app.shortener' => $this->config->getAppValue('bbb', 'app.shortener'),
|
2020-06-19 09:28:58 +02:00
|
|
|
];
|
2020-04-26 11:36:41 +02:00
|
|
|
|
2020-04-26 13:26:34 +02:00
|
|
|
return new TemplateResponse('bbb', 'admin', $parameters);
|
2020-04-26 11:36:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string the section ID, e.g. 'sharing'
|
|
|
|
*/
|
2020-06-19 09:28:58 +02:00
|
|
|
public function getSection() {
|
2020-04-26 11:36:41 +02:00
|
|
|
return 'additional';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return int whether the form should be rather on the top or bottom of
|
|
|
|
* the admin section. The forms are arranged in ascending order of the
|
|
|
|
* priority values. It is required to return a value between 0 and 100.
|
|
|
|
*/
|
2020-06-19 09:28:58 +02:00
|
|
|
public function getPriority() {
|
2020-04-26 11:36:41 +02:00
|
|
|
return 50;
|
|
|
|
}
|
|
|
|
}
|