You are here

commerce_cardonfile.views.inc in Commerce Card on File 7.2

Views integration for Commerce Card on File.

File

includes/views/commerce_cardonfile.views.inc
View source
<?php

/**
 * @file
 * Views integration for Commerce Card on File.
 */

/**
 * Implements hook_views_data_alter().
 */
function commerce_cardonfile_views_data_alter(&$data) {

  // Override the data generated by Entity API.
  $data['commerce_cardonfile']['card_number']['field']['handler'] = 'commerce_cardonfile_handler_field_card_number';
  $data['commerce_cardonfile']['instance_default']['filter']['label'] = t('Default');
  $data['commerce_cardonfile']['instance_default']['filter']['type'] = 'yes-no';
  $data['commerce_cardonfile']['label'] = array(
    'field' => array(
      'title' => t('Label'),
      'help' => t('Display the card label.'),
      'handler' => 'commerce_cardonfile_handler_field_card_label',
    ),
  );
  $data['commerce_cardonfile']['card_exp'] = array(
    'field' => array(
      'title' => t('Card expiration'),
      'help' => t('Expiration month and year.'),
      'handler' => 'commerce_cardonfile_handler_field_card_exp',
    ),
  );
  $data['commerce_cardonfile']['operations'] = array(
    'field' => array(
      'title' => t('Operations links'),
      'help' => t('Display all the available operations links for the cards.'),
      'handler' => 'commerce_cardonfile_handler_field_card_operations',
    ),
  );
  return $data;
}

/**
 * Implements hook_views_plugins().
 */
function commerce_cardonfile_views_plugins() {
  return array(
    'argument validator' => array(
      'commerce_cof_owner' => array(
        'title' => t('Card owner access'),
        'handler' => 'commerce_cardonfile_plugin_argument_validate_owner',
      ),
    ),
  );
}