diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-08-25 10:27:15 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-08-25 10:27:15 +0000 |
commit | 14b233ec1d4d1d57995ce92f65377f7349516a29 (patch) | |
tree | 32e2a7c12efb894f5b3992ae2edb59306dca8b99 | |
parent | d55daf0fc49a53f5bc3ff35b7fa1c1c7ce628835 (diff) | |
download | brdo-14b233ec1d4d1d57995ce92f65377f7349516a29.tar.gz brdo-14b233ec1d4d1d57995ce92f65377f7349516a29.tar.bz2 |
- Patch #368408 by jeffschuler: improve consistency of API and settings on administration pages.
-rw-r--r-- | includes/common.inc | 10 | ||||
-rw-r--r-- | modules/comment/comment.admin.inc | 2 | ||||
-rw-r--r-- | modules/dblog/dblog.admin.inc | 4 | ||||
-rw-r--r-- | modules/node/node.admin.inc | 2 | ||||
-rw-r--r-- | modules/node/node.pages.inc | 4 | ||||
-rw-r--r-- | modules/search/search.pages.inc | 2 | ||||
-rw-r--r-- | modules/simpletest/tests/common.test | 4 | ||||
-rw-r--r-- | modules/statistics/statistics.admin.inc | 4 | ||||
-rw-r--r-- | modules/statistics/statistics.pages.inc | 4 | ||||
-rw-r--r-- | modules/system/system.test | 4 | ||||
-rw-r--r-- | modules/system/system.tokens.inc | 20 |
11 files changed, 30 insertions, 30 deletions
diff --git a/includes/common.inc b/includes/common.inc index 56166cda8..6e79e6673 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1946,14 +1946,14 @@ function format_interval($timestamp, $granularity = 2, $langcode = NULL) { /** * Format a date with the given configured format or a custom format string. * - * Drupal allows administrators to select formatting strings for 'small', - * 'medium' and 'large' date formats. This function can handle these formats, + * Drupal allows administrators to select formatting strings for 'short', + * 'medium' and 'long' date formats. This function can handle these formats, * as well as any custom format. * * @param $timestamp * The exact date to format, as a UNIX timestamp. * @param $type - * The format to use. Can be "small", "medium" or "large" for the preconfigured + * The format to use. Can be "short", "medium" or "long" for the preconfigured * date formats. If "custom" is specified, then $format is required as well. * @param $format * A PHP date format string as required by date(). A backslash should be used @@ -1991,10 +1991,10 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL } switch ($type) { - case 'small': + case 'short': $format = variable_get('date_format_short', 'm/d/Y - H:i'); break; - case 'large': + case 'long': $format = variable_get('date_format_long', 'l, F j, Y - H:i'); break; case 'custom': diff --git a/modules/comment/comment.admin.inc b/modules/comment/comment.admin.inc index dbb8f16c0..fcb1adf7a 100644 --- a/modules/comment/comment.admin.inc +++ b/modules/comment/comment.admin.inc @@ -89,7 +89,7 @@ function comment_admin_overview($type = 'new', $arg) { 'subject' => l($comment->subject, 'comment/' . $comment->cid, array('attributes' => array('title' => truncate_utf8($comment->comment, 128)), 'fragment' => 'comment-' . $comment->cid)), 'author' => theme('username', $comment), 'posted_in' => l($comment->node_title, 'node/' . $comment->nid), - 'time' => format_date($comment->timestamp, 'small'), + 'time' => format_date($comment->timestamp, 'short'), 'operations' => l(t('edit'), 'comment/edit/' . $comment->cid, array('query' => $destination)), ); } diff --git a/modules/dblog/dblog.admin.inc b/modules/dblog/dblog.admin.inc index ed9b79857..1eb27794e 100644 --- a/modules/dblog/dblog.admin.inc +++ b/modules/dblog/dblog.admin.inc @@ -64,7 +64,7 @@ function dblog_overview() { // Cells $icons[$dblog->severity], t($dblog->type), - format_date($dblog->timestamp, 'small'), + format_date($dblog->timestamp, 'short'), l(truncate_utf8(_dblog_format_message($dblog), 56, TRUE, TRUE), 'admin/reports/event/' . $dblog->wid, array('html' => TRUE)), theme('username', $dblog), $dblog->link, @@ -148,7 +148,7 @@ function dblog_event($id) { ), array( array('data' => t('Date'), 'header' => TRUE), - format_date($dblog->timestamp, 'large'), + format_date($dblog->timestamp, 'long'), ), array( array('data' => t('User'), 'header' => TRUE), diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index b6b9a9522..f2826f8aa 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -451,7 +451,7 @@ function node_admin_nodes() { $form['name'][$node->nid] = array('#markup' => check_plain(node_type_get_name($node))); $form['username'][$node->nid] = array('#markup' => theme('username', $node)); $form['status'][$node->nid] = array('#markup' => ($node->status ? t('published') : t('not published'))); - $form['changed'][$node->nid] = array('#markup' => format_date($node->changed, 'small')); + $form['changed'][$node->nid] = array('#markup' => format_date($node->changed, 'short')); if ($multilanguage) { $form['language'][$node->nid] = array('#markup' => empty($node->language) ? t('Language neutral') : t($languages[$node->language]->name)); } diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 46a07c1cd..af5f2ffd5 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -500,13 +500,13 @@ function node_revision_overview($node) { $operations = array(); if ($revision->current_vid > 0) { - $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid"), '!username' => theme('username', $revision))) + $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid"), '!username' => theme('username', $revision))) . (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : ''), 'class' => array('revision-current')); $operations[] = array('data' => theme('placeholder', t('current revision')), 'class' => array('revision-current'), 'colspan' => 2); } else { - $row[] = t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid/revisions/$revision->vid/view"), '!username' => theme('username', $revision))) + $row[] = t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid/revisions/$revision->vid/view"), '!username' => theme('username', $revision))) . (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : ''); if ($revert_permission) { $operations[] = l(t('revert'), "node/$node->nid/revisions/$revision->vid/revert"); diff --git a/modules/search/search.pages.inc b/modules/search/search.pages.inc index da634f590..cdac3350f 100644 --- a/modules/search/search.pages.inc +++ b/modules/search/search.pages.inc @@ -102,7 +102,7 @@ function template_preprocess_search_result(&$variables) { $info['user'] = $result['user']; } if (!empty($result['date'])) { - $info['date'] = format_date($result['date'], 'small'); + $info['date'] = format_date($result['date'], 'short'); } if (isset($result['extra']) && is_array($result['extra'])) { $info = array_merge($info, $result['extra']); diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index f786a42e9..13aad21e0 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -1244,9 +1244,9 @@ class FormatDateUnitTest extends DrupalWebTestCase { $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', 'en'), 'Sunday, 25-Mar-07 17:00:00 PDT', t('Test a different language.')); $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T', 'Europe/London'), 'Monday, 26-Mar-07 01:00:00 BST', t('Test a different time zone.')); $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T'), 'domingo, 25-Mar-07 17:00:00 PDT', t('Test custom date format.')); - $this->assertIdentical(format_date($timestamp, 'large'), 'domingo, 25. marzo 2007 - 17:00', t('Test long date format.')); + $this->assertIdentical(format_date($timestamp, 'long'), 'domingo, 25. marzo 2007 - 17:00', t('Test long date format.')); $this->assertIdentical(format_date($timestamp, 'medium'), '25. marzo 2007 - 17:00', t('Test medium date format.')); - $this->assertIdentical(format_date($timestamp, 'small'), '2007 Mar 25 - 5:00pm', t('Test short date format.')); + $this->assertIdentical(format_date($timestamp, 'short'), '2007 Mar 25 - 5:00pm', t('Test short date format.')); $this->assertIdentical(format_date($timestamp), '25. marzo 2007 - 17:00', t('Test default date format.')); // Restore the original user and language, and enable session saving. diff --git a/modules/statistics/statistics.admin.inc b/modules/statistics/statistics.admin.inc index e33db8135..9139a2567 100644 --- a/modules/statistics/statistics.admin.inc +++ b/modules/statistics/statistics.admin.inc @@ -29,7 +29,7 @@ function statistics_recent_hits() { $rows = array(); foreach ($result as $log) { $rows[] = array( - array('data' => format_date($log->timestamp, 'small'), 'class' => array('nowrap')), + array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')), _statistics_format_item($log->title, $log->path), theme('username', $log), l(t('details'), "admin/reports/access/$log->aid")); @@ -221,7 +221,7 @@ function statistics_access_log($aid) { ); $rows[] = array( array('data' => t('Date'), 'header' => TRUE), - format_date($access->timestamp, 'large') + format_date($access->timestamp, 'long') ); $rows[] = array( array('data' => t('User'), 'header' => TRUE), diff --git a/modules/statistics/statistics.pages.inc b/modules/statistics/statistics.pages.inc index 1dcd3e0fa..5d5e799da 100644 --- a/modules/statistics/statistics.pages.inc +++ b/modules/statistics/statistics.pages.inc @@ -31,7 +31,7 @@ function statistics_node_tracker() { $rows = array(); foreach ($result as $log) { $rows[] = array( - array('data' => format_date($log->timestamp, 'small'), 'class' => array('nowrap')), + array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')), _statistics_link($log->url), theme('username', $log), l(t('details'), "admin/reports/access/$log->aid"), @@ -74,7 +74,7 @@ function statistics_user_tracker() { $rows = array(); foreach ($result as $log) { $rows[] = array( - array('data' => format_date($log->timestamp, 'small'), 'class' => array('nowrap')), + array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')), _statistics_format_item($log->title, $log->path), l(t('details'), "admin/reports/access/$log->aid")); } diff --git a/modules/system/system.test b/modules/system/system.test index 828ab0e85..b5176fd85 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -1218,7 +1218,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { $source .= '[node:created:since]'; // Time since the node was created $source .= '[current-user:name]'; // Current user's name $source .= '[user:name]'; // No user passed in, should be untouched - $source .= '[date:small]'; // Small date format of REQUEST_TIME + $source .= '[date:short]'; // Short date format of REQUEST_TIME $source .= '[bogus:token]'; // Nonexistent token, should be untouched $target = check_plain($node->title); @@ -1226,7 +1226,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { $target .= format_interval(REQUEST_TIME - $node->created, 2); $target .= check_plain($user->name); $target .= '[user:name]'; - $target .= format_date(REQUEST_TIME, 'small'); + $target .= format_date(REQUEST_TIME, 'short'); $target .= '[bogus:token]'; $result = token_replace($source, array('node' => $node)); diff --git a/modules/system/system.tokens.inc b/modules/system/system.tokens.inc index 5ab7a573b..07afe5deb 100644 --- a/modules/system/system.tokens.inc +++ b/modules/system/system.tokens.inc @@ -54,17 +54,17 @@ function system_token_info() { ); // Date related tokens. - $date['small'] = array( - 'name' => t("Small format"), - 'description' => t("A date in 'small' format. (%date)", array('%date' => format_date(REQUEST_TIME, 'small'))), + $date['short'] = array( + 'name' => t("Short format"), + 'description' => t("A date in 'short' format. (%date)", array('%date' => format_date(REQUEST_TIME, 'short'))), ); $date['medium'] = array( 'name' => t("Medium format"), 'description' => t("A date in 'medium' format. (%date)", array('%date' => format_date(REQUEST_TIME, 'medium'))), ); - $date['large'] = array( - 'name' => t("Large format"), - 'description' => t("A date in 'large' format. (%date)", array('%date' => format_date(REQUEST_TIME, 'large'))), + $date['long'] = array( + 'name' => t("Long format"), + 'description' => t("A date in 'long' format. (%date)", array('%date' => format_date(REQUEST_TIME, 'long'))), ); $date['custom'] = array( 'name' => t("Custom format"), @@ -203,16 +203,16 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a $replacements[$original] = filter_xss($date); break; - case 'small': - $replacements[$original] = format_date($date, 'small', '', NULL, $langcode); + case 'short': + $replacements[$original] = format_date($date, 'short', '', NULL, $langcode); break; case 'medium': $replacements[$original] = format_date($date, 'medium', '', NULL, $langcode); break; - case 'large': - $replacements[$original] = format_date($date, 'large', '', NULL, $langcode); + case 'long': + $replacements[$original] = format_date($date, 'long', '', NULL, $langcode); break; case 'since': |