mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-12-01 07:37:18 +01:00
Just move some code
This commit is contained in:
@@ -33,8 +33,9 @@ use OCP\IL10N;
|
||||
use OCP\IURLGenerator;
|
||||
use OCP\IServerContainer;
|
||||
|
||||
use OCA\QuickNotes\Search\NoteSearchProvider;
|
||||
use OCA\QuickNotes\Dashboard\NotesWidget;
|
||||
use OCA\QuickNotes\Listeners\BeforeTemplateRenderedListener;
|
||||
use OCA\QuickNotes\Search\NoteSearchProvider;
|
||||
|
||||
class Application extends App implements IBootstrap {
|
||||
|
||||
@@ -51,7 +52,7 @@ class Application extends App implements IBootstrap {
|
||||
public function register(IRegistrationContext $context): void {
|
||||
$context->registerSearchProvider(NoteSearchProvider::class);
|
||||
$context->registerCapability(Capabilities::class);
|
||||
$context->registerDashboardWidget(DashboardWidget::class);
|
||||
$context->registerDashboardWidget(NotesWidget::class);
|
||||
$context->registerEventListener(
|
||||
BeforeTemplateRenderedEvent::class,
|
||||
BeforeTemplateRenderedListener::class
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\QuickNotes\AppInfo;
|
||||
|
||||
use OCP\Dashboard\IWidget;
|
||||
use OCP\IL10N;
|
||||
use OCP\IURLGenerator;
|
||||
|
||||
class DashboardWidget implements IWidget {
|
||||
|
||||
private IURLGenerator $url;
|
||||
private IL10N $l10n;
|
||||
|
||||
public function __construct(IURLGenerator $url,
|
||||
IL10N $l10n)
|
||||
{
|
||||
$this->url = $url;
|
||||
$this->l10n = $l10n;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getId(): string {
|
||||
return 'quicknotes';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getTitle(): string {
|
||||
return $this->l10n->t('Quick notes');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getOrder(): int {
|
||||
return 30;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getIconClass(): string {
|
||||
return 'icon-quicknotes';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getUrl(): ?string {
|
||||
return $this->url->linkToRouteAbsolute('quicknotes.page.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function load(): void {
|
||||
\OCP\Util::addScript('quicknotes', 'quicknotes-dashboard');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user