metatag.theme.inc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. $args = array(
  15. '#name' => 'name',
  16. '#value' => 'content',
  17. );
  18. element_set_attributes($element, $args);
  19. unset($element['#value']);
  20. return theme('html_tag', $variables);
  21. }
  22. /**
  23. * Theme callback for a normal meta tag.
  24. *
  25. * The format is:
  26. * <meta http-equiv="[name]" content="[value]" />
  27. */
  28. function theme_metatag_http_equiv($variables) {
  29. $element = &$variables['element'];
  30. $args = array(
  31. '#name' => 'http-equiv',
  32. '#value' => 'content',
  33. );
  34. element_set_attributes($element, $args);
  35. unset($element['#value']);
  36. return theme('html_tag', $variables);
  37. }
  38. /**
  39. * Theme callback for a rel link tag.
  40. *
  41. * The format is:
  42. * <link rel="[name]" href="[value]" />
  43. */
  44. function theme_metatag_link_rel($variables) {
  45. $element = &$variables['element'];
  46. $args = array(
  47. '#name' => 'rel',
  48. '#value' => 'href',
  49. );
  50. element_set_attributes($element, $args);
  51. unset($element['#value']);
  52. return theme('html_tag', $variables);
  53. }
  54. /**
  55. * Theme callback for a rev link tag.
  56. *
  57. * The format is:
  58. * <link rev="[name]" href="[value]" />
  59. */
  60. function theme_metatag_link_rev($variables) {
  61. $element = &$variables['element'];
  62. $args = array(
  63. '#name' => 'rev',
  64. '#value' => 'href',
  65. );
  66. element_set_attributes($element, $args);
  67. unset($element['#value']);
  68. return theme('html_tag', $variables);
  69. }
  70. /**
  71. * Theme callback for a proprty meta tag.
  72. *
  73. * The format is:
  74. * <meta property="[name]" content="[value]" />
  75. */
  76. function theme_metatag_property($variables) {
  77. $element = &$variables['element'];
  78. $args = array(
  79. '#name' => 'property',
  80. '#value' => 'content',
  81. );
  82. element_set_attributes($element, $args);
  83. unset($element['#value']);
  84. return theme('html_tag', $variables);
  85. }