mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Provide Nextcloud dashboard widget code
This commit is contained in:
parent
02366067c0
commit
c9d0a530c2
1 changed files with 9 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ use OCP\Dashboard\Model\WidgetItem;
|
|||
use OCP\Dashboard\Model\WidgetOptions;
|
||||
use OCP\IL10N;
|
||||
use OCP\IURLGenerator;
|
||||
//use OCP\Util;
|
||||
|
||||
class UnreadMailWidget implements IAPIWidget, IIconWidget/*, IOptionWidget*/
|
||||
{
|
||||
|
|
@ -19,11 +20,14 @@ class UnreadMailWidget implements IAPIWidget, IIconWidget/*, IOptionWidget*/
|
|||
protected IURLGenerator $urlGenerator;
|
||||
protected IInitialState $initialState;
|
||||
|
||||
public function __construct(IL10N $l10n, IURLGenerator $urlGenerator, IInitialState $initialState)
|
||||
public function __construct(IL10N $l10n, IURLGenerator $urlGenerator,
|
||||
IInitialState $initialState,
|
||||
?string $userId)
|
||||
{
|
||||
$this->l10n = $l10n;
|
||||
$this->urlGenerator = $urlGenerator;
|
||||
$this->initialState = $initialState;
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
// IWidget
|
||||
|
|
@ -79,7 +83,10 @@ class UnreadMailWidget implements IAPIWidget, IIconWidget/*, IOptionWidget*/
|
|||
*/
|
||||
public function load(): void
|
||||
{
|
||||
// SnappyMailHelper::loadApp();
|
||||
// Util::addScript(Application::APP_ID, 'dashboard');
|
||||
if ($this->userId !== null) {
|
||||
$this->initialStateService->provideInitialState('dashboard-widget-items', $this->getItems($this->userId));
|
||||
}
|
||||
}
|
||||
|
||||
// IAPIWidget
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue