contentbox.model.ui

Class AdminMenuService

railo-context.Component
        extended by contentbox.model.ui.AdminMenuService
Class Attributes:
  • threadsafe
  •  
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  

    ContentBox - A Modular Content Platform Copyright 2012 by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com Apache License, Version 2.0 Copyright Since [2012] [Luis Majano and Ortus Solutions,Corp] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Manages the admin menu services for the header and top menu

    Property Summary
    type property default serializable required
    any avatar
          Injected Avatar.

    • inject = coldbox:myplugin:Avatar@contentbox
    true false
    array headerMenu
          This holds the header menu structure.

    true false
    struct headerMenuMap
          This is a reference map of the headerMenu array.

    true false
    array topMenu
          This holds the top menu structure.

    true false
    struct topMenuMap
          This is a reference map of the topMenu array.

    true false
    Constructor Summary
    init(any requestService, any coldbox)
          Constructor.
    Method Summary
    AdminMenuService addHeaderMenu(any name, any label, [any title=''], [any href='javascript:null()'], [any target=''], [any permissions=''], [any data='[runtime expression]'], [any class=''])
         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=''])
         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=''])
         Add a sub level menu.
    AdminMenuService addTopMenu(any name, any label, [any title=''], [any href='javascript:null()'], [any target=''], [any permissions=''], [any data='[runtime expression]'], [any class=''])
         Add top level menus.
    any buildModuleLink(string module, string linkTo, [any queryString=''], [boolean ssl='false'])
         Build out ContentBox module links.
    any buildProfileLabel()
         Dynamic menu label.
    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.
    string getAvatar()
         get: Injected Avatar.
    string getHeaderMenu()
         get: This holds the header menu structure.
    string getHeaderMenuMap()
         get: This is a reference map of the headerMenu array.
    string getTopMenu()
         get: This holds the top menu structure.
    string getTopMenuMap()
         get: This is a reference map of the topMenu array.
    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)
         set: Injected Avatar.
    any setHeaderMenu(array headerMenu)
         set: This holds the header menu structure.
    any setHeaderMenuMap(struct headerMenuMap)
         set: This is a reference map of the headerMenu array.
    any setTopMenu(array topMenu)
         set: This holds the top menu structure.
    any setTopMenuMap(struct topMenuMap)
         set: This is a reference map of the topMenu array.
    AdminMenuService withHeaderMenu(any name)
         Use a header menu.
    AdminMenuService withTopMenu(any name)
     
    Methods inherited from class railo-context.Component
    None

    Constructor Detail

    init

    public init(any requestService, any coldbox)

    Constructor

    Parameters:
    requestService
    coldbox

    Property Detail

    avatar

    property any avatar

    Injected Avatar

    Attributes:
    required - false
    inject - coldbox:myplugin:Avatar@contentbox
    serializable - true

    headerMenu

    property array headerMenu

    This holds the header menu structure

    Attributes:
    required - false
    serializable - true

    headerMenuMap

    property struct headerMenuMap

    This is a reference map of the headerMenu array

    Attributes:
    required - false
    serializable - true

    topMenu

    property array topMenu

    This holds the top menu structure

    Attributes:
    required - false
    serializable - true

    topMenuMap

    property struct topMenuMap

    This is a reference map of the topMenu array

    Attributes:
    required - false
    serializable - true

    Method Detail

    addHeaderMenu

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

    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

    addHeaderSubMenu

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

    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

    addSubMenu

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

    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

    addTopMenu

    public AdminMenuService addTopMenu(any name, any label, [any title=''], [any href='javascript:null()'], [any target=''], [any permissions=''], [any data='[runtime expression]'], [any class=''])

    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

    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


    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


    getAvatar

    public string getAvatar()

    get: Injected Avatar


    getHeaderMenu

    public string getHeaderMenu()

    get: This holds the header menu structure


    getHeaderMenuMap

    public string getHeaderMenuMap()

    get: This is a reference map of the headerMenu array


    getTopMenu

    public string getTopMenu()

    get: This holds the top menu structure


    getTopMenuMap

    public string getTopMenuMap()

    get: This is a reference map of the topMenu array


    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)

    set: Injected Avatar

    Parameters:
    avatar

    setHeaderMenu

    public any setHeaderMenu(array headerMenu)

    set: This holds the header menu structure

    Parameters:
    headerMenu

    setHeaderMenuMap

    public any setHeaderMenuMap(struct headerMenuMap)

    set: This is a reference map of the headerMenu array

    Parameters:
    headerMenuMap

    setTopMenu

    public any setTopMenu(array topMenu)

    set: This holds the top menu structure

    Parameters:
    topMenu

    setTopMenuMap

    public any setTopMenuMap(struct topMenuMap)

    set: This is a reference map of the topMenu array

    Parameters:
    topMenuMap

    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