diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-01 00:18:15 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-01 00:18:15 +0000 |
commit | 9ada5dec79b8f42e47a7245a91b669e240c6f6c9 (patch) | |
tree | 4c442b288dcedfef32ee31e6e85004db5d37c19c /themes | |
parent | 66ffb5f7e8562a2f880be3b58dcf1e602cd95d4f (diff) | |
download | brdo-9ada5dec79b8f42e47a7245a91b669e240c6f6c9.tar.gz brdo-9ada5dec79b8f42e47a7245a91b669e240c6f6c9.tar.bz2 |
#364470 follow-up by Dave Reid, JohnAlbin, et al: Move submitted by back into a variable. The string approach was too limited.
Diffstat (limited to 'themes')
-rw-r--r-- | themes/bartik/template.php | 7 | ||||
-rw-r--r-- | themes/bartik/templates/comment.tpl.php | 2 | ||||
-rw-r--r-- | themes/bartik/templates/node.tpl.php | 9 | ||||
-rw-r--r-- | themes/garland/comment.tpl.php | 2 | ||||
-rw-r--r-- | themes/garland/node.tpl.php | 2 | ||||
-rw-r--r-- | themes/garland/template.php | 14 |
6 files changed, 29 insertions, 7 deletions
diff --git a/themes/bartik/template.php b/themes/bartik/template.php index e94782527..a3393a426 100644 --- a/themes/bartik/template.php +++ b/themes/bartik/template.php @@ -103,6 +103,13 @@ function bartik_process_maintenance_page(&$variables) { } /** + * Override or insert variables into the node template. + */ +function bartik_preprocess_node(&$variables) { + $variables['submitted'] = t('published by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date'])); +} + +/** * Override or insert variables into the block template. */ function bartik_preprocess_block(&$variables) { diff --git a/themes/bartik/templates/comment.tpl.php b/themes/bartik/templates/comment.tpl.php index 463b3ba87..d83f178ba 100644 --- a/themes/bartik/templates/comment.tpl.php +++ b/themes/bartik/templates/comment.tpl.php @@ -19,6 +19,8 @@ * desired parameters on the $comment->changed variable. * - $new: New comment marker. * - $permalink: Comment permalink. + * - $submitted: Submission information created from $author and $created during + * template_preprocess_comment(). * - $picture: Authors picture. * - $signature: Authors signature. * - $status: Comment status. Possible values are: diff --git a/themes/bartik/templates/node.tpl.php b/themes/bartik/templates/node.tpl.php index e3ada69db..7b8377d04 100644 --- a/themes/bartik/templates/node.tpl.php +++ b/themes/bartik/templates/node.tpl.php @@ -16,7 +16,9 @@ * calling format_date() with the desired parameters on the $created variable. * - $name: Themed username of node author output from theme_username(). * - $node_url: Direct url of the current node. - * - $display_submitted: whether submission information should be displayed. + * - $display_submitted: Whether submission information should be displayed. + * - $submitted: Submission information created from $name and $date during + * template_preprocess_node(). * - $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 @@ -90,10 +92,7 @@ <?php if ($display_submitted): ?> <div class="meta submitted"> <?php print $user_picture; ?> - <?php - print t('published by !username on !datetime', - array('!username' => $name, '!datetime' => $date)); - ?> + <?php print $submitted; ?> </div> <?php endif; ?> diff --git a/themes/garland/comment.tpl.php b/themes/garland/comment.tpl.php index b46c1edfc..a11f4fce5 100644 --- a/themes/garland/comment.tpl.php +++ b/themes/garland/comment.tpl.php @@ -5,7 +5,7 @@ <div class="clearfix"> - <span class="submitted"><?php print $created; ?> — <?php print $author; ?></span> + <span class="submitted"><?php print $submitted ?></span> <?php if ($new) : ?> <span class="new"><?php print drupal_ucfirst($new) ?></span> diff --git a/themes/garland/node.tpl.php b/themes/garland/node.tpl.php index 6a7ae448d..0d15d8c58 100644 --- a/themes/garland/node.tpl.php +++ b/themes/garland/node.tpl.php @@ -12,7 +12,7 @@ <?php print render($title_suffix); ?> <?php if ($display_submitted): ?> - <span class="submitted"><?php print $date; ?> — <?php print $name; ?></span> + <span class="submitted"><?php print $submitted ?></span> <?php endif; ?> <div class="content clearfix"<?php print $content_attributes; ?>> diff --git a/themes/garland/template.php b/themes/garland/template.php index 8021d7cdd..b9234c972 100644 --- a/themes/garland/template.php +++ b/themes/garland/template.php @@ -120,6 +120,20 @@ function garland_preprocess_page(&$vars) { } /** + * Override or insert variables into the node template. + */ +function garland_preprocess_node(&$vars) { + $vars['submitted'] = $vars['date'] . ' — ' . $vars['name']; +} + +/** + * Override or insert variables into the comment template. + */ +function garland_preprocess_comment(&$vars) { + $vars['submitted'] = $vars['created'] . ' — ' . $vars['author']; +} + +/** * Override or insert variables into the block template. */ function garland_preprocess_block(&$vars) { |