You are here

function nodequeue_views_tables in Nodequeue 5

Same name and namespace in other branches
  1. 5.2 nodequeue.views.inc \nodequeue_views_tables()

File

./nodequeue.module, line 1037

Code

function nodequeue_views_tables() {
  $tables['nodequeue_nodes'] = array(
    "name" => "nodequeue_nodes",
    "join" => array(
      "left" => array(
        "table" => "node",
        "field" => "nid",
      ),
      "right" => array(
        "field" => "nid",
      ),
    ),
    "fields" => array(
      'timestamp' => array(
        'name' => t('NodeQueue: Timestamp'),
        'sortable' => true,
        'handler' => views_handler_field_dates(),
        'option' => 'string',
        'help' => t('Display the time the node was added to a given node queue.') . ' ' . t('The option field may be used to specify the custom date format as it\'s required by the date() function or if "as time ago" has been chosen to customize the granularity of the time interval.'),
      ),
    ),
    "filters" => array(
      "qid" => array(
        'name' => "NodeQueue: Queue",
        'list' => 'nodequeue_handler_queuelist',
        'operator' => 'views_handler_operator_andor',
        'help' => t('Filter the view to a specific Node Queue.'),
      ),
      "position" => array(
        'name' => "NodeQueue: Queue Position",
        'field' => 'position',
        'operator' => 'views_handler_operator_gtlt',
        'help' => t('Filter by where in the queue an item is.'),
      ),
      "timestamp" => array(
        'name' => t('NodeQueue: Queue Timestamp'),
        'operator' => 'views_handler_operator_gtlt',
        'value' => views_handler_filter_date_value_form(),
        'handler' => 'views_handler_filter_timestamp',
        'option' => 'string',
        'help' => t('This filter allows nodes to be filtered by the time they were added to a given NodeQueue.') . ' ' . views_t_strings('filter date'),
      ),
    ),
    "sorts" => array(
      "position" => array(
        'name' => "NodeQueue: Queue Position",
        'field' => 'position',
        'help' => t('When sorting by queue position, be sure the view is filtered to a single queue or the sort will not work very well.'),
      ),
      'timestamp' => array(
        'name' => t('NodeQueue: Timestamp'),
        'handler' => 'views_handler_sort_date',
        'option' => views_handler_sort_date_options(),
        'help' => t('Sort by the time the node was added to a node queue.'),
      ),
    ),
  );
  $tables['nodequeue_queue'] = array(
    "name" => "nodequeue_queue",
    "join" => array(
      "left" => array(
        "table" => "nodequeue_nodes",
        "field" => "qid",
      ),
      "right" => array(
        "field" => "qid",
      ),
    ),
  );
  return $tables;
}