<?php
// $Id$

/**
 * @file
 * Provides support for the Views module.
 */

/**
 * Implementation of hook_views_handlers().
 */
function flag_queue_views_handlers() {
  return array(
    'info' => array(
      'path' => drupal_get_path('module', 'flag_queue'),
    ),
    'handlers' => array(
      'flag_handler_relationship_counts' => array(
        'parent' => 'views_handler_relationship',
        'file' => 'flag_handler_relationships.inc',
      ),
    ),
  );
}


/**
 * Implementation of hook_views_data().
 */
function flag_queue_views_data() {
  $data = array();

  $data['flag_queue']['table']['group'] = t('Flags queue');
  
  // Join information of the table.
  $data['flag_queue']['table']['join']['flag_content'] = array(
    'left_table' => 'flag_content',
    'left_field' => 'fcid',
    'field' => 'fcid',
  );
  
  $data['flag_queue']['position'] = array(
    'title' => t('Flagged content position'),
    'help' => t('The position of aflagged content in a flag queue.'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
    ),
  );

  return $data;
}
