Files
nc_bot_webhooks/lib/NavigationProvider.php
T
kyle 19241c842d refactor: rename app from ncdiscordhook to nc_bot_webhooks
- Update namespace from OCA\NCdiscordhook to OCA\Ncbotwebhooks
- Update app ID, name, and namespace in appinfo/info.xml
- Update composer.json and autoload files
- Update CLI command names from ncdiscordhook:* to nc_bot_webhooks:*
- Update image directory name to nc_bot_webhooks-images
- Update documentation in README.md and INSTALL.md
- Update JavaScript APP_ID and navigation provider paths
- Update admin settings and controller app references
2026-06-12 18:30:12 -07:00

38 lines
1.1 KiB
PHP

<?php
namespace OCA\Ncbotwebhooks;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUserSession;
use OCP\Navigation\INavigationProvider;
class NavigationProvider implements INavigationProvider {
public function __construct(
private readonly IURLGenerator $urlGenerator,
private readonly IUserSession $userSession,
private readonly IConfig $config,
private readonly IL10N $l10n,
) {}
public function getNavigation(): array {
$user = $this->userSession->getUser();
if ($user === null || !$user->isAdmin()) {
return [];
}
return [
[
'id' => 'nc_bot_webhooks',
'app_id' => 'nc_bot_webhooks',
'type' => 'settings',
'name' => $this->l10n->t('NCbotwebhooks'),
'href' => $this->urlGenerator->linkToRoute('settings.AdminSettings#index'),
'icon' => $this->urlGenerator->imagePath('nc_bot_webhooks', 'app.svg'),
'order' => 0,
],
];
}
}