mirror of
https://github.com/nextcloud/integration_moodle.git
synced 2025-12-17 21:02:05 +01:00
48 lines
1 KiB
PHP
48 lines
1 KiB
PHP
<?php
|
|
namespace OCA\Moodle\Settings;
|
|
|
|
use OCP\AppFramework\Http\TemplateResponse;
|
|
use OCP\AppFramework\Services\IInitialState;
|
|
use OCP\IConfig;
|
|
use OCP\Settings\ISettings;
|
|
|
|
use OCA\Moodle\AppInfo\Application;
|
|
|
|
class Admin implements ISettings {
|
|
|
|
/**
|
|
* @var IConfig
|
|
*/
|
|
private $config;
|
|
/**
|
|
* @var IInitialState
|
|
*/
|
|
private $initialStateService;
|
|
|
|
public function __construct(IConfig $config,
|
|
IInitialState $initialStateService) {
|
|
$this->config = $config;
|
|
$this->initialStateService = $initialStateService;
|
|
}
|
|
|
|
/**
|
|
* @return TemplateResponse
|
|
*/
|
|
public function getForm(): TemplateResponse {
|
|
$searchDisabled = $this->config->getAppValue(Application::APP_ID, 'search_disabled', '0') === '1';
|
|
|
|
$adminConfig = [
|
|
'search_disabled' => $searchDisabled,
|
|
];
|
|
$this->initialStateService->provideInitialState('admin-config', $adminConfig);
|
|
return new TemplateResponse(Application::APP_ID, 'adminSettings');
|
|
}
|
|
|
|
public function getSection(): string {
|
|
return 'connected-accounts';
|
|
}
|
|
|
|
public function getPriority(): int {
|
|
return 10;
|
|
}
|
|
}
|