Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow plugins to add items and sections at a given position in a existing section. Examples: initializer 'plugin' do # create custom section with 2 custom items Menu::CustomLoader.register( Menu::Section.new(:spike, N_('Plugin'), 'fa fa-map-pin', [ Menu::Item.new('plug1', N_('Test'), 'miq_report', {:feature => 'miq_report', :any => true}, '/plug'), Menu::Item.new('plug2', N_('Demo'), 'miq_report', {:feature => 'miq_report', :any => true}, '/demo') ]) ) # create custom item placed in an existing section 'vi' (Cloud Intel) Menu::CustomLoader.register( Menu::Item.new('plug3', N_('Plug Item'), 'miq_report', {:feature => 'miq_report', :any => true}, '/demo', :default, :vi) ) # create custom section and place it before existing section 'compute' (Compute) Menu::CustomLoader.register( Menu::Section.new(:spike3, N_('Plugin 2'), 'fa fa-map-pin', [ Menu::Item.new('plug4', N_('Demo'), 'miq_report', {:feature => 'miq_report', :any => true}, '/demo') ], :default, :compute) ) # create custom section and place it inside an existing section 'compute' (Compute), before existing subsection 'clo' (Cloud) Menu::CustomLoader.register( # Struct.new(:id, :name, :icon, :items, :placement, :before, :type, :href, :parent_id Menu::Section.new(:spike3, N_('Nested section after'), 'fa fa-map-pin', [ Menu::Item.new('plug5', N_('Test item'), 'miq_report', {:feature => 'miq_report', :any => true}, '/demo') ], :default, :clo, :default, nil, :compute) ) end
- Loading branch information