metatag_facebook.metatag.inc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * @file
  4. * Metatag integration for the Metatag:Facebook module.
  5. */
  6. /**
  7. * Implements hook_metatag_info().
  8. */
  9. function metatag_facebook_metatag_info() {
  10. $info['groups']['facebook'] = array(
  11. 'label' => t('Facebook'),
  12. 'description' => t("Meta tags used to integrate with Facebook's APIs. Most sites do not need to use these, they are primarily of benefit for sites using either the Facebook widgets, the Facebook Connect single-signon system, or are using Facebook's APIs in a custom way. Sites that do need these meta tags usually will only need to set them globally."),
  13. 'form' => array(
  14. '#weight' => 55,
  15. ),
  16. );
  17. // Facebook meta tags stack after the simple tags.
  18. $weight = 20;
  19. // Default values for each meta tag.
  20. $tag_info_defaults = array(
  21. 'description' => '',
  22. 'class' => 'DrupalTextMetaTag',
  23. 'group' => 'facebook',
  24. 'element' => array(
  25. '#theme' => 'metatag_property',
  26. ),
  27. );
  28. $info['tags']['fb:admins'] = array(
  29. 'label' => t('Admins'),
  30. 'description' => t('A comma-separated list of Facebook user IDs of people who are considered administrators or moderators of this page.'),
  31. 'weight' => ++$weight,
  32. ) + $tag_info_defaults;
  33. $info['tags']['fb:app_id'] = array(
  34. 'label' => t('Application ID'),
  35. 'description' => t('A comma-separated list of Facebook Platform Application IDs applicable for this site.'),
  36. 'weight' => ++$weight,
  37. 'devel_generate' => array(
  38. 'type' => 'integer',
  39. ),
  40. ) + $tag_info_defaults;
  41. // If the FB_Social module is installed already, disable the app_id field.
  42. if (module_exists('fb_social')) {
  43. $info['tags']['fb:app_id']['form']['#disabled'] = TRUE;
  44. $info['tags']['fb:app_id']['form']['#description'] = t('The FB_Social module will automatically output this meta tag, go to the <a href="!fb_social">FB_Social settings page</a> to customize it.', array('!fb_social' => url('admin/config/user-interface/fb_social')));
  45. }
  46. return $info;
  47. }