MenuParentFormSelectorInterface

Defines an interface for menu selector form elements and menu link options. Hierarchy interface \Drupal\Core\Menu\MenuParentFormSelectorInterface File core/lib/Drupal/Core/Menu/MenuParentFormSelectorInterface.php, line 10 Namespace Drupal\Core\Menu Members Name Modifiers Type Description MenuParentFormSelectorInterface::getParentSelectOptions public function Gets the options for a select element to choose a menu and parent. MenuParentFormSelectorInterface::parentSelect

MenuParentFormSelector::__construct

public MenuParentFormSelector::__construct(MenuLinkTreeInterface $menu_link_tree, EntityManagerInterface $entity_manager, TranslationInterface $string_translation) Constructs a \Drupal\Core\Menu\MenuParentFormSelector Parameters \Drupal\Core\Menu\MenuLinkTreeInterface $menu_link_tree: The menu link tree service. \Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager. \Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation service.

MenuParentFormSelector::parentSelectOptionsTreeWalk

protected MenuParentFormSelector::parentSelectOptionsTreeWalk(array $tree, $menu_name, $indent, array &$options, $exclude, $depth_limit, CacheableMetadata &$cacheability = NULL) Iterates over all items in the tree to prepare the parents select options. Parameters \Drupal\Core\Menu\MenuLinkTreeElement[] $tree: The menu tree. string $menu_name: The menu name. string $indent: The indentation string used for the label. array $options: The select options. string $exclude: An excluded menu l

MenuParentFormSelector::parentSelectElement

public MenuParentFormSelector::parentSelectElement($menu_parent, $id = '', array $menus = NULL) Gets a form element to choose a menu and parent. The specific type of form element will vary depending on the implementation, but callers will normally need to set the #title for the element. Parameters string $menu_parent: A menu name and parent ID concatenated with a ':' character to use as the default value. string $id: (optional) ID of a link plugin. This will exclude the link and its children f

MenuParentFormSelector::getParentSelectOptions

public MenuParentFormSelector::getParentSelectOptions($id = '', array $menus = NULL, CacheableMetadata &$cacheability = NULL) Gets the options for a select element to choose a menu and parent. Parameters string $id: Optional ID of a link plugin. This will exclude the link and its children from the select options. array $menus: Optional array of menu names as keys and titles as values to limit the select options. If NULL, all menus will be included. \Drupal\Core\Cache\CacheableMetadata|null

MenuParentFormSelector::getParentDepthLimit

protected MenuParentFormSelector::getParentDepthLimit($id) Returns the maximum depth of the possible parents of the menu link. Parameters string $id: The menu link plugin ID or an empty value for a new link. Return value int The depth related to the depth of the given menu link. File core/lib/Drupal/Core/Menu/MenuParentFormSelector.php, line 113 Class MenuParentFormSelector Default implementation of the menu parent form selector service. Namespace Drupal\Core\Menu Code protected func

MenuParentFormSelector::getMenuOptions

protected MenuParentFormSelector::getMenuOptions(array $menu_names = NULL) Gets a list of menu names for use as options. Parameters array $menu_names: (optional) Array of menu names to limit the options, or NULL to load all. Return value array Keys are menu names (ids) values are the menu labels. File core/lib/Drupal/Core/Menu/MenuParentFormSelector.php, line 184 Class MenuParentFormSelector Default implementation of the menu parent form selector service. Namespace Drupal\Core\Menu C

MenuParentFormSelector::$menuLinkTree

The menu link tree service. Type: \Drupal\Core\Menu\MenuLinkTreeInterface File core/lib/Drupal/Core/Menu/MenuParentFormSelector.php, line 24 Class MenuParentFormSelector Default implementation of the menu parent form selector service. Namespace Drupal\Core\Menu Code protected $menuLinkTree;

MenuParentFormSelector::$entityManager

The entity manager. Type: \Drupal\Core\Entity\EntityManagerInterface File core/lib/Drupal/Core/Menu/MenuParentFormSelector.php, line 31 Class MenuParentFormSelector Default implementation of the menu parent form selector service. Namespace Drupal\Core\Menu Code protected $entityManager;

MenuParentFormSelector

Default implementation of the menu parent form selector service. The form selector is a list of all appropriate menu links. Hierarchy class \Drupal\Core\Menu\MenuParentFormSelector implements MenuParentFormSelectorInterface uses StringTranslationTrait File core/lib/Drupal/Core/Menu/MenuParentFormSelector.php, line 16 Namespace Drupal\Core\Menu Members Name Modifiers Type Description MenuParentFormSelector::$entityManager protected property The entity manager. MenuParen