theme_chatroom_display

Definition

theme_chatroom_display($tree)
contributions/modules/chatroom/chatroom.module, line 1003

Description

Format the chat room listing.

Related topics

Namesort iconDescription
Themeable functionsFunctions that display HTML, and which can be customized by themes.

Code

function theme_chatroom_display($tree) {
  global $user;
  // chat room list, chats list, and 'add new chat' link

  if (!empty($tree)) {
    $output  = '<div id="chatroom">';
    $output .= '<ul>';

    if (user_access('create chat rooms')) {
      $output .= '<li>'. l(t('Post a new chat room.'), "node/add/chatroom") .'</li>';
    }
    else if ($user->uid) {
      //
    }
    else {
      $output .= '<li>'. t('<a href="!login">Login</a> to post a new chat room.', array('!login' => url('user/login'))) .'</li>';
    }
    $output .= '</ul>';
    $output .= theme('chatroom_list', $tree);
    $output .= '</div>';
  }
  else {
    drupal_set_title(t('No chat rooms defined'));
    $output = '';
  }

  return $output;
}