function menu_links_clone

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 menu.inc menu_links_clone($links, $menu_name = NULL)
cle7 menu.inc menu_links_clone($links, $menu_name = NULL)
elmsmedia7 menu.inc menu_links_clone($links, $menu_name = NULL)
icor7 menu.inc menu_links_clone($links, $menu_name = NULL)
meedjum_blog7 menu.inc menu_links_clone($links, $menu_name = NULL)
mooc7 menu.inc menu_links_clone($links, $menu_name = NULL)

Clones an array of menu links.

Parameters

$links: An array of menu links to clone.

$menu_name: (optional) The name of a menu that the links will be cloned for. If not set, the cloned links will be in the same menu as the original set of links that were passed in.

Return value

An array of menu links with the same properties as the passed-in array, but with the link identifiers removed so that a new link will be created when any of them is passed in to menu_link_save().

See also

menu_link_save()

Related topics

2 calls to menu_links_clone()
shortcut_set_add_form_submit in modules/shortcut/shortcut.admin.inc
Submit handler for shortcut_set_add_form().
shortcut_set_switch_submit in modules/shortcut/shortcut.admin.inc
Submit handler for shortcut_set_switch().

File

includes/menu.inc, line 2934
API for the Drupal menu system.

Code

function menu_links_clone($links, $menu_name = NULL) {
  foreach ($links as &$link) {
    unset($link['mlid']);
    unset($link['plid']);
    if (isset($menu_name)) {
      $link['menu_name'] = $menu_name;
    }
  }
  return $links;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.