SilverStripe\Admin\CMSMenu
The object manages the main CMS menu. See {@link LeftAndMain::init()} for example usage.
The menu will be automatically populated with menu items for subclasses of
. That is, for each class in the CMS that creates an
administration panel, a CMS menu item will be created. The default
configuration will also include a 'help' link to the SilverStripe user
documentation.
Additional CMSMenu items can be added through extensions added to .
Synopsis
class CMSMenu
implements
IteratorAggregate,i18nEntityProvider
{
- // constants
- const MENU_PRIORITY = 'menu_priority';
- const URL_PRIORITY = 'url_priority';
- // members
- protected static array $menu_item_changes = ;
- protected static boolean $menu_is_cleared = false;
- // methods
- public static void populate_menu()
- public static void add_controller()
- protected static CMSMenuItem menuitem_for_controller()
- public static boolean add_link()
- public static bool add_menu_item()
- public static array get_menu_item()
- public static string get_menu_code()
- public static array get_menu_items()
- public static array get_viewable_menu_items()
- public static void remove_menu_item()
- public static void remove_menu_class()
- public static void clear_menu()
- public static bool replace_menu_item()
- protected static void add_menu_item_obj()
- public static array get_cms_classes()
- public void getIterator()
- public void provideI18nEntities()
Hierarchy
Implements
- IteratorAggregate
- SilverStripe\i18n\i18nEntityProvider
Tasks
Line | Task |
---|---|
75+ | A director rule is added when a controller link is added, but it won't be removed when the item is removed. Functionality needed in {@link Director}. |
379+ | A variation of this function could probably be moved to {@link ClassInfo} |
384 | Make these actual abstract classes |
Constants
Name | Value |
---|---|
MENU_PRIORITY | 'menu_priority' |
URL_PRIORITY | 'url_priority' |
Members
protected
Methods
protected
public
- add_controller() — Add a LeftAndMain controller to the CMS menu.
- add_link() — Add an arbitrary URL to the CMS menu.
- getIterator() — IteratorAggregate Interface Method. Iterates over the menu items.
- get_cms_classes() — A utility funciton to retrieve subclasses of a given class that are instantiable (ie, not abstract) and have a valid menu title.
- provideI18nEntities() — Provide menu titles to the i18n entity provider