From fcc5a29733acf6be50020a3715ee200af1cd024b Mon Sep 17 00:00:00 2001 From: Raymond Hackley Date: Mon, 28 Jul 2025 10:14:09 +0000 Subject: [PATCH 1/3] img: add app-dark.svg Dark version of app.svg from 18615ebaed4c1e9b8d1a8c630768e1031c9f9cae Signed-off-by: Raymond Hackley --- img/app-dark.svg | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 img/app-dark.svg diff --git a/img/app-dark.svg b/img/app-dark.svg new file mode 100644 index 000000000..88ed5d12e --- /dev/null +++ b/img/app-dark.svg @@ -0,0 +1,12 @@ + + + + + + + + From d1accd8788a7bc7dbc641567bb3f4b789d381c4a Mon Sep 17 00:00:00 2001 From: Raymond Hackley Date: Mon, 28 Jul 2025 10:15:22 +0000 Subject: [PATCH 2/3] OCA\Passman\Notifier: setIcon() Set the icon for the notification. Signed-off-by: Raymond Hackley --- lib/Notifier.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Notifier.php b/lib/Notifier.php index d5beddec8..481451084 100644 --- a/lib/Notifier.php +++ b/lib/Notifier.php @@ -23,6 +23,7 @@ namespace OCA\Passman; +use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; @@ -31,6 +32,7 @@ class Notifier implements INotifier { public function __construct( protected IFactory $factory, + protected IURLGenerator $url, ) { } @@ -47,6 +49,11 @@ public function prepare(INotification $notification, string $languageCode): INot // Read the language from the notification $l = $this->factory->get('passman', $languageCode); + // Set the icon for the notification + $notification->setIcon( + $this->url->getAbsoluteURL($this->url->imagePath('passman', 'app-dark.svg')) + ); + switch ($notification->getSubject()) { // Deal with known subjects case 'credential_expired': From 0513ee019825fa1ba811b83c6ac85685f0525907 Mon Sep 17 00:00:00 2001 From: Raymond Hackley Date: Mon, 28 Jul 2025 10:16:05 +0000 Subject: [PATCH 3/3] OCA\Passman\Settings: add AdminSection Also rename the section from 'additional' to 'passman'. Signed-off-by: Raymond Hackley --- appinfo/info.xml | 1 + lib/Controller/SettingsController.php | 2 +- lib/Settings/Admin.php | 2 +- lib/Settings/AdminSection.php | 58 +++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 lib/Settings/AdminSection.php diff --git a/appinfo/info.xml b/appinfo/info.xml index 3c350f161..c3e3c5f37 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -65,5 +65,6 @@ For an demo of this app visit [https://demo.passman.cc](https://demo.passman.cc) OCA\Passman\Settings\Admin + OCA\Passman\Settings\AdminSection diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 1c97b882e..f46cbb996 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -46,7 +46,7 @@ public function getForm() { * @return string the section ID, e.g. 'sharing' */ public function getSection() { - return 'additional'; + return 'passman'; } /** diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index ec7cb60ad..99b0b2b3a 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -95,7 +95,7 @@ public function getForm(): TemplateResponse { * @return string */ public function getSection(): string { - return 'additional'; + return 'passman'; } /** diff --git a/lib/Settings/AdminSection.php b/lib/Settings/AdminSection.php new file mode 100644 index 000000000..ef8f47a05 --- /dev/null +++ b/lib/Settings/AdminSection.php @@ -0,0 +1,58 @@ +appName; + } + + /** + * returns the translated name as it should be displayed, e.g. 'LDAP / AD + * integration'. Use the L10N service to translate it. + * + * @return string + */ + public function getName() { + return $this->l->t('Passman'); + } + + /** + * @return int whether the form should be rather on the top or bottom of + * the settings navigation. The sections are arranged in ascending order of + * the priority values. It is required to return a value between 0 and 99. + * + * E.g.: 70 + */ + public function getPriority() { + return 70; + } + + /** + * {@inheritdoc} + */ + public function getIcon() { + return $this->url->imagePath($this->appName, 'app-dark.svg'); + } +}