2020-04-26 11:36:41 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace OCA\BigBlueButton\Settings;
|
|
|
|
|
|
|
|
use OCP\AppFramework\Http\TemplateResponse;
|
|
|
|
use OCP\Settings\ISettings;
|
2020-05-17 12:29:44 +02:00
|
|
|
use OCP\IConfig;
|
|
|
|
use \OCP\IL10N;
|
2020-04-26 11:36:41 +02:00
|
|
|
|
|
|
|
class Personal implements ISettings
|
|
|
|
{
|
2020-05-17 12:29:44 +02:00
|
|
|
/** @var IConfig */
|
|
|
|
private $config;
|
|
|
|
|
|
|
|
/** @var IL10N */
|
|
|
|
private $l;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Admin constructor.
|
|
|
|
*
|
|
|
|
* @param IConfig $config
|
|
|
|
*/
|
|
|
|
public function __construct(IConfig $config, IL10N $l)
|
|
|
|
{
|
|
|
|
$this->config = $config;
|
|
|
|
$this->l = $l;
|
|
|
|
}
|
|
|
|
|
2020-04-26 11:36:41 +02:00
|
|
|
/**
|
|
|
|
* @return TemplateResponse
|
|
|
|
*/
|
|
|
|
public function getForm()
|
|
|
|
{
|
2020-05-17 12:29:44 +02:00
|
|
|
$warning = '';
|
|
|
|
|
|
|
|
if (empty($this->config->getAppValue('bbb', 'api.url')) || empty($this->config->getAppValue('bbb', 'api.secret'))) {
|
2020-05-22 09:33:30 +02:00
|
|
|
$warning = $this->l->t('API URL or secret not configured. Please contact your administrator.');
|
2020-05-17 12:29:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return new TemplateResponse('bbb', 'manager', ['warning' => $warning]);
|
2020-04-26 11:36:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string the section ID, e.g. 'sharing'
|
|
|
|
*/
|
|
|
|
public function getSection()
|
|
|
|
{
|
2020-04-26 13:26:34 +02:00
|
|
|
return 'bbb';
|
2020-04-26 11:36:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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.
|
|
|
|
*
|
|
|
|
* E.g.: 70
|
|
|
|
*/
|
|
|
|
public function getPriority()
|
|
|
|
{
|
|
|
|
return 50;
|
|
|
|
}
|
|
|
|
}
|