Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.456
diff -u -p -r1.456 theme.inc
--- includes/theme.inc 16 Dec 2008 22:05:50 -0000 1.456
+++ includes/theme.inc 29 Dec 2008 19:13:34 -0000
@@ -916,6 +916,8 @@ function theme_get_settings($key = NULL)
'toggle_comment_user_picture' => 0,
'toggle_main_menu' => 1,
'toggle_secondary_menu' => 1,
+ 'rdfa_date' => 1,
+ 'rdfa_author' => 1,
);
if (module_exists('node')) {
@@ -1677,10 +1679,22 @@ function theme_username($object) {
}
if (user_access('access user profiles')) {
- $output = l($name, 'user/' . $object->uid, array('attributes' => array('title' => t('View user profile.'))));
+ if (theme_get_setting('rdfa_author')) {
+ $output = l($name, 'user/' . $object->uid, array('attributes' => array('title' => t('View user profile.'), 'property' => 'foaf:name', 'about' => url('user/' . $object->uid) . '#user')));
+ $output = '' . $output . '';
+ }
+ else {
+ $output = l($name, 'user/' . $object->uid, array('attributes' => array('title' => t('View user profile.'))));
+ }
}
else {
- $output = check_plain($name);
+ if (theme_get_setting('rdfa_author')) {
+ $output = check_plain($name);
+ $output = '' . $output . '';
+ }
+ else {
+ $output = check_plain($name);
+ }
}
}
elseif ($object->name) {
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.674
diff -u -p -r1.674 comment.module
--- modules/comment/comment.module 29 Dec 2008 16:03:56 -0000 1.674
+++ modules/comment/comment.module 29 Dec 2008 19:13:36 -0000
@@ -1881,10 +1881,17 @@ function template_preprocess_comment_wra
* @ingroup themeable
*/
function theme_comment_submitted($comment) {
- return t('Submitted by !username on @datetime.',
+ if (theme_get_setting('rdfa_date')) {
+ $date_iso8601 = format_date($comment->timestamp, 'custom', 'c');
+ $datetime = '' . format_date($comment->timestamp) . '';
+ }
+ else {
+ $datetime = format_date($comment->timestamp);
+ }
+ return t('Submitted by !username on !datetime.',
array(
'!username' => theme('username', $comment),
- '@datetime' => format_date($comment->timestamp)
+ '!datetime' => $datetime,
));
}
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1004
diff -u -p -r1.1004 node.module
--- modules/node/node.module 20 Dec 2008 18:24:38 -0000 1.1004
+++ modules/node/node.module 29 Dec 2008 19:13:39 -0000
@@ -2666,10 +2666,17 @@ function node_forms() {
* @ingroup themeable
*/
function theme_node_submitted($node) {
- return t('Submitted by !username on @datetime',
+ if (theme_get_setting('rdfa_date')) {
+ $date_iso8601 = format_date($node->created, 'custom', 'c');
+ $datetime = '' . format_date($node->created) . '';
+ }
+ else {
+ $datetime = format_date($node->created);
+ }
+ return t('Submitted by !username on !datetime',
array(
'!username' => theme('username', $node),
- '@datetime' => format_date($node->created),
+ '!datetime' => $datetime,
));
}
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.110
diff -u -p -r1.110 system.admin.inc
--- modules/system/system.admin.inc 26 Nov 2008 13:54:05 -0000 1.110
+++ modules/system/system.admin.inc 29 Dec 2008 19:13:42 -0000
@@ -428,6 +428,28 @@ function system_theme_settings(&$form_st
$form['theme_settings']['#access'] = FALSE;
}
+ // RDFa settings
+ if ((!$key) || in_array('rdfa', $features)) {
+ $form['rdfa'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Toggle RDFa annotation'),
+ '#description' => t('Enable or disable the RDFa annotation of certain page elements.'),
+ '#attributes' => array('class' => 'theme-settings-bottom'),
+ );
+ $form['rdfa']['rdfa_date'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Date on posts and comments'),
+ '#default_value' => $settings['rdfa_date'],
+ '#tree' => FALSE,
+ );
+ $form['rdfa']['rdfa_author'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Author on posts and comments'),
+ '#default_value' => $settings['rdfa_author'],
+ '#tree' => FALSE,
+ );
+ }
+
// Logo settings
if ((!$key) || in_array('logo', $features)) {
$form['logo'] = array(
Index: themes/garland/template.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/template.php,v
retrieving revision 1.19
diff -u -p -r1.19 template.php
--- themes/garland/template.php 25 Jun 2008 09:12:25 -0000 1.19
+++ themes/garland/template.php 29 Dec 2008 19:13:42 -0000
@@ -67,10 +67,17 @@ function garland_menu_local_tasks() {
* Format the "Submitted by username on date/time" for each comment.
*/
function phptemplate_comment_submitted($comment) {
+ if (theme_get_setting('rdfa_date')) {
+ $date_iso8601 = format_date($comment->timestamp, 'custom', 'c');
+ $datetime = '' . format_date($comment->timestamp) . '';
+ }
+ else {
+ $datetime = format_date($node->created);
+ }
return t('!datetime — !username',
array(
'!username' => theme('username', $comment),
- '!datetime' => format_date($comment->timestamp)
+ '!datetime' => $datetime,
));
}
@@ -78,10 +85,17 @@ function phptemplate_comment_submitted($
* Format the "Submitted by username on date/time" for each node.
*/
function garland_node_submitted($node) {
+ if (theme_get_setting('rdfa_date')) {
+ $date_iso8601 = format_date($node->created, 'custom', 'c');
+ $datetime = '' . format_date($node->created) . '';
+ }
+ else {
+ $datetime = format_date($node->created);
+ }
return t('!datetime — !username',
array(
'!username' => theme('username', $node),
- '!datetime' => format_date($node->created),
+ '!datetime' => $datetime,
));
}