add constant Application::APP_ID
This commit is contained in:
parent
b6a3410dcf
commit
bb82a12362
|
@ -10,10 +10,11 @@ use OCP\AppFramework\Bootstrap\IBootContext;
|
|||
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
||||
|
||||
class Application extends App implements IBootstrap {
|
||||
public const APP_ID = 'notes';
|
||||
public static $API_VERSIONS = [ '0.2', '1.1' ];
|
||||
|
||||
public function __construct(array $urlParams = []) {
|
||||
parent::__construct('notes', $urlParams);
|
||||
parent::__construct(self::APP_ID, $urlParams);
|
||||
}
|
||||
|
||||
public function register(IRegistrationContext $context): void {
|
||||
|
|
|
@ -18,9 +18,9 @@ class Capabilities implements ICapability {
|
|||
|
||||
public function getCapabilities() {
|
||||
return [
|
||||
'notes' => [
|
||||
Application::APP_ID => [
|
||||
'api_version' => Application::$API_VERSIONS,
|
||||
'version' => $this->appManager->getAppVersion('notes'),
|
||||
'version' => $this->appManager->getAppVersion(Application::APP_ID),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ declare(strict_types=1);
|
|||
|
||||
namespace OCA\Notes\Service;
|
||||
|
||||
use OCA\Notes\AppInfo\Application;
|
||||
|
||||
use OCP\IConfig;
|
||||
use OCP\IL10N;
|
||||
use OCP\Files\IRootFolder;
|
||||
|
@ -55,11 +57,11 @@ class SettingsService {
|
|||
unset($settings[$name]);
|
||||
}
|
||||
}
|
||||
$this->config->setUserValue($uid, 'notes', 'settings', json_encode($settings));
|
||||
$this->config->setUserValue($uid, Application::APP_ID, 'settings', json_encode($settings));
|
||||
}
|
||||
|
||||
public function getAll(string $uid) : \stdClass {
|
||||
$settings = json_decode($this->config->getUserValue($uid, 'notes', 'settings'));
|
||||
$settings = json_decode($this->config->getUserValue($uid, Application::APP_ID, 'settings'));
|
||||
if (!is_object($settings)) {
|
||||
$settings = new \stdClass();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue