<?php
// $Id: views_test.module,v 1.1.4.4 2010/02/13 21:01:42 dereine Exp $

/**
 * Implements hook_perm().
 */
function views_test_perm() {
  return array('views_test test permission');
}

/**
 * Implements hook_views_api().
 */
function views_test_views_api() {
  return array(
    'api' => 3.0,
  );
}

/**
 * Implements hook_views_data()
 */
function views_test_views_data() {
  // Declaration of the base table.
  $data['views_test']['table'] = array(
    'group' => t('Views test'),
    'base' => array(
      'field' => 'id',
      'title' => t('Views test'),
      'help' => t('Users who have created accounts on your site.'),
    ),
  );

  // Declaration of fields.
  $data['views_test']['id'] = array(
    'title' => t('ID'),
    'help' => t('The test data ID'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['views_test']['name'] = array(
    'title' => t('Name'),
    'help' => t('The name of the person'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_string',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_string',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['views_test']['age'] = array(
    'title' => t('Age'),
    'help' => t('The age of the person'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['views_test']['job'] = array(
    'title' => t('Job'),
    'help' => t('The job of the person'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_string',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_string',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  return $data;
}
