diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-12-29 17:46:29 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-12-29 17:46:29 +0000 |
commit | c9ca1c6c80edf558effbb9924cfde82d8e141206 (patch) | |
tree | 2755203fa8946eaf0f08785fc02cef660ea6664b /modules | |
parent | df650e54a1b81e36a17c268706b84ac3dcd8696e (diff) | |
download | brdo-c9ca1c6c80edf558effbb9924cfde82d8e141206.tar.gz brdo-c9ca1c6c80edf558effbb9924cfde82d8e141206.tar.bz2 |
- Usability improvement: made the locale module tables use the new table
rendering functions.
- Usability improvement: a couple of strings could not be translated.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/locale.module | 36 | ||||
-rw-r--r-- | modules/locale/locale.module | 36 |
2 files changed, 18 insertions, 54 deletions
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 .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; - $output .= " <tr><th>string</th>"; - - if ($edit["status"] != 2 && strlen($edit["language"]) == 2) { - $output .= "<th>translated string</th>"; - } - else { - $output .= "<th>languages</th>"; - } - - $output .= "<th colspan=\"2\">operations</th></tr>\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 .= " <tr><td>". check_output($locale->string) ."<br /><small><i>". check_output($locale->location) ."</i></small></td>"; - - if ($edit["status"] != 2 && strlen($edit["language"]) == 2) { - $output .= "<td>". check_output($locale->$edit["language"]) ."</td>"; - } - else { - $output .= "<td align=\"center\">". check_output(locale_languages($locale)) ."</td>"; - } - - $output .= "<td nowrap=\"nowrap\">". la(t("edit locale"), array("mod" => "locale", "op" => "edit", "id" => $locale->lid)) ."</td><td nowrap=\"nowrap\">". la(t("delete locale"), array("mod" => "locale", "op" => "delete", "id" => $locale->lid)) ."</td></tr>"; + $rows[] = array("$locale->string<br /><small><i>$locale->location</i></small>", 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 .= "</table>\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 .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; - $output .= " <tr><th>string</th>"; - - if ($edit["status"] != 2 && strlen($edit["language"]) == 2) { - $output .= "<th>translated string</th>"; - } - else { - $output .= "<th>languages</th>"; - } - - $output .= "<th colspan=\"2\">operations</th></tr>\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 .= " <tr><td>". check_output($locale->string) ."<br /><small><i>". check_output($locale->location) ."</i></small></td>"; - - if ($edit["status"] != 2 && strlen($edit["language"]) == 2) { - $output .= "<td>". check_output($locale->$edit["language"]) ."</td>"; - } - else { - $output .= "<td align=\"center\">". check_output(locale_languages($locale)) ."</td>"; - } - - $output .= "<td nowrap=\"nowrap\">". la(t("edit locale"), array("mod" => "locale", "op" => "edit", "id" => $locale->lid)) ."</td><td nowrap=\"nowrap\">". la(t("delete locale"), array("mod" => "locale", "op" => "delete", "id" => $locale->lid)) ."</td></tr>"; + $rows[] = array("$locale->string<br /><small><i>$locale->location</i></small>", 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 .= "</table>\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 |