/**
 * Implements hook_block_view().
 */
function nice_menus_block_view($delta) {
  // Build the Nice menu for the block.
  list($menu_name) = explode(':', variable_get('nice_menus_menu_' . $delta, 'navigation:0'));
  $direction = variable_get('nice_menus_type_' . $delta, 'right');
  $depth = variable_get('nice_menus_depth_' . $delta, '-1');
  if ($output = theme('nice_menus', array('id' => $delta, 'menu_name' => $menu_name, 'direction' => $direction, 'depth' => $depth))) {
    $block['content'] = $output['content'];
    if (variable_get('nice_menus_type_' . $delta, 'right') == 'down') {
      $class = 'nice-menu-hide-title';
    }
    else {
      $class = 'nice-menu-show-title';
    }
    // If we're building the navigation block
    // use the same block title logic as menu module.
    if ($output['subject'] == t('navigation') && $user->uid) {
      global $user;
      $subject = $user->name;
    }
    else {
      $subject = $output['subject'];
    }
    $block['subject'] = '<span class="' . $class . '">' . check_plain($subject) . '</span>';
  }
  else {
    $block['content'] = FALSE;
  }
  return $block;
}

see:
if ($output['subject'] == t('navigation') && $user->uid) {

that wont work and is undefined because global $user is inside the if.

Comments

vordude’s picture

Status: Active » Closed (fixed)