You are here

function weight_views_data in Weight 7

Same name and namespace in other branches
  1. 6 views/weight.views.inc \weight_views_data()
  2. 7.2 views/weight.views.inc \weight_views_data()

Implements hook_views_data().

File

./weight.views.inc, line 10
Views2 support for Weight module.

Code

function weight_views_data() {
  $data['node_weight'] = array(
    'table' => array(
      'group' => t('Weight'),
      'join' => array(
        'node' => array(
          'table' => 'node',
          'left_field' => 'nid',
          'field' => 'nid',
        ),
      ),
    ),
    'weight' => array(
      'real field' => 'sticky',
      'title' => t('Weight'),
      // The item it appears as on the UI,
      'help' => t('The node weight.'),
      // The help that appears on the UI,
      'field' => array(
        'handler' => 'weight_handler_field_sticky',
        'click sortable' => TRUE,
      ),
      'filter' => array(
        'handler' => 'weight_handler_filter_weight',
        'label' => t('Weight'),
      ),
      'sort' => array(
        'handler' => 'weight_handler_sort',
      ),
    ),
  );
  $data['node_weight_stick'] = array(
    'table' => array(
      'group' => t('Weight'),
      'join' => array(
        'node' => array(
          'table' => 'node',
          'left_field' => 'nid',
          'field' => 'nid',
        ),
      ),
    ),
    'weight_stick' => array(
      'real field' => 'sticky',
      'title' => t('Weighted Sticky'),
      // The item it appears as on the UI,
      'help' => t('Checks if something really is sticky.'),
      // The help that appears on the UI,
      'filter' => array(
        'handler' => 'weight_handler_filter_sticky',
        'label' => t('Weighted Sticky'),
        'type' => 'yes-no',
      ),
    ),
  );
  return $data;
}