menu_tree_check_access
- Versions
- 6 – 7
menu_tree_check_access(&$tree, $node_links = array())
Check access and perform other dynamic operations for each link in the tree.
Parameters
$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().
Related topics
Code
includes/menu.inc, line 1260
<?php
function menu_tree_check_access(&$tree, $node_links = array()) {
if ($node_links) {
$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;
}
?>Login or register to post comments 