metatag_mobile.module 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * @file
  4. * Primary hook implementations for Metatag:Mobile.
  5. */
  6. /**
  7. * Implements hook_ctools_plugin_api().
  8. */
  9. function metatag_mobile_ctools_plugin_api($owner, $api) {
  10. if ($owner == 'metatag' && $api == 'metatag') {
  11. return array('version' => 1);
  12. }
  13. }
  14. /**
  15. * Implements hook_theme().
  16. */
  17. function metatag_mobile_theme() {
  18. $info['metatag_mobile_android_app'] = array(
  19. 'render element' => 'element',
  20. );
  21. $info['metatag_mobile_ios_app'] = array(
  22. 'render element' => 'element',
  23. );
  24. return $info;
  25. }
  26. /**
  27. * Theme callback for an Android app link meta tag.
  28. *
  29. * The format is:
  30. * <link rel="alternate" href="android-app://com.example.Example/sitesection/sitepage/thispage" />
  31. */
  32. function theme_metatag_mobile_android_app($variables) {
  33. // Pass everything through to the normal 'link' tag theme.
  34. $variables['element']['#name'] = 'alternative';
  35. $variables['element']['#value'] = 'android-app://' . $variables['element']['#value'];
  36. return theme('metatag_link_rel', $variables);
  37. }
  38. /**
  39. * Theme callback for an iOS app link meta tag.
  40. *
  41. * The format is:
  42. * <link rel="alternate" href="ios-app://123456/example/hello-screen" />
  43. */
  44. function theme_metatag_mobile_ios_app($variables) {
  45. // Pass everything through to the normal 'link' tag theme.
  46. $variables['element']['#name'] = 'alternative';
  47. $variables['element']['#value'] = 'ios-app://' . $variables['element']['#value'];
  48. return theme('metatag_link_rel', $variables);
  49. }
  50. /*
  51. * theme-color
  52. * MobileOptimized
  53. * HandheldFriendly
  54. * viewport
  55. * cleartype
  56. * apple-mobile-web-app-capable
  57. * apple-mobile-web-app-status-bar-style
  58. * format-detection
  59. * android-app
  60. */