Initial commit: Minimal Profile app for Nextcloud 33
This commit is contained in:
25
lib/AppInfo/Application.php
Normal file
25
lib/AppInfo/Application.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\MinimalProfile\AppInfo;
|
||||
|
||||
use OCP\AppFramework\App;
|
||||
use OCP\AppFramework\Bootstrap\IBootContext;
|
||||
use OCP\AppFramework\Bootstrap\IBootstrap;
|
||||
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
||||
|
||||
class Application extends App implements IBootstrap {
|
||||
|
||||
public const APP_ID = 'minimalprofile';
|
||||
|
||||
public function __construct(array $urlParams = []) {
|
||||
parent::__construct(self::APP_ID, $urlParams);
|
||||
}
|
||||
|
||||
public function register(IRegistrationContext $context): void {
|
||||
}
|
||||
|
||||
public function boot(IBootContext $context): void {
|
||||
}
|
||||
}
|
||||
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