metatag.theme.inc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. }