You are here

function _recommender_views_template_item_field in Recommender API 7.6

1 call to _recommender_views_template_item_field()
_recommender_views_template_table in ./recommender.views.inc

File

./recommender.views.inc, line 210

Code

function _recommender_views_template_item_field($title, $help, $item_entity_info) {
  $return = array(
    'title' => $title,
    'help' => $help,
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
    'relationship' => array(
      'handler' => 'views_handler_relationship',
      'base' => $item_entity_info['base table'],
      'base field' => $item_entity_info['entity keys']['id'],
      'label' => $title,
    ),
  );
  if ($item_entity_info['base table'] == 'node') {
    $return['field'] = array(
      'handler' => 'views_handler_field_node',
      'click sortable' => TRUE,
    );
    $return['argument'] = array(
      'handler' => 'views_handler_argument_node_nid',
      'name field' => 'title',
      'numeric' => TRUE,
      'validate type' => 'nid',
    );
  }
  else {
    $return['field'] = array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    );
    $return['argument'] = array(
      'handler' => 'views_handler_argument_numeric',
    );
  }
  return $return;
}