menu_ui.module
Same filename and directory in other branches
File
-
core/
modules/ menu_ui/ menu_ui.module
View source
<?php
/**
* @file
*/
use Drupal\Core\Form\FormStateInterface;
use Drupal\menu_ui\Hook\MenuUiHooks;
use Drupal\menu_ui\MenuUiUtility;
use Drupal\node\NodeInterface;
/**
* Returns the definition for a menu link for the given node.
*
* @param \Drupal\node\NodeInterface $node
* The node entity.
*
* @return array
* An array that contains default values for the menu link form.
*
* @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use
* \Drupal\menu_ui\MenuUiUtility::getMenuLinkDefaults() instead.
*
* @see https://www.drupal.org/node/3566774
*/
function menu_ui_get_menu_link_defaults(NodeInterface $node) {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use MenuUiUtility::getMenuLinkDefaults() instead. See https://www.drupal.org/node/3566774', E_USER_DEPRECATED);
return \Drupal::service(MenuUiUtility::class)->getMenuLinkDefaults($node);
}
/**
* Entity form builder to add the menu information to the node.
*
* @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use
* \Drupal\menu_ui\Hooks\MenuUiHooks::nodeBuilder() instead.
*
* @see https://www.drupal.org/node/3566774
*/
function menu_ui_node_builder($entity_type, NodeInterface $entity, &$form, FormStateInterface $form_state) : void {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use MenuUiHooks::nodeBuilder() instead. See https://www.drupal.org/node/3566774', E_USER_DEPRECATED);
\Drupal::service(MenuUiHooks::class)->nodeBuilder($entity_type, $entity, $form, $form_state);
}
Functions
| Title | Deprecated | Summary |
|---|---|---|
| menu_ui_get_menu_link_defaults | in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal\menu_ui\MenuUiUtility::getMenuLinkDefaults() instead. |
Returns the definition for a menu link for the given node. |
| menu_ui_node_builder | in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal\menu_ui\Hooks\MenuUiHooks::nodeBuilder() instead. |
Entity form builder to add the menu information to the node. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.