Skip to content

Commit 2e3bb89

Browse files
committed
Add load method for apps to bootstrap their panels
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent 226fbf8 commit 2e3bb89

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

lib/private/Dashboard/Manager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function loadLazyPanels(): void {
6262
try {
6363
/** @var IPanel $panel */
6464
$panel = $this->serverContainer->query($class);
65+
$panel->load();
6566
} catch (QueryException $e) {
6667
/*
6768
* There is a circular dependency between the logger and the registry, so

lib/public/Dashboard/IPanel.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,37 @@
3232
interface IPanel {
3333

3434
/**
35-
* @return string
35+
* @return string Unique id that identifies the panel, e.g. the app id
3636
* @since 20.0.0
3737
*/
3838
public function getId(): string;
3939

4040
/**
41-
* @return string
41+
* @return string User facing title of the panel
4242
* @since 20.0.0
4343
*/
4444
public function getTitle(): string;
4545

4646
/**
47-
* @return int
47+
* @return int Initial order for panel sorting
4848
* @since 20.0.0
4949
*/
5050
public function getOrder(): int;
5151

5252
/**
53-
* @return string
53+
* @return string css class that displays an icon next to the panel title
5454
* @since 20.0.0
5555
*/
5656
public function getIconClass(): string;
5757

5858
/**
59-
* @return string The absolute url to the apps own view
59+
* @return string|null The absolute url to the apps own view
6060
* @since 20.0.0
6161
*/
62-
public function getUrl(): string;
62+
public function getUrl(): ?string;
63+
64+
/**
65+
* Execute panel bootstrap code like loading scripts and providing initial state
66+
*/
67+
public function load(): void;
6368
}

0 commit comments

Comments
 (0)