? 374441-refactor-html-corrector_7.patch ? rdfa_author_date_2.patch ? rdfa_author_date_3.patch ? rdfa_tpl1.patch ? sites/default/files ? sites/default/settings.php Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.483 diff -u -p -r1.483 theme.inc --- includes/theme.inc 12 May 2009 08:37:44 -0000 1.483 +++ includes/theme.inc 12 May 2009 11:14:09 -0000 @@ -922,6 +922,8 @@ function theme_get_settings($key = NULL) 'toggle_comment_user_verification' => 1, 'toggle_main_menu' => 1, 'toggle_secondary_menu' => 1, + 'rdfa_date' => 1, + 'rdfa_author' => 1, ); $settings = array_merge($defaults, variable_get('theme_settings', array())); @@ -1627,10 +1629,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.709 diff -u -p -r1.709 comment.module --- modules/comment/comment.module 12 May 2009 08:37:44 -0000 1.709 +++ modules/comment/comment.module 12 May 2009 11:14:10 -0000 @@ -1966,10 +1966,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.1046 diff -u -p -r1.1046 node.module --- modules/node/node.module 12 May 2009 08:31:17 -0000 1.1046 +++ modules/node/node.module 12 May 2009 11:14:11 -0000 @@ -2851,10 +2851,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.142 diff -u -p -r1.142 system.admin.inc --- modules/system/system.admin.inc 12 May 2009 08:37:45 -0000 1.142 +++ modules/system/system.admin.inc 12 May 2009 11:14:12 -0000 @@ -397,6 +397,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.20 diff -u -p -r1.20 template.php --- themes/garland/template.php 20 Jan 2009 03:18:41 -0000 1.20 +++ themes/garland/template.php 12 May 2009 11:14:12 -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, )); }