Commit c66f68bc authored by quietone's avatar quietone
Browse files

Issue #3260765 by andypost, quietone, xjm: Remove deprecated code from menu-related subsystems

parent 27158f7c
Loading
Loading
Loading
Loading

core/includes/menu.inc

deleted100644 → 0
+0 −34
Original line number Diff line number Diff line
<?php

/**
 * @file
 * API for the Drupal menu system.
 */

/**
 * @addtogroup menu
 * @{
 */

/**
 * Returns an array containing the names of system-defined (default) menus.
 *
 * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
 *   \Drupal\system\Entity\Menu::loadMultiple() instead.
 *
 * @see https://www.drupal.org/node/3027453
 */
function menu_list_system_menus() {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\system\Entity\Menu::loadMultiple() instead. See https://www.drupal.org/node/3027453', E_USER_DEPRECATED);
  return [
    'tools' => 'Tools',
    'admin' => 'Administration',
    'account' => 'User account menu',
    'main' => 'Main navigation',
    'footer' => 'Footer menu',
  ];
}

/**
 * @} End of "addtogroup menu".
 */
+0 −1
Original line number Diff line number Diff line
@@ -2082,7 +2082,6 @@ function drupal_common_theme() {
    'pager' => [
      'render element' => 'pager',
    ],
    // From menu.inc.
    'menu' => [
      'variables' => ['menu_name' => NULL, 'items' => [], 'attributes' => []],
    ],
+0 −1
Original line number Diff line number Diff line
@@ -537,7 +537,6 @@ public function loadLegacyIncludes() {
    require_once $this->root . '/core/includes/common.inc';
    require_once $this->root . '/core/includes/module.inc';
    require_once $this->root . '/core/includes/theme.inc';
    require_once $this->root . '/core/includes/menu.inc';
    require_once $this->root . '/core/includes/form.inc';
    require_once $this->root . '/core/includes/errors.inc';
    require_once $this->root . '/core/includes/schema.inc';
+0 −3
Original line number Diff line number Diff line
@@ -133,9 +133,6 @@ public function bookTreeCollectNodeLinks(&$tree, &$node_links);
  /**
   * Provides book loading, access control and translation.
   *
   * Note: copied from _menu_link_translate() in menu.inc, but reduced to the
   * minimal code that's used.
   *
   * @param array $link
   *   A book link.
   */
+0 −30
Original line number Diff line number Diff line
@@ -423,36 +423,6 @@ function menu_ui_form_node_type_form_builder($entity_type, NodeTypeInterface $ty
  $type->setThirdPartySetting('menu_ui', 'parent', $form_state->getValue('menu_parent'));
}

/**
 * Return an associative array of the custom menus names.
 *
 * @param bool $all
 *   (optional) If FALSE return only user-added menus, or if TRUE also include
 *   the menus defined by the system. Defaults to TRUE.
 *
 * @return array
 *   An array with the machine-readable names as the keys, and human-readable
 *   titles as the values.
 *
 * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
 *   \Drupal\system\Entity\Menu::loadMultiple() instead.
 *
 * @see https://www.drupal.org/node/3027453
 */
function menu_ui_get_menus($all = TRUE) {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\system\Entity\Menu::loadMultiple() instead. See https://www.drupal.org/node/3027453', E_USER_DEPRECATED);
  if ($custom_menus = Menu::loadMultiple()) {
    if (!$all) {
      $custom_menus = array_diff_key($custom_menus, menu_list_system_menus());
    }
    foreach ($custom_menus as $menu_name => $menu) {
      $custom_menus[$menu_name] = $menu->label();
    }
    asort($custom_menus);
  }
  return $custom_menus;
}

/**
 * Implements hook_preprocess_HOOK() for block templates.
 */
Loading