summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/archive.module8
-rw-r--r--modules/archive/archive.module8
-rw-r--r--modules/locale.module26
-rw-r--r--modules/locale/locale.module26
4 files changed, 10 insertions, 58 deletions
diff --git a/modules/archive.module b/modules/archive.module
index 5bdc1b34d..175534d9f 100644
--- a/modules/archive.module
+++ b/modules/archive.module
@@ -83,10 +83,10 @@ function archive_calendar($original = 0) {
$output .= "\n<!-- calendar -->\n";
$output .= "<div class=\"calendar\">";
$output .= "<table>\n";
- $output .= " <tr><td colspan=\"7\" class=\"header-month\">". l("&laquo;", "archive/". date("Y/m/d", $prev)) ." ". t(date("F", $requested)) . date(" Y", $requested) ." ". ($nextmonth <= time() ? l("&raquo;", "archive/". date("Y/m/d", $next)) : "&nbsp;") ."</td></tr>\n";
+ $output .= " <tr><td colspan=\"7\" class=\"header-month\">". l("&laquo;", "archive/". date("Y/m/d", $prev)) ." ". format_date($requested, "custom", "F") . date(" Y", $requested) ." ". ($nextmonth <= time() ? l("&raquo;", "archive/". date("Y/m/d", $next)) : "&nbsp;") ."</td></tr>\n";
// First day of week (0 => Sunday, 1 => Monday, ...)
- $weekstart = variable_get("default_firstday", 0);
+ $cday = $weekstart = variable_get("default_firstday", 0);
// Last day of week
($weekstart - 1 == -1) ? $lastday = 6 : $lastday = $weekstart - 1;
@@ -95,8 +95,10 @@ function archive_calendar($original = 0) {
$firstcolumn = mktime(0, 0, 0, 3, 20 + $weekstart, 1994);
$output .= " <tr class=\"header-week\">";
+ $days = array(t('Su'), t('Mo'), t('Tu'), t('We'), t('Th'), t('Fr'), t('Sa'));
for ($i = 0; $i < 7; $i++) {
- $output .= "<td>". t(substr(ucfirst(date("l", $firstcolumn + $i * 86400)), 0, 2)) ."</td>";
+ $output .= "<td>". $days[$cday] . "</td>";
+ $cday = ($cday < 6 : $cday+1 : 0);
}
$output .= "</tr>\n";
diff --git a/modules/archive/archive.module b/modules/archive/archive.module
index 5bdc1b34d..175534d9f 100644
--- a/modules/archive/archive.module
+++ b/modules/archive/archive.module
@@ -83,10 +83,10 @@ function archive_calendar($original = 0) {
$output .= "\n<!-- calendar -->\n";
$output .= "<div class=\"calendar\">";
$output .= "<table>\n";
- $output .= " <tr><td colspan=\"7\" class=\"header-month\">". l("&laquo;", "archive/". date("Y/m/d", $prev)) ." ". t(date("F", $requested)) . date(" Y", $requested) ." ". ($nextmonth <= time() ? l("&raquo;", "archive/". date("Y/m/d", $next)) : "&nbsp;") ."</td></tr>\n";
+ $output .= " <tr><td colspan=\"7\" class=\"header-month\">". l("&laquo;", "archive/". date("Y/m/d", $prev)) ." ". format_date($requested, "custom", "F") . date(" Y", $requested) ." ". ($nextmonth <= time() ? l("&raquo;", "archive/". date("Y/m/d", $next)) : "&nbsp;") ."</td></tr>\n";
// First day of week (0 => Sunday, 1 => Monday, ...)
- $weekstart = variable_get("default_firstday", 0);
+ $cday = $weekstart = variable_get("default_firstday", 0);
// Last day of week
($weekstart - 1 == -1) ? $lastday = 6 : $lastday = $weekstart - 1;
@@ -95,8 +95,10 @@ function archive_calendar($original = 0) {
$firstcolumn = mktime(0, 0, 0, 3, 20 + $weekstart, 1994);
$output .= " <tr class=\"header-week\">";
+ $days = array(t('Su'), t('Mo'), t('Tu'), t('We'), t('Th'), t('Fr'), t('Sa'));
for ($i = 0; $i < 7; $i++) {
- $output .= "<td>". t(substr(ucfirst(date("l", $firstcolumn + $i * 86400)), 0, 2)) ."</td>";
+ $output .= "<td>". $days[$cday] . "</td>";
+ $cday = ($cday < 6 : $cday+1 : 0);
}
$output .= "</tr>\n";
diff --git a/modules/locale.module b/modules/locale.module
index e5fa717e3..599fd7e2a 100644
--- a/modules/locale.module
+++ b/modules/locale.module
@@ -257,7 +257,6 @@ function locale_admin() {
$edit =& $_POST["edit"];
if (user_access('administer locales')) {
- locale_admin_initialize();
if (empty($op)) {
$op = arg(2);
@@ -305,31 +304,6 @@ function locale_admin() {
}
}
-function locale_admin_initialize() {
- /*
- ** This function inserts common strings into the locale table (eg.
- ** names of months and days). We use $revision and a stored variable
- ** to track if the locale table is up-to-date.
- */
-
- $revision = 1;
-
- if (variable_get("locale_initialize_revision", 0) < $revision) {
- variable_set("locale_initialize_revision", $revision);
- for ($i = 1; $i <= 12; $i++) {
- $stamp = mktime(0, 0, 0, $i, 1, 1971);
- t(date("F", $stamp));
- t(date("M", $stamp));
- }
-
- for ($i = 0; $i <= 7; $i++) {
- $stamp = $i * 86400;
- t(date("D", $stamp));
- t(date("l", $stamp));
- }
- }
-}
-
function locale($string) {
global $locale;
static $locale_t;
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index e5fa717e3..599fd7e2a 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -257,7 +257,6 @@ function locale_admin() {
$edit =& $_POST["edit"];
if (user_access('administer locales')) {
- locale_admin_initialize();
if (empty($op)) {
$op = arg(2);
@@ -305,31 +304,6 @@ function locale_admin() {
}
}
-function locale_admin_initialize() {
- /*
- ** This function inserts common strings into the locale table (eg.
- ** names of months and days). We use $revision and a stored variable
- ** to track if the locale table is up-to-date.
- */
-
- $revision = 1;
-
- if (variable_get("locale_initialize_revision", 0) < $revision) {
- variable_set("locale_initialize_revision", $revision);
- for ($i = 1; $i <= 12; $i++) {
- $stamp = mktime(0, 0, 0, $i, 1, 1971);
- t(date("F", $stamp));
- t(date("M", $stamp));
- }
-
- for ($i = 0; $i <= 7; $i++) {
- $stamp = $i * 86400;
- t(date("D", $stamp));
- t(date("l", $stamp));
- }
- }
-}
-
function locale($string) {
global $locale;
static $locale_t;