Full ELMS Learning Network documentation
function menu_link_load
×
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_link_load($mlid) |
cle7 menu.inc | menu_link_load($mlid) |
elmsmedia7 menu.inc | menu_link_load($mlid) |
icor7 menu.inc | menu_link_load($mlid) |
meedjum_blog7 menu.inc | menu_link_load($mlid) |
mooc7 menu.inc | menu_link_load($mlid) |
Gets a translated, access-checked menu link that is ready for rendering.
This function should never be called from within node_load() or any other function used as a menu object load function since an infinite recursion may occur.
Parameters
$mlid: The mlid of the menu item.
Return value
A menu link, with $item['access'] filled and link translated for rendering.
Related topics
12 calls to menu_link_load()
- book_copy_copy in sites/
all/ modules/ elmsln_contrib/ book_copy/ book_copy.module - Callback for replicating a book outline below a passed node.
- context_condition_menu::condition_values in sites/
all/ modules/ ulmus/ context/ plugins/ context_condition_menu.inc - Override of condition_values().
- context_reaction_breadcrumb::execute in sites/
all/ modules/ ulmus/ context/ plugins/ context_reaction_breadcrumb.inc - Override of execute().
- context_reaction_menu::options_form in sites/
all/ modules/ ulmus/ context/ plugins/ context_reaction_menu.inc - Provide a form element that allow the admin to chose a menu item.
- menu_edit_menu_submit in modules/
menu/ menu.admin.inc - Submit function for adding or editing a custom menu.
File
- includes/
menu.inc, line 2635 - API for the Drupal menu system.
Code
function menu_link_load($mlid) {
if (is_numeric($mlid)) {
$query = db_select('menu_links', 'ml');
$query->leftJoin('menu_router', 'm', 'm.path = ml.router_path');
$query->fields('ml');
// Weight should be taken from {menu_links}, not {menu_router}.
$query->addField('ml', 'weight', 'link_weight');
$query->fields('m');
$query->condition('ml.mlid', $mlid);
if ($item = $query->execute()->fetchAssoc()) {
$item['weight'] = $item['link_weight'];
_menu_link_translate($item);
return $item;
}
}
return FALSE;
}