diff options
Diffstat (limited to 'lib/public/Dashboard/Model/WidgetItem.php')
-rw-r--r-- | lib/public/Dashboard/Model/WidgetItem.php | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/lib/public/Dashboard/Model/WidgetItem.php b/lib/public/Dashboard/Model/WidgetItem.php index 2bea9b93226..680daf1b114 100644 --- a/lib/public/Dashboard/Model/WidgetItem.php +++ b/lib/public/Dashboard/Model/WidgetItem.php @@ -3,25 +3,8 @@ declare(strict_types=1); /** - * @copyright 2021, Julien Veyssier <eneiluj@posteo.net> - * - * @author Julien Veyssier <eneiluj@posteo.net> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCP\Dashboard\Model; @@ -33,7 +16,7 @@ use JsonSerializable; * * This class is used by IAPIWidget interface. * It represents an widget item data that can be provided to clients via the Dashboard API - * @see IAPIWidget::getWidgetItems + * @see IAPIWidget::getItems * * @since 22.0.0 * @@ -56,24 +39,30 @@ final class WidgetItem implements JsonSerializable { */ private $sinceId = ''; + /** + * Overlay icon to show in the bottom right corner of {@see $iconUrl} + * + * @since 27.1.0 + */ + private string $overlayIconUrl = ''; /** * WidgetItem constructor * * @since 22.0.0 - * - * @param string $type */ public function __construct(string $title = '', - string $subtitle = '', - string $link = '', - string $iconUrl = '', - string $sinceId = '') { + string $subtitle = '', + string $link = '', + string $iconUrl = '', + string $sinceId = '', + string $overlayIconUrl = '') { $this->title = $title; $this->subtitle = $subtitle; $this->iconUrl = $iconUrl; $this->link = $link; $this->sinceId = $sinceId; + $this->overlayIconUrl = $overlayIconUrl; } /** @@ -133,9 +122,26 @@ final class WidgetItem implements JsonSerializable { } /** - * @since 22.0.0 + * Get the overlay icon url + * + * @since 27.1.0 * - * @return array + * @return string + */ + public function getOverlayIconUrl(): string { + return $this->overlayIconUrl; + } + + /** + * @since 22.0.0 + * @return array{ + * subtitle: string, + * title: string, + * link: string, + * iconUrl: string, + * overlayIconUrl: string, + * sinceId: string, + * } */ public function jsonSerialize(): array { return [ @@ -143,6 +149,7 @@ final class WidgetItem implements JsonSerializable { 'title' => $this->getTitle(), 'link' => $this->getLink(), 'iconUrl' => $this->getIconUrl(), + 'overlayIconUrl' => $this->getOverlayIconUrl(), 'sinceId' => $this->getSinceId(), ]; } |