contentbox.models.ui

Class AdminMenuService

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

ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- Manages the admin menu services for the header and top menu

Class Attributes:
  • threadsafe
  •  
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any avatar
          Injected Avatar.

    • access = public
    • returntype = any
    • inject = Avatar@cb
    true false
    array headerMenu
          This holds the header menu structure.

    • access = public
    • returntype = any
    true false
    struct headerMenuMap
          This is a reference map of the headerMenu array.

    • access = public
    • returntype = any
    true false
    array profileMenu
          This holds the profile menu structure.

    • access = public
    • returntype = any
    true false
    array supportMenu
          This holds the support menu structure.

    • access = public
    • returntype = any
    true false
    array topMenu
          This holds the top menu structure.

    • access = public
    • returntype = any
    true false
    struct topMenuMap
          This is a reference map of the topMenu array.

    • access = public
    • returntype = any
    true false
    array utilsMenu
          This holds the utils menu structure.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init(any requestService, any coldbox)
          Constructor.
    Method Summary
    AdminMenuService addHeaderMenu(any name, any label, [any title=''], [any href='javascript:void( null )'], [any target=''], [any permissions=''], [any data='[runtime expression]'], [any class=''], [any id=''], [any itemType='a'], [any itemClass=''], [any itemId=''])
         Add header top level menu.
    AdminMenuService addHeaderSubMenu([any headerMenu], any name, any label, [any title=''], [any href='#'], [any target=''], [any permissions=''], [any data='[runtime expression]'], [any class=''], [any iid=''], [any itemType='a'], [any itemClass=''], [any itemId=''])
         Add a sub level header menu.
    AdminMenuService addSubMenu([any topMenu], any name, any label, [any title=''], [any href='#'], [any target=''], [any permissions=''], [any data='[runtime expression]'], [any class=''], [any id=''], [any itemType='a'], [any itemClass=''], [any itemId=''])
         Add a sub level menu.
    AdminMenuService addTopMenu(any name, any label, [any title=''], [any href='#'], [any target=''], [any permissions=''], [any data='[runtime expression]'], [any class=''], [any id=''], [any itemType='a'], [any itemClass=''], [any itemId=''])
         Add top level menus.
    any buildItemAttributes(any event, any menu, [any structDefaults='[runtime expression]'])
         Build Item Attributes.
    any buildLIAttributes(any event, any menu)
         Build LI attributes.
    any buildLink(any menu, any event)
         Dynamic href's due to cgi host or site changes.
    any buildModuleLink(string module, string linkTo, [any queryString=''], [boolean ssl='false'])
         Build out ContentBox module links.
    any buildProfileLabel()
         Dynamic menu label.
    any createAttributeList(struct attributes)
         Create the attribute list.
    AdminMenuService createDefaultMenu()
         Create the default ContentBox menu.
    AdminMenuService createHeaderMenu()
         Create the default ContentBox header menu contributions.
    any generateHeaderMenu()
         Generate the header menu.
    any generateMenu()
         Generate menu from cache or newly generated menu.
    any generateProfileMenu()
    any generateSupportMenu()
    any generateUtilsMenu()
    string getAvatar()
    string getHeaderMenu()
    string getHeaderMenuMap()
    string getProfileMenu()
    string getSupportMenu()
    string getTopMenu()
    string getTopMenuMap()
    string getUtilsMenu()
    string parseADataAttributes(struct data)
         Generate a flat representation of data elements.
    AdminMenuService removeHeaderMenu(any headerMenu)
         Remove a header top level menu.
    AdminMenuService removeHeaderSubMenu(any headerMenu, any name)
         Remove a sub level menu from the header.
    AdminMenuService removeSubMenu(any topMenu, any name)
         Remove a sub level menu.
    AdminMenuService removeTopMenu(any topMenu)
         Remove a top level menu.
    any setAvatar(any avatar)
    any setHeaderMenu(array headerMenu)
    any setHeaderMenuMap(struct headerMenuMap)
    any setProfileMenu(array profileMenu)
    any setSupportMenu(array supportMenu)
    any setTopMenu(array topMenu)
    any setTopMenuMap(struct topMenuMap)
    any setUtilsMenu(array utilsMenu)
    AdminMenuService withHeaderMenu(any name)
         Use a header menu.
    AdminMenuService withTopMenu(any name)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any requestService, any coldbox)

    Constructor

    Parameters:
    requestService
    coldbox

    Property Detail

    avatar

    property any avatar

    Injected Avatar

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

    headerMenu

    property array headerMenu

    This holds the header menu structure

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

    headerMenuMap

    property struct headerMenuMap

    This is a reference map of the headerMenu array

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

    profileMenu

    property array profileMenu

    This holds the profile menu structure

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

    supportMenu

    property array supportMenu

    This holds the support menu structure

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

    topMenu

    property array topMenu

    This holds the top menu structure

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

    topMenuMap

    property struct topMenuMap

    This is a reference map of the topMenu array

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

    utilsMenu

    property array utilsMenu

    This holds the utils menu structure

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

    Method Detail

    addHeaderMenu

    public AdminMenuService addHeaderMenu(any name, any label, [any title=''], [any href='javascript:void( null )'], [any target=''], [any permissions=''], [any data='[runtime expression]'], [any class=''], [any id=''], [any itemType='a'], [any itemClass=''], [any itemId=''])

    Add header top level menu

    Parameters:
    name - The unique name for this header level menu
    label - The label for the menu item, this can be a closure/udf and it will be called at generation
    title - The optional title element
    href - The href, if any to locate when clicked, this can be a closure/udf and it will be called at generation
    target - The target to execute the link in, default is same page.
    permissions - The list of permissions needed to view this menu
    data - A structure of data attributes to add to the link
    class - A CSS class list to append to the element
    id - An id to apply to the element
    itemType - The type of element to create (e.g., a tag, button, etc.)
    itemClass - A CSS class list to append to the element
    itemId - An id to apply to the item element

    addHeaderSubMenu

    public AdminMenuService addHeaderSubMenu([any headerMenu], any name, any label, [any title=''], [any href='#'], [any target=''], [any permissions=''], [any data='[runtime expression]'], [any class=''], [any iid=''], [any itemType='a'], [any itemClass=''], [any itemId=''])

    Add a sub level header menu

    Parameters:
    headerMenu - The optional header menu name to add this sub level menu to or if concatenated then it uses that one.
    name - The unique name for this sub level menu
    label - The label for the menu item
    title - The optional title element
    href - The href, if any to locate when clicked
    target - The target to execute the link in, default is same page.
    permissions - The list of permissions needed to view this menu
    data - A structure of data attributes to add to the link
    class - A CSS class list to append to the element
    iid
    itemType - The type of element to create (e.g., a tag, button, etc.)
    itemClass - A CSS class list to append to the element
    itemId - An id to apply to the item element

    addSubMenu

    public AdminMenuService addSubMenu([any topMenu], any name, any label, [any title=''], [any href='#'], [any target=''], [any permissions=''], [any data='[runtime expression]'], [any class=''], [any id=''], [any itemType='a'], [any itemClass=''], [any itemId=''])

    Add a sub level menu

    Parameters:
    topMenu - The optional top menu name to add this sub level menu to or if concatenated then it uses that one.
    name - The unique name for this sub level menu
    label - The label for the menu item, this can be a closure/udf and it will be called at generation
    title - The optional title element
    href - The href, if any to locate when clicked, this can be a closure/udf and it will be called at generation
    target - The target to execute the link in, default is same page.
    permissions - The list of permissions needed to view this menu
    data - A structure of data attributes to add to the link
    class - A CSS class list to append to the element
    id - An id to apply to the element
    itemType - The type of element to create (e.g., a tag, button, etc.)
    itemClass - A CSS class list to append to the element
    itemId - An id to apply to the item element

    addTopMenu

    public AdminMenuService addTopMenu(any name, any label, [any title=''], [any href='#'], [any target=''], [any permissions=''], [any data='[runtime expression]'], [any class=''], [any id=''], [any itemType='a'], [any itemClass=''], [any itemId=''])

    Add top level menus

    Parameters:
    name - The unique name for this top level menu
    label - The label for the menu item, this can be a closure/udf and it will be called at generation
    title - The optional title element
    href - The href, if any to locate when clicked, this can be a closure/udf and it will be called at generation
    target - The target to execute the link in, default is same page.
    permissions - The list of permissions needed to view this menu
    data - A structure of data attributes to add to the link
    class - A CSS class list to append to the element
    id - An id to apply to the element
    itemType - The type of element to create (e.g., a tag, button, etc.)
    itemClass - A CSS class list to append to the element
    itemId - An id to apply to the item element

    buildItemAttributes

    public any buildItemAttributes(any event, any menu, [any structDefaults='[runtime expression]'])

    Build Item Attributes

    Parameters:
    event - The event context
    menu - The menu struct
    structDefaults - The struct defaults for the item

    buildLIAttributes

    public any buildLIAttributes(any event, any menu)

    Build LI attributes

    Parameters:
    event - The event context
    menu - The menu struct

    buildLink

    public any buildLink(any menu, any event)

    Dynamic href's due to cgi host or site changes. This expects a menu.href_to to exist.

    Parameters:
    menu - The menu info
    event - The request context

    buildModuleLink

    public any buildModuleLink(string module, string linkTo, [any queryString=''], [boolean ssl='false'])

    Build out ContentBox module links

    Parameters:
    module
    linkTo
    queryString
    ssl

    buildProfileLabel

    public any buildProfileLabel()

    Dynamic menu label


    createAttributeList

    public any createAttributeList(struct attributes)

    Create the attribute list

    Parameters:
    attributes - The struct of attributes to build the list from

    createDefaultMenu

    public AdminMenuService createDefaultMenu()

    Create the default ContentBox menu


    createHeaderMenu

    public AdminMenuService createHeaderMenu()

    Create the default ContentBox header menu contributions


    generateHeaderMenu

    public any generateHeaderMenu()

    Generate the header menu


    generateMenu

    public any generateMenu()

    Generate menu from cache or newly generated menu


    generateProfileMenu

    public any generateProfileMenu()


    generateSupportMenu

    public any generateSupportMenu()


    generateUtilsMenu

    public any generateUtilsMenu()


    getAvatar

    public string getAvatar()


    getHeaderMenu

    public string getHeaderMenu()


    getHeaderMenuMap

    public string getHeaderMenuMap()


    getProfileMenu

    public string getProfileMenu()


    getSupportMenu

    public string getSupportMenu()


    getTopMenu

    public string getTopMenu()


    getTopMenuMap

    public string getTopMenuMap()


    getUtilsMenu

    public string getUtilsMenu()


    parseADataAttributes

    public string parseADataAttributes(struct data)

    Generate a flat representation of data elements

    Parameters:
    data - The data struct

    removeHeaderMenu

    public AdminMenuService removeHeaderMenu(any headerMenu)

    Remove a header top level menu

    Parameters:
    headerMenu - The header menu unique name to remove

    removeHeaderSubMenu

    public AdminMenuService removeHeaderSubMenu(any headerMenu, any name)

    Remove a sub level menu from the header

    Parameters:
    headerMenu - The optional header menu name to remove from
    name - The sub menu to remove

    removeSubMenu

    public AdminMenuService removeSubMenu(any topMenu, any name)

    Remove a sub level menu

    Parameters:
    topMenu - The optional top menu name to add this sub level menu to or if concatenated then it uses that one.
    name - The unique name for this sub level menu

    removeTopMenu

    public AdminMenuService removeTopMenu(any topMenu)

    Remove a top level menu

    Parameters:
    topMenu - The optional top menu name to add this sub level menu to or if concatenated then it uses that one.

    setAvatar

    public any setAvatar(any avatar)

    Parameters:
    avatar

    setHeaderMenu

    public any setHeaderMenu(array headerMenu)

    Parameters:
    headerMenu

    setHeaderMenuMap

    public any setHeaderMenuMap(struct headerMenuMap)

    Parameters:
    headerMenuMap

    setProfileMenu

    public any setProfileMenu(array profileMenu)

    Parameters:
    profileMenu

    setSupportMenu

    public any setSupportMenu(array supportMenu)

    Parameters:
    supportMenu

    setTopMenu

    public any setTopMenu(array topMenu)

    Parameters:
    topMenu

    setTopMenuMap

    public any setTopMenuMap(struct topMenuMap)

    Parameters:
    topMenuMap

    setUtilsMenu

    public any setUtilsMenu(array utilsMenu)

    Parameters:
    utilsMenu

    withHeaderMenu

    public AdminMenuService withHeaderMenu(any name)

    Use a header menu

    Parameters:
    name - The name of the header menu

    withTopMenu

    public AdminMenuService withTopMenu(any name)

    Parameters:
    name - The name of the top menu