From b28469ada4695f722bf0dfe9cda840ea13355a88 Mon Sep 17 00:00:00 2001 From: sualko Date: Wed, 24 Feb 2021 14:36:37 +0100 Subject: [PATCH] feat: make nav label configurable fix #124 --- README.md | 21 +++++++++++++++++++-- lib/AppInfo/Application.php | 10 ++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b7a66ed..8b1caa1 100644 --- a/README.md +++ b/README.md @@ -63,11 +63,28 @@ configuration page of your Nextcloud instance. ![Screenshot admin section](https://github.com/sualko/cloud_bbb/raw/master/docs/screenshot-admin.png) -## Create your first room +### Manual configuration (for experts) +If you prefer not to use the web interface for configuration, you will find all +used configuration keys in the list below. Please beware that there will be no +check if those values are correct. Therefore this is not the recommended way. +The syntax to set all settings is `occ config:app:set bbb KEY --value "VALUE"`. + +Key | Description +--------------------- | ------------------------------------------------------------------------------------ +`app.navigation` | Set to `true` to show navigation entry +`app.navigation.name` | Defines the navigation label. Default "BigBlueButton". +`api.url` | URL to your BBB server. Should start with `https://` +`api.secret` | Secret of your BBB server +`app.shortener` | Value of your shortener service. Should start with `https://` and contain `{token}`. + + +## :bowtie: User guide + +### Create your first room Go to the BigBlueButton section inside your personal settings page and enter a room name. That's it. You can now distribute the room url. -## Enter a room from files +### Enter a room from files Use the ... menu and select the desired BBB configuration to enter the room. Beware that if the room is already running the presentation will **not** be updated. Entering a room with a defined presentation works only if link shares diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index b61b34c..207e21c 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -43,7 +43,9 @@ class Application extends App { $config = $container->query(IConfig::class); if ($config->getAppValue(self::ID, 'app.navigation') === 'true') { - $this->registerAsNavigationEntry(); + $name = $config->getAppValue(self::ID, 'app.navigation.name', 'BigBlueButton'); + + $this->registerAsNavigationEntry($name); } else { $this->registerAsPersonalSetting(); } @@ -56,16 +58,16 @@ class Application extends App { $settingsManager->registerSetting(ISettingsManager::KEY_PERSONAL_SETTINGS, \OCA\BigBlueButton\Settings\Personal::class); } - private function registerAsNavigationEntry() { + private function registerAsNavigationEntry(string $name) { $server = $this->getContainer()->getServer(); - $server->getNavigationManager()->add(function () use ($server) { + $server->getNavigationManager()->add(function () use ($server, $name) { return [ 'id' => self::ID, 'order' => 80, 'href' => $server->getURLGenerator()->linkToRoute('bbb.page.index'), 'icon' => $server->getURLGenerator()->imagePath('bbb', 'app.svg'), - 'name' => 'BigBlueButton', + 'name' => $name, ]; }); }