summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-19 18:28:16 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-19 18:28:16 +0000
commit24669bfb50d643330cd50cbeea21d19d51107a36 (patch)
tree93eca4ca9d1a4b409b6ee4aac75362080136a5a4 /modules/node
parent0b750209b6ead13c836852eb96bc6cc8f14de51f (diff)
downloadbrdo-24669bfb50d643330cd50cbeea21d19d51107a36.tar.gz
brdo-24669bfb50d643330cd50cbeea21d19d51107a36.tar.bz2
- Patch #493030 by scor, Stefan Freudenberg, pwolanin, fago, Benjamin Melançon, kriskras, dmitrig01, sun: added RDFa support to Drupal core. Oh my, oh my.
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/node.module41
-rw-r--r--modules/node/node.tpl.php6
2 files changed, 44 insertions, 3 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index de59e22f7..b0301e854 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -754,6 +754,47 @@ function node_type_set_defaults($info = array()) {
}
/**
+ * Define the default RDF mapping for the node entity type.
+ *
+ * These default mapping properties are used by rdf_save_mapping() to populate
+ * non-existing properties before they are saved to the database.
+ *
+ * @return
+ * A list of default mapping properties for the node entity type.
+ */
+function node_rdf_mapping() {
+ return array(
+ array(
+ 'type' => 'node',
+ 'bundle' => RDF_DEFAULT_BUNDLE,
+ 'mapping' => array(
+ 'rdftype' => array('sioc:Item', 'foaf:Document'),
+ 'title' => array(
+ 'predicates' => array('dc:title'),
+ ),
+ 'created' => array(
+ 'predicates' => array('dc:date', 'dc:created'),
+ 'datatype' => 'xsd:dateTime',
+ 'callback' => 'date_iso8601',
+ ),
+ 'changed' => array(
+ 'predicates' => array('dc:modified'),
+ ),
+ 'body' => array(
+ 'predicates' => array('content:encoded'),
+ ),
+ 'uid' => array(
+ 'predicates' => array('sioc:has_creator'),
+ ),
+ 'name' => array(
+ 'predicates' => array('foaf:name'),
+ ),
+ ),
+ ),
+ );
+}
+
+/**
* Determine whether a node hook exists.
*
* @param $node
diff --git a/modules/node/node.tpl.php b/modules/node/node.tpl.php
index ae03d400d..3b50ebcd4 100644
--- a/modules/node/node.tpl.php
+++ b/modules/node/node.tpl.php
@@ -13,7 +13,7 @@
* given element.
* - $user_picture: The node author's picture from user-picture.tpl.php.
* - $date: Formatted creation date (use $created to reformat with
- * format_date()).
+ * format_date()). This data is excepted to be sanitized beforehand.
* - $name: Themed username of node author output from theme_username().
* - $node_url: Direct url of the current node.
* - $terms: the themed list of taxonomy term links output from theme_links().
@@ -88,8 +88,8 @@
<?php if ($display_submitted): ?>
<span class="submitted">
<?php
- print t('Submitted by !username on @datetime',
- array('!username' => $name, '@datetime' => $date));
+ print t('Submitted by !username on !datetime',
+ array('!username' => $name, '!datetime' => $date));
?>
</span>
<?php endif; ?>