diff options
author | Joas Schilling <coding@schilljs.com> | 2022-09-19 16:02:50 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-09-19 16:02:50 +0300 |
commit | 7d839d8820ee3ac56a8ea9f2a355e807d6b19aee (patch) | |
tree | c474eaef0ca479e38082bc15ffc7d46d822e0247 | |
parent | 6400a04317cd756af56653c33dc488ba65955591 (diff) |
Add options and buttons
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | lib/Dashboard/TalkWidget.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/Dashboard/TalkWidget.php b/lib/Dashboard/TalkWidget.php index 94a70897b..3516f7cc3 100644 --- a/lib/Dashboard/TalkWidget.php +++ b/lib/Dashboard/TalkWidget.php @@ -30,13 +30,17 @@ use OCA\Talk\Manager; use OCA\Talk\Room; use OCP\Comments\IComment; use OCP\Dashboard\IAPIWidget; +use OCP\Dashboard\IButtonWidget; use OCP\Dashboard\IIconWidget; +use OCP\Dashboard\IOptionWidget; +use OCP\Dashboard\Model\WidgetButton; use OCP\Dashboard\Model\WidgetItem; +use OCP\Dashboard\Model\WidgetOptions; use OCP\IL10N; use OCP\IURLGenerator; use OCP\Util; -class TalkWidget implements IAPIWidget, IIconWidget { +class TalkWidget implements IAPIWidget, IIconWidget, IButtonWidget, IOptionWidget { private IURLGenerator $url; private IL10N $l10n; private Manager $manager; @@ -82,6 +86,23 @@ class TalkWidget implements IAPIWidget, IIconWidget { return 'dashboard-talk-icon'; } + public function getWidgetOptions(): WidgetOptions { + return new WidgetOptions(true); + } + + /** + * @return \OCP\Dashboard\Model\WidgetButton[] + */ + public function getWidgetButtons(string $userId): array { + $buttons = []; + $buttons[] = new WidgetButton( + WidgetButton::TYPE_MORE, + $this->url->linkToRouteAbsolute('spreed.Page.index'), + $this->l10n->t('More unread mentions') + ); + return $buttons; + } + /** * @inheritDoc */ |