net.i2p.router.web.helpers

## Class ConfigUIHelper

- java.lang.Object
- - net.i2p.router.web.HelperBase
  - - net.i2p.router.web.helpers.ConfigUIHelper

-     public class ConfigUIHelper
      extends HelperBase

  Helper class for rendering and processing user interface configuration pages in the I2P router console.

  This class provides methods to generate HTML for various UI configuration sections including:

  - Theme selection and display options
  - Mobile console settings
  - Language selection interface
  - Console password management forms

  The class extends `HelperBase` and uses the router context to access configuration properties and internationalization messages. All methods return HTML strings that can be directly embedded in JSP pages.

  Key functionality includes:

  - Scanning for available themes from filesystem and configuration
  - Managing language preferences with ISO 639-1/639-2 codes
  - Handling console authentication settings
  - Providing mobile console and app embedding options

- - ### Field Summary

    - ### Fields inherited from class net.i2p.router.web.HelperBase

      `_context, _out, CHECKED, PROP_ADVANCED, SELECTED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigUIHelper()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getForceMobileConsole()` Generates HTML for mobile console and app embedding configuration options.
    `String` | `getLangSettings()` Generates HTML for language selection interface.
    `String` | `getPasswordForm()` Generates HTML for console password management interface.
    `String` | `getSettings()` Generates HTML for theme selection and display options configuration.

    - ### Methods inherited from class net.i2p.router.web.HelperBase

      `_t, _t, _t, _x, getChecked, isAdvanced, ngettext, setContextId, storeWriter`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConfigUIHelper

          public ConfigUIHelper()

  - ### Method Detail

    - #### getForceMobileConsole

          public String getForceMobileConsole()

      Generates HTML for mobile console and app embedding configuration options.

      Renders checkboxes for:

      - Forcing the mobile console interface to be used
      - Embedding I2PSnark and I2PMail applications within the console

      Includes a tooltip recommendation to enable universal theming when embedding applications for consistent visual appearance.

      Returns:
        HTML string containing mobile console configuration options

    - #### getLangSettings

          public String getLangSettings()

      Generates HTML for language selection interface.

      Renders radio buttons for all available languages with their corresponding flag icons and display names. The current language is pre-selected based on the router's language configuration.

      Supports both ISO 639-1 two-letter codes and ISO 639-2 three-letter codes. Languages with country-specific variants include the country name in parentheses. The "Untagged strings" option is only shown for advanced users.

      Performs intelligent language matching by first trying the full language+country code, then falling back to the language-only code, and finally defaulting to English.

      Returns:
        HTML string containing the language selection interface with flags and labels

    - #### getPasswordForm

          public String getPasswordForm()

      Generates HTML for console password management interface.

      Renders a form for managing router console authentication including:

      - Display of existing configured users with deletion options
      - Input fields for adding new username and password
      - Help text for password recovery and configuration guidance

      The delete user button is hidden when no users are configured. When users exist, shows a table with checkboxes for removal and the current usernames. Always includes fields for adding new users.

      Returns:
        HTML string containing the password management form

    - #### getSettings

          public String getSettings()

      Generates HTML for theme selection and display options configuration.

      Renders a section containing:

      - Available theme selection with radio buttons and thumbnails
      - Universal theming checkbox for applying themes across all apps
      - Alternative font (Sora) selection option

      Themes are discovered from the filesystem and user configuration properties. The current theme is pre-selected based on router configuration.

      Returns:
        HTML string containing the theme selection interface