You are here

function fb_views_views_data in Drupal for Facebook 6.2

Same name and namespace in other branches
  1. 6.3 fb_views/fb_views.module \fb_views_views_data()
  2. 7.3 fb_views/fb_views.module \fb_views_views_data()

File

fb_views/fb_views.module, line 43
Facebook-specific views arguments, filters, etc...

Code

function fb_views_views_data() {

  // The fb_user_app table allows us to associate a node author's uid to a
  // facebook id.
  // Will be present if fb_user.module is used.
  // This might need to be improved to take the apikey into account (for sites that host more than one app.)
  $data['fb_user_app'] = array(
    'table' => array(
      'group' => t('Drupal for Facebook'),
      'join' => array(
        'node' => array(
          'left_field' => 'uid',
          'field' => 'uid',
        ),
        'users' => array(
          'left_field' => 'uid',
          'field' => 'uid',
        ),
      ),
    ),
    'picture' => array(
      'real field' => 'fbu',
      'title' => t('Picture'),
      'field' => array(
        'handler' => 'fb_views_handler_profile_pic',
      ),
      'help' => t('FBML to show a picture on Facebook Connect or Canvas pages.'),
    ),
    'fb_user_author' => array(
      'real field' => 'fbu',
      'title' => t('Author is friend'),
      'argument' => array(
        'handler' => 'fb_views_handler_author_is_friend',
      ),
      'help' => t('Limit results to Facebook friends of a user.'),
    ),
    'fb_views_filter_friends' => array(
      'real field' => 'fbu',
      // Does this do anything?
      'title' => t('Friend of current user'),
      'filter' => array(
        'handler' => 'fb_views_handler_filter_friends',
      ),
      'help' => t('Limit results to friends of the current user.  This filter will succeed when users are logged into Facebook Connect or Canvas pages.'),
    ),
  );

  // Authmap is the definitive link between a drupal account and facebook user id (fbu)
  $data['authmap'] = array(
    'table' => array(
      'group' => t('Drupal for Facebook'),
      'join' => array(
        'node' => array(
          'left_field' => 'uid',
          'field' => 'uid',
        ),
        'users' => array(
          'left_field' => 'uid',
          'field' => 'uid',
        ),
      ),
    ),
    'fb_views_filter_profile_tab' => array(
      'title' => t('Profile Tab Owner'),
      'filter' => array(
        'handler' => 'fb_views_handler_filter_profile_tab',
      ),
      'help' => t('Limit results to profile tab user.  Only works on Facebook Profile Tabs.'),
    ),
  );
  return $data;
}