From c9ca1c6c80edf558effbb9924cfde82d8e141206 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 29 Dec 2002 17:46:29 +0000 Subject: - Usability improvement: made the locale module tables use the new table rendering functions. - Usability improvement: a couple of strings could not be translated. --- modules/locale.module | 36 +++++++++--------------------------- modules/locale/locale.module | 36 +++++++++--------------------------- 2 files changed, 18 insertions(+), 54 deletions(-) (limited to 'modules') diff --git a/modules/locale.module b/modules/locale.module index 15abd50aa..0699879ac 100644 --- a/modules/locale.module +++ b/modules/locale.module @@ -162,31 +162,11 @@ function locale_seek() { $result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : "") ." ORDER BY string"); - $output .= "\n"; - $output .= " "; - - if ($edit["status"] != 2 && strlen($edit["language"]) == 2) { - $output .= ""; - } - else { - $output .= ""; - } - - $output .= "\n"; - + $header = array(t("string"), (($edit["status"] != 2 && strlen($edit["language"]) == 2) ? t("translated string") : t("languages")), array("data" => t("operations"), "colspan" => "2")); while ($locale = db_fetch_object($result)) { - $output .= " "; - - if ($edit["status"] != 2 && strlen($edit["language"]) == 2) { - $output .= ""; - } - else { - $output .= ""; - } - - $output .= ""; + $rows[] = array("$locale->string
$locale->location", array("data" => (($edit["status"] != 2 && strlen($edit["language"]) == 2) ? $locale->$edit["language"] : locale_languages($locale)), "align" => "center"), array("data" => la(t("edit locale"), array("mod" => "locale", "op" => "edit", "id" => $locale->lid)), "nowrap" => "nowrap"), array("data" => la(t("delete locale"), array("mod" => "locale", "op" => "delete", "id" => $locale->lid)), "nowrap" => "nowrap")); } - $output .= "
stringtranslated stringlanguagesoperations
". check_output($locale->string) ."
". check_output($locale->location) ."
". check_output($locale->$edit["language"]) ."". check_output(locale_languages($locale)) ."". la(t("edit locale"), array("mod" => "locale", "op" => "edit", "id" => $locale->lid)) ."". la(t("delete locale"), array("mod" => "locale", "op" => "delete", "id" => $locale->lid)) ."
\n"; + $output .= table($header, $rows); } reset($languages); @@ -246,9 +226,11 @@ function locale_admin() { } function locale_admin_initialize() { - /* This function inserts common strings into the locale table (e.g. names of months and days). - * We use $revision and a stored variable to track if the locale table is up-to-date. - */ + /* + ** 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; @@ -292,4 +274,4 @@ function locale($string) { return $string; } -?> +?> \ No newline at end of file diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 15abd50aa..0699879ac 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -162,31 +162,11 @@ function locale_seek() { $result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : "") ." ORDER BY string"); - $output .= "\n"; - $output .= " "; - - if ($edit["status"] != 2 && strlen($edit["language"]) == 2) { - $output .= ""; - } - else { - $output .= ""; - } - - $output .= "\n"; - + $header = array(t("string"), (($edit["status"] != 2 && strlen($edit["language"]) == 2) ? t("translated string") : t("languages")), array("data" => t("operations"), "colspan" => "2")); while ($locale = db_fetch_object($result)) { - $output .= " "; - - if ($edit["status"] != 2 && strlen($edit["language"]) == 2) { - $output .= ""; - } - else { - $output .= ""; - } - - $output .= ""; + $rows[] = array("$locale->string
$locale->location", array("data" => (($edit["status"] != 2 && strlen($edit["language"]) == 2) ? $locale->$edit["language"] : locale_languages($locale)), "align" => "center"), array("data" => la(t("edit locale"), array("mod" => "locale", "op" => "edit", "id" => $locale->lid)), "nowrap" => "nowrap"), array("data" => la(t("delete locale"), array("mod" => "locale", "op" => "delete", "id" => $locale->lid)), "nowrap" => "nowrap")); } - $output .= "
stringtranslated stringlanguagesoperations
". check_output($locale->string) ."
". check_output($locale->location) ."
". check_output($locale->$edit["language"]) ."". check_output(locale_languages($locale)) ."". la(t("edit locale"), array("mod" => "locale", "op" => "edit", "id" => $locale->lid)) ."". la(t("delete locale"), array("mod" => "locale", "op" => "delete", "id" => $locale->lid)) ."
\n"; + $output .= table($header, $rows); } reset($languages); @@ -246,9 +226,11 @@ function locale_admin() { } function locale_admin_initialize() { - /* This function inserts common strings into the locale table (e.g. names of months and days). - * We use $revision and a stored variable to track if the locale table is up-to-date. - */ + /* + ** 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; @@ -292,4 +274,4 @@ function locale($string) { return $string; } -?> +?> \ No newline at end of file -- cgit v1.2.3