1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2025-08-13 08:16:59 +02:00
Files
.github
.tx
appinfo
bin
css
docs
img
js
l10n
lib
AppInfo
Command
Config
Controller
Cron
Db
Explore
Fetcher
Hooks
Migration
Plugin
Scraper
Search
Service
Settings
AdminSection.php
AdminSettings.php
Utility
screenshots
templates
tests
.editorconfig
.gitignore
.mailmap
AUTHORS.md
CHANGELOG.md
CONTRIBUTING.md
COPYING
Makefile
README.md
composer.json
composer.lock
mkdocs.yml
phpstan.neon.dist
phpunit.xml
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;
}
}