menu_tree_check_access

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 menu_tree_check_access(&$tree, $node_links = array())

Check access and perform other dynamic operations for each link in the tree.

Übergabeparameter

$tree The menu tree you wish to operate on.

$node_links A collection of node link references generated from $tree by menu_tree_collect_node_links().

Verwandte Themen

▾ 4 functions call menu_tree_check_access()

book_menu_subtree_data in modules/book/book.module
Get the data representing a subtree of the book hierarchy.
menu_overview_form in modules/menu/menu.admin.inc
Form for editing an entire menu tree at once.
menu_tree_all_data in includes/menu.inc
Get the data structure representing a named menu tree.
menu_tree_page_data in includes/menu.inc
Get the data structure representing a named menu tree, based on the current page.

Code

includes/menu.inc, line 1118

<?php
function menu_tree_check_access(&$tree, $node_links = array()) {

  if ($node_links) {
    // Use db_rewrite_sql to evaluate view access without loading each full node.
    $nids = array_keys($node_links);
    $select = db_select('node');
    $select->addField('node', 'nid');
    $select->condition('status', 1);
    $select->condition('nid', $nids, 'IN');
    $select->addTag('node_access');
    $nids = $select->execute()->fetchCol();
    foreach ($nids as $nid) {
      foreach ($node_links[$nid] as $mlid => $link) {
        $node_links[$nid][$mlid]['access'] = TRUE;
      }
    }
  }
  _menu_tree_check_access($tree);
  return;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen