1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2024-11-24 22:42:46 +01:00
Nextcloud-News/lib/Settings/AdminSettings.php
Sean Molenaar 60ab4941cc Move to nextcloud config and update phpunit
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
2020-09-25 19:18:04 +02:00

48 lines
905 B
PHP

<?php
namespace OCA\News\Settings;
use OCA\News\AppInfo\Application;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\Settings\ISettings;
class AdminSettings implements ISettings
{
/**
* @var IConfig
*/
private $config;
public function __construct(IConfig $config)
{
$this->config = $config;
}
public function getForm()
{
$data = [];
foreach (array_keys(Application::DEFAULT_SETTINGS) as $setting) {
$data[$setting] = $this->config->getAppValue(
Application::NAME,
$setting,
Application::DEFAULT_SETTINGS[$setting]
);
}
return new TemplateResponse(Application::NAME, 'admin', $data);
}
public function getSection()
{
return 'news';
}
public function getPriority()
{
return 40;
}
}