_menu_tree_check_access

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/menu.inc, строка 1020

Версии
6
_menu_tree_check_access(&$tree)

Recursive helper function for menu_tree_check_access()

Связанные темы

▾ 2 функции вызывают _menu_tree_check_access()

menu_tree_check_access in includes/menu.inc
Проверяет доступ и выполняет другие динамические операции для каждой ссылки в дереве меню.
_menu_tree_check_access in includes/menu.inc
Recursive helper function for menu_tree_check_access()

Код

<?php
function _menu_tree_check_access(&$tree) {
  $new_tree = array();
  foreach ($tree as $key => $v) {
    $item = &$tree[$key]['link'];
    _menu_link_translate($item);
    if ($item['access']) {
      if ($tree[$key]['below']) {
        _menu_tree_check_access($tree[$key]['below']);
      }
      // The weights are made a uniform 5 digits by adding 50000 as an offset.
      // After _menu_link_translate(), $item['title'] has the localized link title.
      // Adding the mlid to the end of the index insures that it is unique.
      $new_tree[(50000 + $item['weight']) .' '. $item['title'] .' '. $item['mlid']] = $tree[$key];
    }
  }
  // Sort siblings in the tree based on the weights and localized titles.
  ksort($new_tree);
  $tree = $new_tree;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему