Initial commit: Minimal Profile app for Nextcloud 33
This commit is contained in:
30
lib/Controller/ApiController.php
Normal file
30
lib/Controller/ApiController.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user