function theme_userloginbar in UserLoginBar 7
Same name and namespace in other branches
- 8 userloginbar.module \theme_userloginbar()
- 5 userloginbar.module \theme_userloginbar()
Theming function for messages.
1 theme call to theme_userloginbar()
- userloginbar_block_view in ./
userloginbar.module - Implementation of hook_block_view().
File
- ./
userloginbar.module, line 60
Code
function theme_userloginbar() {
drupal_add_css(drupal_get_path('module', 'userloginbar') . '/userloginbar.css');
global $user;
$output = '';
if (arg(0) == "user" && !is_numeric(arg(1))) {
return;
}
if (!$user->uid) {
$output .= drupal_render(drupal_get_form('user_login_block'));
}
else {
if (!variable_get('disable_welcome_box', FALSE)) {
$output .= t('<p class="user-info">Hi !user, welcome back.</p>', array(
'!user' => theme('username', array(
'account' => $user,
)),
));
$output .= theme('item_list', array(
'attributes' => array(
'class' => 'welcome-box',
),
'items' => array(
l(t('Your account'), 'user/' . $user->uid, array(
'attributes' => array(
'title' => t('Edit your account'),
),
)),
l(t('Sign out'), 'user/logout', array(
'attributes' => array(
'title' => t('Logout'),
),
)),
),
));
}
}
$output = '<div id="user-login-form">' . $output . '</div>';
return $output;
}