You are here

function _likebtn_get_views_widget_markup in Like Button 8.2

Same name and namespace in other branches
  1. 7 likebtn.module \_likebtn_get_views_widget_markup()

Get LikeBtn for view.

2 calls to _likebtn_get_views_widget_markup()
likebtn_views_widget_display_only in ./likebtn.module
Get views widget markup.
likebtn_views_widget_full in ./likebtn.module
Get views widget markup.

File

./likebtn.module, line 1397
Implements the LikeBtn module.

Code

function _likebtn_get_views_widget_markup($value, $field, $columns, $mode = LIKEBTN_VIEWS_WIDGET_FULL) {
  $entity_name = $field->view->base_table;
  $base_field = $field->view->base_field;
  $entity_id = $columns->{$base_field};
  $values = NULL;
  if ($mode == LIKEBTN_VIEWS_WIDGET_DISPLAY_ONLY) {
    $values['display_only'] = TRUE;
  }

  // Find the VotingAPI tag (tag equals to field id (if LikeBtn has been added
  // as field).

  /*foreach ($field->query->table_queue[$field->relationship]['join']->extra
    as $votingapi_setting) {
    if ($votingapi_setting['field'] == 'tag') {
    $tag = $votingapi_setting['value'];
    }
    elseif ($votingapi_setting['field'] == 'value_type') {
    $value_type = $votingapi_setting['value'];
    }
    }
    */
  return _likebtn_get_markup($entity_name, $entity_id, $values);
}