30 lines
651 B
PHP
30 lines
651 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace OCA\MinimalProfile\Controller;
|
||
|
|
|
||
|
|
use OCP\AppFramework\Controller;
|
||
|
|
use OCP\AppFramework\Http\JSONResponse;
|
||
|
|
use OCP\IConfig;
|
||
|
|
use OCP\IRequest;
|
||
|
|
|
||
|
|
class ApiController extends Controller {
|
||
|
|
|
||
|
|
public function __construct(
|
||
|
|
string $appName,
|
||
|
|
IRequest $request,
|
||
|
|
private IConfig $config,
|
||
|
|
) {
|
||
|
|
parent::__construct($appName, $request);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getHiddenFields(): JSONResponse {
|
||
|
|
$value = $this->config->getAppValue('minimalprofile', 'hidden_fields', '');
|
||
|
|
$hiddenFields = $value !== '' ? json_decode($value, true) ?? [] : [];
|
||
|
|
|
||
|
|
return new JSONResponse([
|
||
|
|
'hiddenFields' => $hiddenFields,
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
}
|