metatag_dc_advanced.metatag.inc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <?php
  2. /**
  3. * @file
  4. * Metatag integration for the metatag_dc module.
  5. */
  6. /**
  7. * Implements hook_metatag_bundled_config_alter().
  8. */
  9. function metatag_dc_advanced_metatag_bundled_config_alter(array &$configs) {
  10. foreach ($configs as &$config) {
  11. switch ($config->instance) {
  12. case 'node':
  13. $config->config += array(
  14. 'dcterms.modified' => array('value' => '[node:changed:custom:Y-m-d\TH:iP]'),
  15. );
  16. break;
  17. }
  18. }
  19. }
  20. /**
  21. * Implements hook_metatag_info().
  22. * Dublin Core Elements taken from http://purl.org/dc/elements/1.1/.
  23. */
  24. function metatag_dc_advanced_metatag_info() {
  25. $info['groups']['dublin-core-additional'] = array(
  26. 'label' => t('Dublin Core Additional Tags'),
  27. 'description' => t('These tags are not part of the Metadata Element Set but may be useful for certain scenarios.'),
  28. 'form' => array(
  29. '#weight' => 71,
  30. ),
  31. );
  32. // Dublin Core meta tags stack after the Twitter Cards tags.
  33. $weight = 80;
  34. // Additional tags.
  35. $defaults = array(
  36. 'class' => 'DrupalTextMetaTag',
  37. 'group' => 'dublin-core-additional',
  38. 'element' => array(
  39. '#type' => 'term',
  40. '#theme' => 'metatag_dc',
  41. ),
  42. );
  43. $info['tags']['dcterms.abstract'] = array(
  44. 'label' => t('Abstract'),
  45. 'description' => t('A summary of the resource.'),
  46. 'weight' => ++$weight,
  47. ) + $defaults;
  48. $info['tags']['dcterms.accessRights'] = array(
  49. 'label' => t('Access rights'),
  50. 'description' => t('Information about who can access the resource or an indication of its security status.'),
  51. 'weight' => ++$weight,
  52. ) + $defaults;
  53. $info['tags']['dcterms.accrualMethod'] = array(
  54. 'label' => t('Accrual Method'),
  55. 'description' => t('The method by which items are added to a collection.'),
  56. 'weight' => ++$weight,
  57. ) + $defaults;
  58. $info['tags']['dcterms.accrualPeriodicity'] = array(
  59. 'label' => t('Accrual Periodicity'),
  60. 'description' => t('The frequency with which items are added to a collection.'),
  61. 'weight' => ++$weight,
  62. ) + $defaults;
  63. $info['tags']['dcterms.accrualPolicy'] = array(
  64. 'label' => t('Accrual Policy'),
  65. 'description' => t('The policy governing the addition of items to a collection.'),
  66. 'weight' => ++$weight,
  67. ) + $defaults;
  68. $info['tags']['dcterms.alternative'] = array(
  69. 'label' => t('Alternative Title'),
  70. 'description' => t('An alternative name for the resource.'),
  71. 'weight' => ++$weight,
  72. ) + $defaults;
  73. $info['tags']['dcterms.audience'] = array(
  74. 'label' => t('Audience'),
  75. 'description' => t('A class of entity for whom the resource is intended or useful.'),
  76. 'weight' => ++$weight,
  77. ) + $defaults;
  78. $info['tags']['dcterms.available'] = array(
  79. 'label' => t('Date Available'),
  80. 'description' => t('Date (often a range) that the resource became or will become available.'),
  81. 'weight' => ++$weight,
  82. 'devel_generate' => array(
  83. 'type' => 'date',
  84. ),
  85. ) + $defaults;
  86. $info['tags']['dcterms.bibliographicCitation'] = array(
  87. 'label' => t('Bibliographic Citation'),
  88. 'description' => t('A bibliographic reference for the resource.'),
  89. 'weight' => ++$weight,
  90. ) + $defaults;
  91. $info['tags']['dcterms.conformsTo'] = array(
  92. 'label' => t('Conforms To'),
  93. 'description' => t('An established standard to which the described resource conforms.'),
  94. 'weight' => ++$weight,
  95. ) + $defaults;
  96. $info['tags']['dcterms.created'] = array(
  97. 'label' => t('Date Created'),
  98. 'description' => t('Date of creation of the resource.'),
  99. 'weight' => ++$weight,
  100. 'devel_generate' => array(
  101. 'type' => 'date',
  102. ),
  103. ) + $defaults;
  104. $info['tags']['dcterms.dateAccepted'] = array(
  105. 'label' => t('Date Accepted'),
  106. 'description' => t('Date of acceptance of the resource.'),
  107. 'weight' => ++$weight,
  108. 'devel_generate' => array(
  109. 'type' => 'date',
  110. ),
  111. ) + $defaults;
  112. $info['tags']['dcterms.dateCopyrighted'] = array(
  113. 'label' => t('Date Copyrighted'),
  114. 'description' => t('Date of copyright.'),
  115. 'weight' => ++$weight,
  116. 'devel_generate' => array(
  117. 'type' => 'date',
  118. ),
  119. ) + $defaults;
  120. $info['tags']['dcterms.dateSubmitted'] = array(
  121. 'label' => t('Date Submitted'),
  122. 'description' => t('Date of submission of the resource.'),
  123. 'weight' => ++$weight,
  124. 'devel_generate' => array(
  125. 'type' => 'date',
  126. ),
  127. ) + $defaults;
  128. $info['tags']['dcterms.educationLevel'] = array(
  129. 'label' => t('Audience Education Level'),
  130. 'description' => t('A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.'),
  131. 'weight' => ++$weight,
  132. ) + $defaults;
  133. $info['tags']['dcterms.extent'] = array(
  134. 'label' => t('Extent'),
  135. 'description' => t('The size or duration of the resource.'),
  136. 'weight' => ++$weight,
  137. ) + $defaults;
  138. $info['tags']['dcterms.hasFormat'] = array(
  139. 'label' => t('Has Format'),
  140. 'description' => t('A related resource that is substantially the same as the pre-existing described resource, but in another format.'),
  141. 'weight' => ++$weight,
  142. ) + $defaults;
  143. $info['tags']['dcterms.hasPart'] = array(
  144. 'label' => t('Has Part'),
  145. 'description' => t('A related resource that is included either physically or logically in the described resource.'),
  146. 'weight' => ++$weight,
  147. ) + $defaults;
  148. $info['tags']['dcterms.hasVersion'] = array(
  149. 'label' => t('Has Version'),
  150. 'description' => t('A related resource that is a version, edition, or adaptation of the described resource.'),
  151. 'weight' => ++$weight,
  152. ) + $defaults;
  153. $info['tags']['dcterms.instructionalMethod'] = array(
  154. 'label' => t('Instructional Method'),
  155. 'description' => t('A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.'),
  156. 'weight' => ++$weight,
  157. ) + $defaults;
  158. $info['tags']['dcterms.isFormatOf'] = array(
  159. 'label' => t('Is Format Of'),
  160. 'description' => t('A related resource that is substantially the same as the described resource, but in another format.'),
  161. 'weight' => ++$weight,
  162. ) + $defaults;
  163. $info['tags']['dcterms.isPartOf'] = array(
  164. 'label' => t('Is Part Of'),
  165. 'description' => t('A related resource in which the described resource is physically or logically included.'),
  166. 'weight' => ++$weight,
  167. ) + $defaults;
  168. $info['tags']['dcterms.isReferencedBy'] = array(
  169. 'label' => t('Is Referenced By'),
  170. 'description' => t('A related resource that references, cites, or otherwise points to the described resource.'),
  171. 'weight' => ++$weight,
  172. ) + $defaults;
  173. $info['tags']['dcterms.isReplacedBy'] = array(
  174. 'label' => t('Is Replaced by'),
  175. 'description' => t('A related resource that supplants, displaces, or supersedes the described resource.'),
  176. 'weight' => ++$weight,
  177. ) + $defaults;
  178. $info['tags']['dcterms.isRequiredBy'] = array(
  179. 'label' => t('Is Required By'),
  180. 'description' => t('A related resource that requires the described resource to support its function, delivery, or coherence.'),
  181. 'weight' => ++$weight,
  182. ) + $defaults;
  183. $info['tags']['dcterms.isVersionOf'] = array(
  184. 'label' => t('Is Version Of'),
  185. 'description' => t('A related resource of which the described resource is a version, edition, or adaptation.'),
  186. 'weight' => ++$weight,
  187. ) + $defaults;
  188. $info['tags']['dcterms.issued'] = array(
  189. 'label' => t('Date Issued'),
  190. 'description' => t('Date of formal issuance (e.g., publication) of the resource.'),
  191. 'weight' => ++$weight,
  192. ) + $defaults;
  193. $info['tags']['dcterms.license'] = array(
  194. 'label' => t('License'),
  195. 'description' => t('A legal document giving official permission to do something with the resource.'),
  196. 'weight' => ++$weight,
  197. ) + $defaults;
  198. $info['tags']['dcterms.mediator'] = array(
  199. 'label' => t('Mediator'),
  200. 'description' => t('An entity that mediates access to the resource and for whom the resource is intended or useful.'),
  201. 'weight' => ++$weight,
  202. ) + $defaults;
  203. $info['tags']['dcterms.medium'] = array(
  204. 'label' => t('Medium'),
  205. 'description' => t('The material or physical carrier of the resource.'),
  206. 'weight' => ++$weight,
  207. ) + $defaults;
  208. $info['tags']['dcterms.modified'] = array(
  209. 'label' => t('Modified Date'),
  210. 'description' => t('Date on which the resource was changed.'),
  211. 'weight' => ++$weight,
  212. 'devel_generate' => array(
  213. 'type' => 'date',
  214. ),
  215. ) + $defaults;
  216. $info['tags']['dcterms.provenance'] = array(
  217. 'label' => t('Provenance'),
  218. 'description' => t('A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.'),
  219. 'weight' => ++$weight,
  220. ) + $defaults;
  221. $info['tags']['dcterms.references'] = array(
  222. 'label' => t('References'),
  223. 'description' => t('A related resource that is referenced, cited, or otherwise pointed to by the described resource.'),
  224. 'weight' => ++$weight,
  225. ) + $defaults;
  226. $info['tags']['dcterms.replaces'] = array(
  227. 'label' => t('Replaces'),
  228. 'description' => t('A related resource that is supplanted, displaced, or superseded by the described resource.'),
  229. 'weight' => ++$weight,
  230. ) + $defaults;
  231. $info['tags']['dcterms.requires'] = array(
  232. 'label' => t('Requires'),
  233. 'description' => t('A related resource that is required by the described resource to support its function, delivery, or coherence.'),
  234. 'weight' => ++$weight,
  235. ) + $defaults;
  236. $info['tags']['dcterms.rightsHolder'] = array(
  237. 'label' => t('Rights Holder'),
  238. 'description' => t('A person or organization owning or managing rights over the resource.'),
  239. 'weight' => ++$weight,
  240. ) + $defaults;
  241. $info['tags']['dcterms.spatial'] = array(
  242. 'label' => t('Spatial'),
  243. 'description' => t('Spatial characteristics of the resource.'),
  244. 'weight' => ++$weight,
  245. ) + $defaults;
  246. $info['tags']['dcterms.tableOfContents'] = array(
  247. 'label' => t('Table Of Contents'),
  248. 'description' => t('A list of subunits of the resource.'),
  249. 'weight' => ++$weight,
  250. ) + $defaults;
  251. $info['tags']['dcterms.temporal'] = array(
  252. 'label' => t('Temporal'),
  253. 'description' => t('Temporal characteristics of the resource.'),
  254. 'weight' => ++$weight,
  255. ) + $defaults;
  256. $info['tags']['dcterms.valid'] = array(
  257. 'label' => t('Valid'),
  258. 'description' => t('Date (often a range) of validity of a resource.'),
  259. 'weight' => ++$weight,
  260. ) + $defaults;
  261. return $info;
  262. }