contentbox.models.ui

Class ThemeService

lucee.Component
    extended by contentbox.models.ui.ThemeService

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- Manages ContentBox themes

Class Attributes:
  • threadsafe
  •  
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any cbHelper


    • access = public
    • returntype = any
    • inject = provider:CBHelper@contentbox
    true false
    any coreThemesPath
          The location of core themes on disk: Defaults to /modules/contentbox/themes.

    • access = public
    • returntype = any
    true false
    any customThemesPath
          The location of custom themes on disk: Defaults to /modules_app/contentbox-custom/_themes.

    • access = public
    • returntype = any
    true false
    any html


    • access = public
    • returntype = any
    • inject = HTMLHelper@coldbox
    true false
    any interceptorService


    • access = public
    • returntype = any
    • inject = coldbox:interceptorService
    true false
    any log


    • access = public
    • returntype = any
    • inject = logbox:logger:{this}
    true false
    any moduleService


    • access = public
    • returntype = any
    • inject = coldbox:moduleService
    true false
    any moduleSettings


    • access = public
    • returntype = any
    • inject = coldbox:setting:modules
    true false
    any settingService


    • access = public
    • returntype = any
    • inject = settingService@contentbox
    true false
    any siteService


    • access = public
    • returntype = any
    • inject = siteService@contentbox
    true false
    struct themeRegistry
          The theme registry of records.

    • access = public
    • returntype = any
    true false
    struct widgetCache
          The cache of widgets for the active theme.

    • access = public
    • returntype = any
    true false
    any widgetService


    • access = public
    • returntype = any
    • inject = provider:widgetService@contentbox
    true false
    any wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    any activateTheme(any themeName)
         Activate a specific theme for the current working site.
    any buildSettingsForm(struct activeTheme)
         Build out the settings form HTML.
    ThemeService buildThemeRegistry()
         Build the theme registry via discovery.
    any generateModal(any settingName, any thisSettingMD)
         generateModal - Generate the modal for Theme Setting Help.
    struct getActiveTheme()
         Get the current active theme record for the current working site.
    string getCbHelper()
    string getCoreThemesPath()
    struct getCustomThemes()
         Get all registered custom themes via the registry.
    string getCustomThemesPath()
    string getHtml()
    string getInterceptorService()
    string getLog()
    string getModuleService()
    string getModuleSettings()
    string getSettingService()
    struct getSettingsConstraints(any themeName)
         Get constraints for setting fields.
    string getSiteService()
    string getThemeMaintenanceLayout()
         Get the current active theme's maintenance layout.
    string getThemePrintLayout(any format, any layout)
         Get the current theme's print layouts in ColdBox layout string format.
    struct getThemeRecord(any themeName)
         Get a theme record from the registry by name.
    string getThemeRegistry()
    string getThemeSearchLayout()
         Get the current theme's search layout.
    string getThemeWidgetInvocationPath(string widgetName)
         Returns the invocation path for the requested widget from themes service's layout cache.
    struct getThemes()
         Get all registered themes via the registry.
    private array getThemesOnDisk(any path)
         Get all themes loaded on disk path, only returns directories.
    string getWidgetCache()
    string getWidgetService()
    string getWirebox()
    boolean isActiveTheme(any themeName)
         Verify if the passed theme name is the currently working site active theme.
    void onDIComplete()
         onDIComplete startup the theming services according to loaded module data.
    any processThemeRecord([any name], [any path], [any invocationPath], [any includePath], [any type], [any module])
         Process a theme record and store appropriate data and cfc registries.
    private any registerThemeSettings(any name, array settings, any site)
         Register a theme's settings.
    boolean removeTheme(any themeName)
         Remove a custom theme only.
    any saveThemeSettings(any name, struct settings)
         Save theme settings as they are coming from form submissions as a struct with a common prefix.
    any setCbHelper(any cbHelper)
    any setCoreThemesPath(any coreThemesPath)
    any setCustomThemesPath(any customThemesPath)
    any setHtml(any html)
    any setInterceptorService(any interceptorService)
    any setLog(any log)
    any setModuleService(any moduleService)
    any setModuleSettings(any moduleSettings)
    any setSettingService(any settingService)
    any setSiteService(any siteService)
    any setThemeRegistry(struct themeRegistry)
    any setWidgetCache(struct widgetCache)
    any setWidgetService(any widgetService)
    any setWirebox(any wirebox)
    any startupSiteThemes()
         This method is called from the UI module to make sure all site themes are online before.
    any startupTheme(any name, [boolean processWidgets='true'], [any site=''])
         Startup a theme in the system, processes interceptions, modules, widgets, etc.
    boolean themeMaintenanceViewExists()
         Does the current active theme have a maintenance view.
    private any unregisterThemeSettings(array settings)
         Unregister theme settings.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    cbHelper

    property any cbHelper

    Attributes:
    access - public
    required - false
    returntype - any
    inject - provider:CBHelper@contentbox
    serializable - true

    coreThemesPath

    property any coreThemesPath

    The location of core themes on disk: Defaults to /modules/contentbox/themes

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    customThemesPath

    property any customThemesPath

    The location of custom themes on disk: Defaults to /modules_app/contentbox-custom/_themes

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    html

    property any html

    Attributes:
    access - public
    required - false
    returntype - any
    inject - HTMLHelper@coldbox
    serializable - true

    interceptorService

    property any interceptorService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:interceptorService
    serializable - true

    log

    property any log

    Attributes:
    access - public
    required - false
    returntype - any
    inject - logbox:logger:{this}
    serializable - true

    moduleService

    property any moduleService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:moduleService
    serializable - true

    moduleSettings

    property any moduleSettings

    Attributes:
    access - public
    required - false
    returntype - any
    inject - coldbox:setting:modules
    serializable - true

    settingService

    property any settingService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - settingService@contentbox
    serializable - true

    siteService

    property any siteService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - siteService@contentbox
    serializable - true

    themeRegistry

    property struct themeRegistry

    The theme registry of records

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    widgetCache

    property struct widgetCache

    The cache of widgets for the active theme

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    widgetService

    property any widgetService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - provider:widgetService@contentbox
    serializable - true

    wirebox

    property any wirebox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - wirebox
    serializable - true

    Method Detail

    activateTheme

    public any activateTheme(any themeName)

    Activate a specific theme for the current working site

    Parameters:
    themeName - The theme name to activate

    buildSettingsForm

    public any buildSettingsForm(struct activeTheme)

    Build out the settings form HTML

    Parameters:
    activeTheme - The active theme struct

    buildThemeRegistry

    public ThemeService buildThemeRegistry()

    Build the theme registry via discovery


    generateModal

    public any generateModal(any settingName, any thisSettingMD)

    generateModal - Generate the modal for Theme Setting Help

    Parameters:
    settingName - - The name of the setting the Theme Setting Help modal will be created for
    thisSettingMD - - The setting struct itself

    getActiveTheme

    public struct getActiveTheme()

    Get the current active theme record for the current working site


    getCbHelper

    public string getCbHelper()


    getCoreThemesPath

    public string getCoreThemesPath()


    getCustomThemes

    public struct getCustomThemes()

    Get all registered custom themes via the registry.


    getCustomThemesPath

    public string getCustomThemesPath()


    getHtml

    public string getHtml()


    getInterceptorService

    public string getInterceptorService()


    getLog

    public string getLog()


    getModuleService

    public string getModuleService()


    getModuleSettings

    public string getModuleSettings()


    getSettingService

    public string getSettingService()


    getSettingsConstraints

    public struct getSettingsConstraints(any themeName)

    Get constraints for setting fields

    Parameters:
    themeName - The name of the theme

    getSiteService

    public string getSiteService()


    getThemeMaintenanceLayout

    public string getThemeMaintenanceLayout()

    Get the current active theme's maintenance layout


    getThemePrintLayout

    public string getThemePrintLayout(any format, any layout)

    Get the current theme's print layouts in ColdBox layout string format

    Parameters:
    format - export format
    layout - layout name

    getThemeRecord

    public struct getThemeRecord(any themeName)

    Get a theme record from the registry by name.

    Parameters:
    themeName - The name of the theme

    getThemeRegistry

    public string getThemeRegistry()


    getThemeSearchLayout

    public string getThemeSearchLayout()

    Get the current theme's search layout


    getThemeWidgetInvocationPath

    public string getThemeWidgetInvocationPath(string widgetName)

    Returns the invocation path for the requested widget from themes service's layout cache

    Parameters:
    widgetName - The name of the widget

    getThemes

    public struct getThemes()

    Get all registered themes via the registry.


    getThemesOnDisk

    private array getThemesOnDisk(any path)

    Get all themes loaded on disk path, only returns directories

    Parameters:
    path - The path to check

    getWidgetCache

    public string getWidgetCache()


    getWidgetService

    public string getWidgetService()


    getWirebox

    public string getWirebox()


    isActiveTheme

    public boolean isActiveTheme(any themeName)

    Verify if the passed theme name is the currently working site active theme

    Parameters:
    themeName - The name of the theme to check

    onDIComplete

    public void onDIComplete()

    onDIComplete startup the theming services according to loaded module data


    processThemeRecord

    public any processThemeRecord([any name], [any path], [any invocationPath], [any includePath], [any type], [any module])

    Process a theme record and store appropriate data and cfc registries

    Parameters:
    name - The name of the theme on disk
    path - The path of the theme
    invocationPath - The invocation path of the theme
    includePath - The include path of the theme
    type - The type of theme it is: core, custom
    module - The module this theme exists under

    registerThemeSettings

    private any registerThemeSettings(any name, array settings, any site)

    Register a theme's settings

    Parameters:
    name - The theme name
    settings - The settings struct
    site - The site this theme is activated on
    Returns:
    ThemeService

    removeTheme

    public boolean removeTheme(any themeName)

    Remove a custom theme only.

    Parameters:
    themeName - The theme to remove

    saveThemeSettings

    public any saveThemeSettings(any name, struct settings)

    Save theme settings as they are coming from form submissions as a struct with a common prefix cb_theme_{themeName}_{settingName}

    Parameters:
    name - The theme name
    settings - The settings struct
    Returns:
    ThemeService

    setCbHelper

    public any setCbHelper(any cbHelper)

    Parameters:
    cbHelper

    setCoreThemesPath

    public any setCoreThemesPath(any coreThemesPath)

    Parameters:
    coreThemesPath

    setCustomThemesPath

    public any setCustomThemesPath(any customThemesPath)

    Parameters:
    customThemesPath

    setHtml

    public any setHtml(any html)

    Parameters:
    html

    setInterceptorService

    public any setInterceptorService(any interceptorService)

    Parameters:
    interceptorService

    setLog

    public any setLog(any log)

    Parameters:
    log

    setModuleService

    public any setModuleService(any moduleService)

    Parameters:
    moduleService

    setModuleSettings

    public any setModuleSettings(any moduleSettings)

    Parameters:
    moduleSettings

    setSettingService

    public any setSettingService(any settingService)

    Parameters:
    settingService

    setSiteService

    public any setSiteService(any siteService)

    Parameters:
    siteService

    setThemeRegistry

    public any setThemeRegistry(struct themeRegistry)

    Parameters:
    themeRegistry

    setWidgetCache

    public any setWidgetCache(struct widgetCache)

    Parameters:
    widgetCache

    setWidgetService

    public any setWidgetService(any widgetService)

    Parameters:
    widgetService

    setWirebox

    public any setWirebox(any wirebox)

    Parameters:
    wirebox

    startupSiteThemes

    public any startupSiteThemes()

    This method is called from the UI module to make sure all site themes are online before serving requets


    startupTheme

    public any startupTheme(any name, [boolean processWidgets='true'], [any site=''])

    Startup a theme in the system, processes interceptions, modules, widgets, etc

    Parameters:
    name - The name of the theme to activate
    processWidgets - Process widget registration on activation, defaults to true.
    site - The site id or object we are starting up this theme for

    themeMaintenanceViewExists

    public boolean themeMaintenanceViewExists()

    Does the current active theme have a maintenance view


    unregisterThemeSettings

    private any unregisterThemeSettings(array settings)

    Unregister theme settings

    Parameters:
    settings - The settings to unregister
    Returns:
    ThemeService