From da9591f0b601acedbe46c220368e3eed2c251e89 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 10 Jul 2023 13:57:09 +0200 Subject: [PATCH] added closedwiki option This hides most of the wiki tools including the sidebar and search until the user has logged in. --- conf/default.php | 1 + conf/metadata.php | 1 + lang/en/settings.php | 1 + main.php | 23 +++++++++++++++-------- tpl/nav-usertools-buttons.php | 2 +- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/conf/default.php b/conf/default.php index 0617fd4..70bcae8 100755 --- a/conf/default.php +++ b/conf/default.php @@ -7,3 +7,4 @@ $conf['sidebar_sections'] = 'h1,h2,h3,h4,h5'; $conf['header_layout'] = 'header-default'; $conf['autocollapse'] = 1; +$conf['closedwiki'] = 0; diff --git a/conf/metadata.php b/conf/metadata.php index ed77775..f804194 100755 --- a/conf/metadata.php +++ b/conf/metadata.php @@ -19,3 +19,4 @@ $meta['header_layout'] = array( ); $meta['autocollapse'] = array('onoff'); +$meta['closedwiki'] = array('onoff'); diff --git a/lang/en/settings.php b/lang/en/settings.php index 6b09179..757d39b 100755 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -16,3 +16,4 @@ $lang['header_layout_o_default'] = 'generous header layout for long wiki titel $lang['header_layout_o_compact'] = 'compact header layout for short wiki title and hidden tagline'; $lang['autocollapse'] = 'Automatically collapse the sidebar when viewing non-content pages for more screen estate.'; +$lang['closedwiki'] = 'This is a closed wiki. Hide most wiki functionality before user has logged in.'; diff --git a/main.php b/main.php index b540656..2a10c1d 100755 --- a/main.php +++ b/main.php @@ -113,11 +113,13 @@ $classWideContent = (Template::getInstance())->fullWidthClass();
- + server->has('REMOTE_USER')) { ?> + + fullWidthClass();
-
+ server->has('REMOTE_USER')) { ?> +
@@ -248,7 +251,7 @@ $classWideContent = (Template::getInstance())->fullWidthClass();
- +
@@ -292,9 +295,11 @@ $classWideContent = (Template::getInstance())->fullWidthClass(); diff --git a/tpl/nav-usertools-buttons.php b/tpl/nav-usertools-buttons.php index 49c1d8a..5952401 100755 --- a/tpl/nav-usertools-buttons.php +++ b/tpl/nav-usertools-buttons.php @@ -16,7 +16,7 @@ if ($conf['useacl']): ?> try { $item = new Login(); if ($item->visibleInContext(AbstractItem::CTX_DESKTOP)) - echo '
  • ' . $item->asHtmlButton() . '
  • '; + echo '
  • ' . $item->asHtmlLink() . '
  • '; } catch (RuntimeException $ignored) { // item not available }