cloud_bbb/lib/Settings/Admin.php

52 lines
1.1 KiB
PHP
Raw Normal View History

2020-04-26 11:36:41 +02:00
<?php
2020-04-26 11:36:41 +02:00
namespace OCA\BigBlueButton\Settings;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\Settings\ISettings;
class Admin implements ISettings {
2020-04-26 11:36:41 +02:00
/** @var IConfig */
2020-04-26 11:36:41 +02:00
private $config;
/**
* Admin constructor.
*
* @param IConfig $config
*/
public function __construct(IConfig $config) {
2020-04-26 11:36:41 +02:00
$this->config = $config;
}
/**
* @return TemplateResponse
*/
public function getForm() {
2020-04-26 11:36:41 +02:00
$parameters = [
'api.url' => $this->config->getAppValue('bbb', 'api.url'),
'api.secret' => $this->config->getAppValue('bbb', 'api.secret'),
'app.navigation' => $this->config->getAppValue('bbb', 'app.navigation') === 'true' ? 'checked' : '',
];
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'
*/
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.
*/
public function getPriority() {
2020-04-26 11:36:41 +02:00
return 50;
}
}