Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/photos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2022-09-20 14:38:04 +0300
committerMarcel Klehr <mklehr@gmx.net>2022-09-20 14:38:04 +0300
commit3ba6d9048e08b2bd06664635c2b1958c210c97fb (patch)
tree7dccefff32d50126d26ece77ffa9024e3259a6cd
parentfbac64f0661eab9c2c0b24c83c4c74ecb39397ea (diff)
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
-rw-r--r--lib/AppInfo/Application.php2
-rw-r--r--lib/Dashboard/OnThisDay.php122
2 files changed, 58 insertions, 66 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
index 703fe1bf..bac44ca7 100644
--- a/lib/AppInfo/Application.php
+++ b/lib/AppInfo/Application.php
@@ -62,7 +62,7 @@ class Application extends App implements IBootstrap {
}
public function register(IRegistrationContext $context): void {
- $context->registerDashboardWidget(OnThisDay::class);
+ $context->registerDashboardWidget(OnThisDay::class);
/** Register $principalBackend for the DAV collection */
$context->registerServiceAlias('principalBackend', Principal::class);
$context->registerEventListener(NodeDeletedEvent::class, MoveToTrashListener::class);
diff --git a/lib/Dashboard/OnThisDay.php b/lib/Dashboard/OnThisDay.php
index b3ed0105..28afc899 100644
--- a/lib/Dashboard/OnThisDay.php
+++ b/lib/Dashboard/OnThisDay.php
@@ -1,80 +1,72 @@
<?php
+
namespace OCA\Photos\Dashboard;
use OCA\Photos\AppInfo\Application;
-use OCP\AppFramework\Services\IInitialState;
use OCP\IInitialStateService;
use OCP\Util;
-class OnThisDay implements \OCP\Dashboard\IWidget
-{
- /**
- * @var \OCP\IL10N
- */
- private $l;
- /**
- * @var \OCP\IURLGenerator
- */
- private $url;
- /**
- * @var \OCP\AppFramework\Services\IInitialState
- */
- private $initialState;
+class OnThisDay implements \OCP\Dashboard\IWidget {
+ /**
+ * @var \OCP\IL10N
+ */
+ private $l;
+ /**
+ * @var \OCP\IURLGenerator
+ */
+ private $url;
+ /**
+ * @var \OCP\AppFramework\Services\IInitialState
+ */
+ private $initialState;
- public function __construct(\OCP\IL10N $l, \OCP\IURLGenerator $url, IInitialStateService $initialState)
- {
- $this->l = $l;
- $this->url = $url;
- $this->initialState = $initialState;
- }
+ public function __construct(\OCP\IL10N $l, \OCP\IURLGenerator $url, IInitialStateService $initialState) {
+ $this->l = $l;
+ $this->url = $url;
+ $this->initialState = $initialState;
+ }
- /**
- * @inheritDoc
- */
- public function getId(): string
- {
- return 'photos.onthisday';
- }
+ /**
+ * @inheritDoc
+ */
+ public function getId(): string {
+ return 'photos.onthisday';
+ }
- /**
- * @inheritDoc
- */
- public function getTitle(): string
- {
- return $this->l->t('On This Day');
- }
+ /**
+ * @inheritDoc
+ */
+ public function getTitle(): string {
+ return $this->l->t('On This Day');
+ }
- /**
- * @inheritDoc
- */
- public function getOrder(): int
- {
- return 20;
- }
+ /**
+ * @inheritDoc
+ */
+ public function getOrder(): int {
+ return 20;
+ }
- /**
- * @inheritDoc
- */
- public function getIconClass(): string
- {
- return 'icon-calendar-dark';
- }
+ /**
+ * @inheritDoc
+ */
+ public function getIconClass(): string {
+ return 'icon-calendar-dark';
+ }
- /**
- * @inheritDoc
- */
- public function getUrl(): ?string
- {
- return $this->url->linkToRoute('photos.page.indexthisday');
- }
+ /**
+ * @inheritDoc
+ */
+ public function getUrl(): ?string {
+ return $this->url->linkToRoute('photos.page.indexthisday');
+ }
- /**
- * @inheritDoc
- */
- public function load(): void
- {
- Util::addScript('photos', 'photos-dashboard');
- $this->initialState->provideInitialState('photos', 'image-mimes', Application::IMAGE_MIMES);
- $this->initialState->provideInitialState('photos', 'video-mimes', Application::VIDEO_MIMES);
- }
+ /**
+ * @inheritDoc
+ */
+ public function load(): void {
+ Util::addScript('photos', 'photos-dashboard');
+ $this->initialState->provideInitialState('photos', 'image-mimes', Application::IMAGE_MIMES);
+ $this->initialState->provideInitialState('photos', 'video-mimes', Application::VIDEO_MIMES);
+ }
}