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@cb
    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 = id:settingService@cb
    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 wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    true false
    any zipUtil


    • access = public
    • returntype = any
    • inject = zipUtil@cb
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    any activateTheme(any themeName)
         Activate a theme.
    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.
    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()
    struct getSettingsConstraints(any themeName)
         Get constraints for setting fields.
    string getSettingService()
    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()
    struct getThemes()
         Get all registered themes via the registry.
    string getThemeSearchLayout()
         Get the current theme's search layout.
    private array getThemesOnDisk(any path)
         Get all themes loaded on disk path, only returns directories.
    string getThemeWidgetInvocationPath(string widgetName)
         Returns the invocation path for the requested widget from themes service's layout cache.
    string getWidgetCache()
    string getWirebox()
    string getZipUtil()
    boolean isActiveTheme(any themeName)
         Is active theme check.
    void onDIComplete()
         onDIComplete startup the theming services according to loaded module data.
    private any registerThemeSettings(any name, array settings)
         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 setThemeRegistry(struct themeRegistry)
    any setWidgetCache(struct widgetCache)
    any setWirebox(any wirebox)
    any setZipUtil(any zipUtil)
    any startupActiveTheme()
         Startup Active Theme procedures.
    boolean themeMaintenanceViewExists()
         Does the current active theme have a maintenance view.
    private any unregisterThemeSettings(array settings)
         Unregister theme settings.
    struct uploadTheme(any fileField)
         Upload a theme to the custom themes location.
     
    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@cb
    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 - id:settingService@cb
    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

    wirebox

    property any wirebox

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

    zipUtil

    property any zipUtil

    Attributes:
    access - public
    required - false
    returntype - any
    inject - zipUtil@cb
    serializable - true

    Method Detail

    activateTheme

    public any activateTheme(any themeName)

    Activate a theme

    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


    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()


    getSettingsConstraints

    public struct getSettingsConstraints(any themeName)

    Get constraints for setting fields

    Parameters:
    themeName - The name of the theme

    getSettingService

    public string getSettingService()


    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()


    getThemes

    public struct getThemes()

    Get all registered themes via the registry.


    getThemeSearchLayout

    public string getThemeSearchLayout()

    Get the current theme's search layout


    getThemesOnDisk

    private array getThemesOnDisk(any path)

    Get all themes loaded on disk path, only returns directories

    Parameters:
    path - The path to check

    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

    getWidgetCache

    public string getWidgetCache()


    getWirebox

    public string getWirebox()


    getZipUtil

    public string getZipUtil()


    isActiveTheme

    public boolean isActiveTheme(any themeName)

    Is active theme check

    Parameters:
    themeName - The name of the theme to check

    onDIComplete

    public void onDIComplete()

    onDIComplete startup the theming services according to loaded module data


    registerThemeSettings

    private any registerThemeSettings(any name, array settings)

    Register a theme's settings

    Parameters:
    name - The theme name
    settings - The settings struct
    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

    setThemeRegistry

    public any setThemeRegistry(struct themeRegistry)

    Parameters:
    themeRegistry

    setWidgetCache

    public any setWidgetCache(struct widgetCache)

    Parameters:
    widgetCache

    setWirebox

    public any setWirebox(any wirebox)

    Parameters:
    wirebox

    setZipUtil

    public any setZipUtil(any zipUtil)

    Parameters:
    zipUtil

    startupActiveTheme

    public any startupActiveTheme()

    Startup Active Theme procedures


    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

    uploadTheme

    public struct uploadTheme(any fileField)

    Upload a theme to the custom themes location

    Parameters:
    fileField - The file uploaded field
    Returns:
    struct : { error:boolean, messages:string }