summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-07-01 23:15:41 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-07-01 23:15:41 +0000
commit3409019929da282bca397ccfa64985c5d74394f9 (patch)
tree992bfbd986c169ba995aaf21e690b8eae2811170 /modules
parent9e1c8ededcea32fa55854fa08eef227ffcf8a593 (diff)
downloadbrdo-3409019929da282bca397ccfa64985c5d74394f9.tar.gz
brdo-3409019929da282bca397ccfa64985c5d74394f9.tar.bz2
#146386 by kbahey: refactor 'submitted by user - date' themeing and make it more verbose to translate
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/comment.module18
-rw-r--r--modules/node/node.module16
2 files changed, 30 insertions, 4 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 495637b94..f7141b1d0 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -184,6 +184,9 @@ function comment_theme() {
'comment_wrapper' => array(
'arguments' => array('content' => NULL),
),
+ 'comment_submitted' => array(
+ 'arguments' => array('comment' => NULL),
+ ),
);
}
@@ -1853,9 +1856,7 @@ function template_preprocess_comment(&$variables) {
$variables['new'] = $comment->new ? t('new') : '';
$variables['picture'] = theme_get_setting('toggle_comment_user_picture') ? theme('user_picture', $comment) : '';
$variables['signature'] = $comment->signature;
- $variables['submitted'] = t('Submitted by !a on @b.',
- array('!a' => theme('username', $comment),
- '@b' => format_date($comment->timestamp)));
+ $variables['submitted'] = theme('comment_submitted', $comment);
$variables['title'] = l($comment->subject, $_GET['q'], array('fragment' => "comment-$comment->cid"));
$variables['template_files'][] = 'comment-'. $node->type;
}
@@ -1917,6 +1918,17 @@ function theme_comment_wrapper($content) {
return '<div id="comments">'. $content .'</div>';
}
+/**
+ * Make the submitted variable themable
+ */
+function theme_comment_submitted($comment) {
+ return t('Submitted by !username on @datetime.',
+ array(
+ '!username' => theme('username', $comment),
+ '@datetime' => format_date($comment->timestamp)
+ ));
+}
+
function _comment_delete_thread($comment) {
if (!is_object($comment) || !is_numeric($comment->cid)) {
watchdog('content', 'Can not delete non-existent comment.', WATCHDOG_WARNING);
diff --git a/modules/node/node.module b/modules/node/node.module
index c1eadf292..d8949dd65 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -84,6 +84,9 @@ function node_theme() {
'node_log_message' => array(
'arguments' => array('log' => NULL),
),
+ 'node_submitted' => array(
+ 'arguments' => array('node' => NULL),
+ ),
);
}
@@ -3205,6 +3208,17 @@ function node_forms() {
}
/**
+ * Format the "Submitted by username on date/time" for each node
+ */
+function theme_node_submitted($node) {
+ return t('Submitted by !username on @datetime',
+ array(
+ '!username' => theme('username', $node),
+ '@datetime' => format_date($node->created),
+ ));
+}
+
+/**
* Implementation of hook_hook_info().
*/
function node_hook_info() {
@@ -3477,4 +3491,4 @@ function node_unpublish_by_keyword_action($node, $context) {
break;
}
}
-} \ No newline at end of file
+}