metatag.theme.inc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * @file
  4. * Theme callbacks for the metatag module.
  5. */
  6. /**
  7. * Theme callback for a normal meta tag.
  8. *
  9. * The format is:
  10. * <meta name="[name]" content="[value]" />
  11. */
  12. function theme_metatag($variables) {
  13. $element = &$variables['element'];
  14. element_set_attributes($element, array('name', '#value' => 'content'));
  15. unset($element['#value']);
  16. return theme('html_tag', $variables);
  17. }
  18. /**
  19. * Theme callback for a normal meta tag.
  20. *
  21. * The format is:
  22. * <meta http-equiv="[name]" content="[value]" />
  23. */
  24. function theme_metatag_http_equiv($variables) {
  25. $element = &$variables['element'];
  26. element_set_attributes($element, array('#name' => 'http-equiv', '#value' => 'content'));
  27. unset($element['#value']);
  28. return theme('html_tag', $variables);
  29. }
  30. /**
  31. * Theme callback for a rel link tag.
  32. *
  33. * The format is:
  34. * <link rel="[name]" href="[value]" />
  35. */
  36. function theme_metatag_link_rel($variables) {
  37. $element = &$variables['element'];
  38. element_set_attributes($element, array('#name' => 'rel', '#value' => 'href'));
  39. unset($element['#value']);
  40. return theme('html_tag', $variables);
  41. }
  42. /**
  43. * Theme callback for a rev link tag.
  44. *
  45. * The format is:
  46. * <link rev="[name]" href="[value]" />
  47. */
  48. function theme_metatag_link_rev($variables) {
  49. $element = &$variables['element'];
  50. element_set_attributes($element, array('#name' => 'rev', '#value' => 'href'));
  51. unset($element['#value']);
  52. return theme('html_tag', $variables);
  53. }
  54. /**
  55. * Theme callback for a proprty meta tag.
  56. *
  57. * The format is:
  58. * <meta property="[name]" content="[value]" />
  59. */
  60. function theme_metatag_property($variables) {
  61. $element = &$variables['element'];
  62. element_set_attributes($element, array('#name' => 'property', '#value' => 'content'));
  63. unset($element['#value']);
  64. return theme('html_tag', $variables);
  65. }