diff --git a/solid/appinfo/info.xml b/solid/appinfo/info.xml index 3c0abed..83a87d1 100644 --- a/solid/appinfo/info.xml +++ b/solid/appinfo/info.xml @@ -21,7 +21,8 @@ When you do this, the Solid App can store data in your Nextcloud account through - \OCA\Solid\Settings + OCA\Solid\Settings\SolidAdmin + OCA\Solid\Sections\SolidAdmin diff --git a/solid/lib/Sections/SolidAdmin.php b/solid/lib/Sections/SolidAdmin.php new file mode 100644 index 0000000..9d57740 --- /dev/null +++ b/solid/lib/Sections/SolidAdmin.php @@ -0,0 +1,32 @@ +l = $l; + $this->urlGenerator = $urlGenerator; + } + + public function getIcon(): string { + return $this->urlGenerator->imagePath('core', 'actions/settings-dark.svg'); + } + + public function getID(): string { + return 'solid'; + } + + public function getName(): string { + return $this->l->t('Solid'); + } + + public function getPriority(): int { + return 98; + } +} \ No newline at end of file diff --git a/solid/lib/Settings.php b/solid/lib/Settings.php deleted file mode 100644 index 7ab6dfb..0000000 --- a/solid/lib/Settings.php +++ /dev/null @@ -1,32 +0,0 @@ -config = $config; - } - - public function getForm() { - $response = new TemplateResponse('solid', 'admin'); - $response->setParams([ - 'privateKey' => $this->config->getPrivateKey(), - 'encryptionKey' => $this->config->getEncryptionKey() - ]); - return $response; - } - - public function getSection() { - return 'security'; - } - - public function getPriority() { - return 50; - } -} diff --git a/solid/lib/Settings/SolidAdmin.php b/solid/lib/Settings/SolidAdmin.php new file mode 100644 index 0000000..3aac4ef --- /dev/null +++ b/solid/lib/Settings/SolidAdmin.php @@ -0,0 +1,47 @@ +config = $config; + $this->l = $l; + $this->serverConfig = $serverConfig; + } + + /** + * @return TemplateResponse + */ + public function getForm() { + $parameters = [ + 'privateKey' => $this->serverConfig->getPrivateKey(), + 'encryptionKey' => $this->serverConfig->getEncryptionKey() + ]; + + return new TemplateResponse('solid', 'admin', $parameters, ''); + } + + public function getSection() { + return 'solid'; // Name of the previously created section. + } + + /** + * @return int whether the form should be rather on the top or bottom of + * the admin section. The forms are arranged in ascending order of the + * priority values. It is required to return a value between 0 and 100. + * + * E.g.: 70 + */ + public function getPriority() { + return 70; + } +}