nextcloud-app-radio/lib/Dashboard/RadioWidget.php
2020-11-10 14:37:36 +01:00

64 lines
1.0 KiB
PHP

<?php
namespace OCA\Radio\Dashboard;
use OCP\Dashboard\IWidget;
use OCP\IL10N;
use OCA\Radio\AppInfo\Application;
class RadioWidget implements IWidget {
/** @var IL10N */
private $l10n;
public function __construct(
IL10N $l10n
) {
$this->l10n = $l10n;
}
/**
* @inheritDoc
*/
public function getId(): string {
return 'radio';
}
/**
* @inheritDoc
*/
public function getTitle(): string {
return $this->l10n->t('Favorite Radio stations');
}
/**
* @inheritDoc
*/
public function getOrder(): int {
return 10;
}
/**
* @inheritDoc
*/
public function getIconClass(): string {
return 'icon-radio';
}
/**
* @inheritDoc
*/
public function getUrl(): ?string {
return \OC::$server->getURLGenerator()->linkToRoute('settings.PersonalSettings.index', ['section' => 'connected-accounts']);
}
/**
* @inheritDoc
*/
public function load(): void {
\OC_Util::addScript(Application::APP_ID, Application::APP_ID . '-dashboard');
\OC_Util::addStyle(Application::APP_ID, 'dashboard');
}
}