diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/comment/comment.module | 19 | ||||
-rw-r--r-- | modules/comment/comment.tpl.php | 6 | ||||
-rw-r--r-- | modules/node/node.module | 20 | ||||
-rw-r--r-- | modules/node/node.test | 4 | ||||
-rw-r--r-- | modules/node/node.tpl.php | 14 |
5 files changed, 17 insertions, 46 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index afdc87d62..e336b90e1 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -148,9 +148,6 @@ function comment_theme() { 'template' => 'comment-wrapper', 'arguments' => array('content' => NULL), ), - 'comment_submitted' => array( - 'arguments' => array('comment' => NULL), - ), ); } @@ -2088,7 +2085,6 @@ function template_preprocess_comment(&$variables) { $variables['new'] = !empty($comment->new) ? t('new') : ''; $variables['picture'] = theme_get_setting('toggle_comment_user_picture') ? theme('user_picture', $comment) : ''; $variables['signature'] = $comment->signature; - $variables['submitted'] = theme('comment_submitted', $comment); $variables['title'] = l($comment->subject, 'comment/' . $comment->cid, array('fragment' => "comment-$comment->cid")); $variables['template_files'][] = 'comment-' . $variables['node']->type; // Set status to a string representation of comment->status. @@ -2170,21 +2166,6 @@ function template_preprocess_comment_wrapper(&$variables) { } /** - * Theme a "Submitted by ..." notice. - * - * @param $comment - * The comment. - * @ingroup themeable - */ -function theme_comment_submitted($comment) { - return t('Submitted by !username on @datetime.', - array( - '!username' => theme('username', $comment), - '@datetime' => format_date($comment->timestamp) - )); -} - -/** * Return an array of viewing modes for comment listings. * * We can't use a global variable array because the locale system diff --git a/modules/comment/comment.tpl.php b/modules/comment/comment.tpl.php index abcca9378..cae102f85 100644 --- a/modules/comment/comment.tpl.php +++ b/modules/comment/comment.tpl.php @@ -17,7 +17,6 @@ * - $signature: Authors signature. * - $status: Comment status. Possible values are: * comment-unpublished, comment-published or comment-preview. - * - $submitted: By line with date and time. * - $title: Linked title. * - $classes: String of classes that can be used to style contextually through * CSS. It can be manipulated through the variable $classes_array from @@ -55,7 +54,10 @@ <h3><?php print $title ?></h3> <div class="submitted"> - <?php print $submitted ?> + <?php + print t('Submitted by !username on @datetime.', + array('!username' => $author, '@datetime' => $date)); + ?> </div> <div class="content"> diff --git a/modules/node/node.module b/modules/node/node.module index 1218b9d32..0561adb20 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -128,9 +128,6 @@ function node_theme() { 'node_log_message' => array( 'arguments' => array('log' => NULL), ), - 'node_submitted' => array( - 'arguments' => array('node' => NULL), - ), 'node_admin_overview' => array( 'arguments' => array('name' => NULL, 'type' => NULL), ), @@ -1142,11 +1139,11 @@ function template_preprocess_node(&$variables) { // Display post information only on certain node types. if (variable_get('node_submitted_' . $node->type, TRUE)) { - $variables['submitted'] = theme('node_submitted', $node); + $variables['display_submitted'] = TRUE; $variables['user_picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $node) : ''; } else { - $variables['submitted'] = ''; + $variables['display_submitted'] = FALSE; $variables['user_picture'] = ''; } @@ -2808,19 +2805,6 @@ function node_forms() { } /** - * Format the "Submitted by username on date/time" for each node - * - * @ingroup themeable - */ -function theme_node_submitted($node) { - return t('Submitted by !username on @datetime', - array( - '!username' => theme('username', $node), - '@datetime' => format_date($node->created), - )); -} - -/** * Implement hook_hook_info(). */ function node_hook_info() { diff --git a/modules/node/node.test b/modules/node/node.test index 389494b57..0de3355ca 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -533,7 +533,7 @@ class NodePostSettingsTestCase extends DrupalWebTestCase { // Check that the post information is displayed. $node = $this->drupalGetNodeByTitle($edit['title']); - $this->assertRaw(theme('node_submitted', $node), t('Post information is displayed.')); + $this->assertRaw('<span class="submitted">', t('Post information is displayed.')); } /** @@ -555,7 +555,7 @@ class NodePostSettingsTestCase extends DrupalWebTestCase { // Check that the post information is displayed. $node = $this->drupalGetNodeByTitle($edit['title']); - $this->assertNoRaw(theme('node_submitted', $node), t('Post information is not displayed.')); + $this->assertNoRaw('<span class="submitted">', t('Post information is not displayed.')); } } diff --git a/modules/node/node.tpl.php b/modules/node/node.tpl.php index 6ca204a5d..c3aa23539 100644 --- a/modules/node/node.tpl.php +++ b/modules/node/node.tpl.php @@ -17,8 +17,7 @@ * - $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(). - * - $submitted: themed submission information output from - * theme_node_submitted(). + * - $display_submitted: whether submission information should be displayed. * - $classes: String of classes that can be used to style contextually through * CSS. It can be manipulated through the variable $classes_array from * preprocess functions. The default values can be one or more of the following: @@ -79,10 +78,15 @@ <h2><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2> <?php endif; ?> - <?php if ($submitted || !empty($content['links']['terms'])): ?> + <?php if ($display_submitted || !empty($content['links']['terms'])): ?> <div class="meta"> - <?php if ($submitted): ?> - <span class="submitted"><?php print $submitted; ?></span> + <?php if ($display_submitted): ?> + <span class="submitted"> + <?php + print t('Submitted by !username on @datetime', + array('!username' => $name, '@datetime' => $date)); + ?> + </span> <?php endif; ?> <?php if (!empty($content['links']['terms'])): ?> |