Closed (fixed)
Project:
Nice Menus
Version:
7.x-2.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jan 2012 at 16:37 UTC
Updated:
23 Feb 2012 at 04:56 UTC
/**
* 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
Comment #1
vordude commentedCommitted, Thanks.
http://drupalcode.org/project/nice_menus.git/blobdiff/effae10212e6a837ef...