- appinfo/info.xml: Update app `<name>` to `nc_bot_web_hooks`. - lib/NavigationProvider.php: Update navigation entry name to `nc_bot_web_hooks`. - lib/Controller/WebhookController.php: Update all logger tags from `NCbotwebhooks:` to `nc_bot_web_hooks:`. - lib/Cron/ImageCleanup.php: Update logger tag to `nc_bot_web_hooks:`. - lib/Service/TalkService.php: Update all logger tags from `NCbotwebhooks:` to `nc_bot_web_hooks:`. - agent.md: Update references to app name and logger tags. - architecture.md: Update references to app name. - INSTALL.md: Update references to app name and example strings. - README.md: Restructure "Installation" section (split into Initial installation, Updating using git, Local update), add "Debugging" section with diagnostic grep examples, update app name references.
38 lines
1.1 KiB
PHP
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('nc_bot_webhooks'),
|
|
'href' => $this->urlGenerator->linkToRoute('settings.AdminSettings#index'),
|
|
'icon' => $this->urlGenerator->imagePath('nc_bot_webhooks', 'app.svg'),
|
|
'order' => 0,
|
|
],
|
|
];
|
|
}
|
|
}
|