From 6dd3e52a9c9e0c71c71f90b04b0a085a0a5429f1 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 3 Sep 2021 00:26:55 +0100 Subject: [PATCH] feature-theme-gallery: fill in help text --- modules/feature-theme-gallery.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/feature-theme-gallery.php b/modules/feature-theme-gallery.php index abb4230..e8fb9dd 100644 --- a/modules/feature-theme-gallery.php +++ b/modules/feature-theme-gallery.php @@ -10,7 +10,7 @@ register_module([ "description" => "Adds a theme gallery page and optional automatic theme updates. Contacts a remote server, where IP addresses are stored in automatic server logs for security and attack mitigation purposes.", "id" => "feature-theme-gallery", "code" => function() { - global $settings; + global $settings, $env; /** * @api {get} ?action=theme-gallery Display the theme gallery * @apiName ThemeGallery @@ -40,7 +40,7 @@ register_module([ $result .= "
  • ".htmlentities($url)."
  • \n"; } $result .= " -

    ...with the following user agent string: ".ini_get("user_agent")."

    +

    ...with the following user agent string: ".htmlentities (ini_get("user_agent"))."

    No external HTTP requests will be made without your consent.

    Ok, load the gallery.

    Actually, take me back.

    "; @@ -178,12 +178,13 @@ register_module([ } http_response_code(200); - exit(page_renderer::render_main("Theme Changed - $settings->sitename", "

    $settings->sitename's theme was changed successfully to $settings->css_theme_gallery_selected_id.

    + exit(page_renderer::render_main("Theme Changed - $settings->sitename", "

    $settings->sitename's theme was changed successfully to ".htmlentities($settings->css_theme_gallery_selected_id).".

    Go to the homepage.

    ")); }); - // TODO: Fill this in properly - add_help_section("26-random-redirect", "Jumping to a random page", "

    $settings->sitename has a function that can send you to a random page. To use it, click here. $settings->admindetails_name ($settings->sitename's adminstrator) may have added it to one of the menus.

    "); + if($env->is_admin) add_help_section("945-theme-gallery", "Changing the theme", "

    $settings->sitename allows you to change the theme by selecting a theme from the public theme gallery. You can visit the theme gallery to take a look. The theme gallery does make a remote HTTP request, but a warning is displayed before this is performed. Once a theme is downloaded, occasional (but infrequent) HTTP requests are made to make sure it is up to date.

    +

    Note that when using a theme from the theme gallery, the internal theme is disabled. There is a button to disable any loaded theme gallery theme though.

    +

    The default theme has support for the prefers-color-scheme CSS media query, enabling it to be dark or light depending on your operating system preference.

    "); } ]);