You are here

function theme_plus1_json_response in Plus 1 7

Theming function for json response.

Parameters

$variables:

Return value

array

Returns an array of variables which will be send back to browser, after ajax request.

See also

plus1_vote(), plus1_undo_vote()

2 theme calls to theme_plus1_json_response()
plus1_undo_vote in ./plus1.module
plus1_vote in ./plus1.module
Page callback.

File

theme/theme.inc, line 62
Theme file, contains implementations of theme functions and preprocessors.

Code

function theme_plus1_json_response($variables) {
  switch ($variables['entity_type']) {
    case 'node':
      return array(
        'widget' => drupal_render(plus1_build_node_jquery_widget($variables['entity_id'], $variables['tag'])),
      );
      break;
    case 'taxonomy_term':
      return array(
        'widget' => drupal_render(plus1_build_taxonomy_term_jquery_widget($variables['entity_id'], $variables['tag'])),
      );
      break;
    case 'comment':
      return array(
        'widget' => drupal_render(plus1_build_comment_jquery_widget($variables['entity_id'], $variables['tag'])),
      );
      break;
  }
}