cloud_bbb/lib/Settings/Personal.php

63 lines
1.2 KiB
PHP
Raw Normal View History

2020-04-26 11:36:41 +02:00
<?php
namespace OCA\BigBlueButton\Settings;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Settings\ISettings;
use OCP\IConfig;
use \OCP\IL10N;
2020-04-26 11:36:41 +02:00
class Personal implements ISettings
{
/** @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()
{
$warning = '';
if (empty($this->config->getAppValue('bbb', 'api.url')) || empty($this->config->getAppValue('bbb', 'api.secret'))) {
$warning = $this->l->t('API URL or secret not configured. Please contact your administrator.');
}
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;
}
}