You are here

function notify_viewsintegration_views_data in Notify 6

Same name and namespace in other branches
  1. 7 submodules/notify_viewsintegration/notify_viewsintegration.module \notify_viewsintegration_views_data()

File

./notify_viewsintegration.module, line 9

Code

function notify_viewsintegration_views_data() {
  $data = array();
  $data['notify'] = array(
    // Table info.
    'table' => array(
      'group' => t('Notify'),
      'base' => array(
        'field' => 'uid',
        'title' => t('Notify'),
        'help' => t('This isn\'t really used. Create a view of \'Users\' and you\'ll see a new field and filter group called \'Notify.\'.'),
        'weight' => 0,
      ),
    ),
  );
  $data['notify']['uid'] = array(
    'title' => t('UID'),
    'help' => t('The ID of the user'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['notify']['status'] = array(
    'title' => t('Subscription Status'),
    'help' => t('Whether or not the user is subscribed. Set to \'1\' for subscribed or leave it blank for not subscribed. \'0\' will return someone who has subscribed and then changed their preference.'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
  );
  $data['notify']['node'] = array(
    'title' => t('Subscription Status to Node'),
    'help' => t('Whether or not the user is subscribed to nodes. Set to \'1\' for subscribed or leave it blank for not subscribed. \'0\' will return someone who has subscribed and then changed their preference.'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
  );
  $data['notify']['comment'] = array(
    'title' => t('Subscription Status to Comments'),
    'help' => t('Whether or not the user is subscribed to comments. Set to \'1\' for subscribed or leave it blank for not subscribed. \'0\' will return someone who has subscribed and then changed their preference.'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
  );
  $data['notify']['table']['join'] = array(
    'users' => array(
      'table' => 'notify',
      'left_field' => 'uid',
      'field' => 'uid',
      'left_table' => 'users',
    ),
  );
  return $data;
}