You are here

function shoutbox_js_view in Shoutbox 7

Same name and namespace in other branches
  1. 5 shoutbox.module \shoutbox_js_view()
  2. 6.2 shoutbox.module \shoutbox_js_view()
  3. 6 shoutbox.module \shoutbox_js_view()
  4. 7.2 shoutbox.module \shoutbox_js_view()

Javascript callback.

Prints out shouts only.

3 calls to shoutbox_js_view()
shoutbox_group_js_view in shoutbox_group/shoutbox_group.module
Javascript callback to handle auto-update shouts
shoutbox_tags_js_view in shoutbox_tags/shoutbox_tags.module
Javascript callback for viewing shouts for a given tag
shoutbox_user_js_view in shoutbox_user/shoutbox_user.module
Javascript callback for viewing shouts for a given tag
1 string reference to 'shoutbox_js_view'
shoutbox_menu in ./shoutbox.module
Implements hook_menu().

File

./shoutbox.module, line 229
Shoutbox module displays a block for users to create short messages for the whole site. Uses AHAH to update the database and display content.

Code

function shoutbox_js_view() {

  // Determine the amount of shouts based on the mode.
  switch ($_GET['mode']) {
    case 'page':
      $show_amount = variable_get('shoutbox_showamount_page', '30');
      break;
    case 'block':
    default:
      $show_amount = variable_get('shoutbox_showamount_block', '10');
      break;
  }
  $shoutbox_posts_data = shoutbox_display_posts($show_amount);

  // $output = theme('table', array('header' => NULL, 'rows' => $shoutbox_posts_data['rows']));
  $output = drupal_render($shoutbox_posts_data);
  return drupal_json_output(array(
    'success' => TRUE,
    'data' => $output,
  ));
}