Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMenuToMapFromEtree ¶
AddMenuToMapFromEtree reads the menu from the given element and adds it to the given map.
func BootStrap ¶
func BootStrap()
BootStrap the menus by linking parents and children and populates the Registry
func LoadFromEtree ¶
LoadFromEtree reads the menu given etree.Element, creates or updates the menu and adds it to the menu registry if it not already.
Types ¶
type Collection ¶
A Collection is a hierarchical and sortable Collection of menus
var (
Registry *Collection
)
Registry is the menu Collection of the application
func NewCollection ¶
func NewCollection() *Collection
NewCollection returns a pointer to a new Collection instance
func (*Collection) GetByID ¶
func (mc *Collection) GetByID(id string) *Menu
GetByID returns the Menu with the given id
func (*Collection) Len ¶
func (mc *Collection) Len() int
func (*Collection) Less ¶
func (mc *Collection) Less(i, j int) bool
func (*Collection) Swap ¶
func (mc *Collection) Swap(i, j int)
type Menu ¶
type Menu struct { ID string Name string ParentID string Parent *Menu ParentCollection *Collection Children *Collection Sequence uint8 ActionID string Action *actions.Action HasChildren bool HasAction bool WebIcon string // contains filtered or unexported fields }
A Menu is the representation of a single menu item
func (Menu) TranslatedName ¶
TranslatedName returns the translated name of this menu in the given language
Click to show internal directories.
Click to hide internal directories.