metatag_dc_advanced.metatag.inc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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. 'maxlength' => 0,
  47. 'weight' => ++$weight,
  48. ) + $defaults;
  49. $info['tags']['dcterms.accessRights'] = array(
  50. 'label' => t('Access rights'),
  51. 'description' => t('Information about who can access the resource or an indication of its security status.'),
  52. 'weight' => ++$weight,
  53. ) + $defaults;
  54. $info['tags']['dcterms.accrualMethod'] = array(
  55. 'label' => t('Accrual Method'),
  56. 'description' => t('The method by which items are added to a collection.'),
  57. 'weight' => ++$weight,
  58. ) + $defaults;
  59. $info['tags']['dcterms.accrualPeriodicity'] = array(
  60. 'label' => t('Accrual Periodicity'),
  61. 'description' => t('The frequency with which items are added to a collection.'),
  62. 'weight' => ++$weight,
  63. ) + $defaults;
  64. $info['tags']['dcterms.accrualPolicy'] = array(
  65. 'label' => t('Accrual Policy'),
  66. 'description' => t('The policy governing the addition of items to a collection.'),
  67. 'weight' => ++$weight,
  68. ) + $defaults;
  69. $info['tags']['dcterms.alternative'] = array(
  70. 'label' => t('Alternative Title'),
  71. 'description' => t('An alternative name for the resource.'),
  72. 'maxlength' => 0,
  73. 'weight' => ++$weight,
  74. ) + $defaults;
  75. $info['tags']['dcterms.audience'] = array(
  76. 'label' => t('Audience'),
  77. 'description' => t('A class of entity for whom the resource is intended or useful.'),
  78. 'weight' => ++$weight,
  79. ) + $defaults;
  80. $info['tags']['dcterms.available'] = array(
  81. 'label' => t('Date Available'),
  82. 'description' => t('Date (often a range) that the resource became or will become available.'),
  83. 'weight' => ++$weight,
  84. 'devel_generate' => array(
  85. 'type' => 'date',
  86. ),
  87. ) + $defaults;
  88. $info['tags']['dcterms.bibliographicCitation'] = array(
  89. 'label' => t('Bibliographic Citation'),
  90. 'description' => t('A bibliographic reference for the resource.'),
  91. 'weight' => ++$weight,
  92. ) + $defaults;
  93. $info['tags']['dcterms.conformsTo'] = array(
  94. 'label' => t('Conforms To'),
  95. 'description' => t('An established standard to which the described resource conforms.'),
  96. 'weight' => ++$weight,
  97. ) + $defaults;
  98. $info['tags']['dcterms.created'] = array(
  99. 'label' => t('Date Created'),
  100. 'description' => t('Date of creation of the resource.'),
  101. 'weight' => ++$weight,
  102. 'devel_generate' => array(
  103. 'type' => 'date',
  104. ),
  105. ) + $defaults;
  106. $info['tags']['dcterms.dateAccepted'] = array(
  107. 'label' => t('Date Accepted'),
  108. 'description' => t('Date of acceptance of the resource.'),
  109. 'weight' => ++$weight,
  110. 'devel_generate' => array(
  111. 'type' => 'date',
  112. ),
  113. ) + $defaults;
  114. $info['tags']['dcterms.dateCopyrighted'] = array(
  115. 'label' => t('Date Copyrighted'),
  116. 'description' => t('Date of copyright.'),
  117. 'weight' => ++$weight,
  118. 'devel_generate' => array(
  119. 'type' => 'date',
  120. ),
  121. ) + $defaults;
  122. $info['tags']['dcterms.dateSubmitted'] = array(
  123. 'label' => t('Date Submitted'),
  124. 'description' => t('Date of submission of the resource.'),
  125. 'weight' => ++$weight,
  126. 'devel_generate' => array(
  127. 'type' => 'date',
  128. ),
  129. ) + $defaults;
  130. $info['tags']['dcterms.educationLevel'] = array(
  131. 'label' => t('Audience Education Level'),
  132. 'description' => t('A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.'),
  133. 'weight' => ++$weight,
  134. ) + $defaults;
  135. $info['tags']['dcterms.extent'] = array(
  136. 'label' => t('Extent'),
  137. 'description' => t('The size or duration of the resource.'),
  138. 'weight' => ++$weight,
  139. ) + $defaults;
  140. $info['tags']['dcterms.hasFormat'] = array(
  141. 'label' => t('Has Format'),
  142. 'description' => t('A related resource that is substantially the same as the pre-existing described resource, but in another format.'),
  143. 'weight' => ++$weight,
  144. ) + $defaults;
  145. $info['tags']['dcterms.hasPart'] = array(
  146. 'label' => t('Has Part'),
  147. 'description' => t('A related resource that is included either physically or logically in the described resource.'),
  148. 'weight' => ++$weight,
  149. ) + $defaults;
  150. $info['tags']['dcterms.hasVersion'] = array(
  151. 'label' => t('Has Version'),
  152. 'description' => t('A related resource that is a version, edition, or adaptation of the described resource.'),
  153. 'weight' => ++$weight,
  154. ) + $defaults;
  155. $info['tags']['dcterms.instructionalMethod'] = array(
  156. 'label' => t('Instructional Method'),
  157. 'description' => t('A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.'),
  158. 'weight' => ++$weight,
  159. ) + $defaults;
  160. $info['tags']['dcterms.isFormatOf'] = array(
  161. 'label' => t('Is Format Of'),
  162. 'description' => t('A related resource that is substantially the same as the described resource, but in another format.'),
  163. 'weight' => ++$weight,
  164. ) + $defaults;
  165. $info['tags']['dcterms.isPartOf'] = array(
  166. 'label' => t('Is Part Of'),
  167. 'description' => t('A related resource in which the described resource is physically or logically included.'),
  168. 'weight' => ++$weight,
  169. ) + $defaults;
  170. $info['tags']['dcterms.isReferencedBy'] = array(
  171. 'label' => t('Is Referenced By'),
  172. 'description' => t('A related resource that references, cites, or otherwise points to the described resource.'),
  173. 'weight' => ++$weight,
  174. ) + $defaults;
  175. $info['tags']['dcterms.isReplacedBy'] = array(
  176. 'label' => t('Is Replaced by'),
  177. 'description' => t('A related resource that supplants, displaces, or supersedes the described resource.'),
  178. 'weight' => ++$weight,
  179. ) + $defaults;
  180. $info['tags']['dcterms.isRequiredBy'] = array(
  181. 'label' => t('Is Required By'),
  182. 'description' => t('A related resource that requires the described resource to support its function, delivery, or coherence.'),
  183. 'weight' => ++$weight,
  184. ) + $defaults;
  185. $info['tags']['dcterms.isVersionOf'] = array(
  186. 'label' => t('Is Version Of'),
  187. 'description' => t('A related resource of which the described resource is a version, edition, or adaptation.'),
  188. 'weight' => ++$weight,
  189. ) + $defaults;
  190. $info['tags']['dcterms.issued'] = array(
  191. 'label' => t('Date Issued'),
  192. 'description' => t('Date of formal issuance (e.g., publication) of the resource.'),
  193. 'weight' => ++$weight,
  194. ) + $defaults;
  195. $info['tags']['dcterms.license'] = array(
  196. 'label' => t('License'),
  197. 'description' => t('A legal document giving official permission to do something with the resource.'),
  198. 'weight' => ++$weight,
  199. ) + $defaults;
  200. $info['tags']['dcterms.mediator'] = array(
  201. 'label' => t('Mediator'),
  202. 'description' => t('An entity that mediates access to the resource and for whom the resource is intended or useful.'),
  203. 'weight' => ++$weight,
  204. ) + $defaults;
  205. $info['tags']['dcterms.medium'] = array(
  206. 'label' => t('Medium'),
  207. 'description' => t('The material or physical carrier of the resource.'),
  208. 'weight' => ++$weight,
  209. ) + $defaults;
  210. $info['tags']['dcterms.modified'] = array(
  211. 'label' => t('Modified Date'),
  212. 'description' => t('Date on which the resource was changed.'),
  213. 'weight' => ++$weight,
  214. 'devel_generate' => array(
  215. 'type' => 'date',
  216. ),
  217. ) + $defaults;
  218. $info['tags']['dcterms.provenance'] = array(
  219. 'label' => t('Provenance'),
  220. '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.'),
  221. 'weight' => ++$weight,
  222. ) + $defaults;
  223. $info['tags']['dcterms.references'] = array(
  224. 'label' => t('References'),
  225. 'description' => t('A related resource that is referenced, cited, or otherwise pointed to by the described resource.'),
  226. 'weight' => ++$weight,
  227. ) + $defaults;
  228. $info['tags']['dcterms.replaces'] = array(
  229. 'label' => t('Replaces'),
  230. 'description' => t('A related resource that is supplanted, displaced, or superseded by the described resource.'),
  231. 'weight' => ++$weight,
  232. ) + $defaults;
  233. $info['tags']['dcterms.requires'] = array(
  234. 'label' => t('Requires'),
  235. 'description' => t('A related resource that is required by the described resource to support its function, delivery, or coherence.'),
  236. 'weight' => ++$weight,
  237. ) + $defaults;
  238. $info['tags']['dcterms.rightsHolder'] = array(
  239. 'label' => t('Rights Holder'),
  240. 'description' => t('A person or organization owning or managing rights over the resource.'),
  241. 'weight' => ++$weight,
  242. ) + $defaults;
  243. $info['tags']['dcterms.spatial'] = array(
  244. 'label' => t('Spatial'),
  245. 'description' => t('Spatial characteristics of the resource.'),
  246. 'weight' => ++$weight,
  247. ) + $defaults;
  248. $info['tags']['dcterms.tableOfContents'] = array(
  249. 'label' => t('Table Of Contents'),
  250. 'description' => t('A list of subunits of the resource.'),
  251. 'weight' => ++$weight,
  252. ) + $defaults;
  253. $info['tags']['dcterms.temporal'] = array(
  254. 'label' => t('Temporal'),
  255. 'description' => t('Temporal characteristics of the resource.'),
  256. 'weight' => ++$weight,
  257. ) + $defaults;
  258. $info['tags']['dcterms.valid'] = array(
  259. 'label' => t('Valid'),
  260. 'description' => t('Date (often a range) of validity of a resource.'),
  261. 'weight' => ++$weight,
  262. ) + $defaults;
  263. return $info;
  264. }