From 8043cb998f3325731bfab8d82251fa49639aec1d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 20 Apr 2002 11:52:50 +0000 Subject: - Applied Marco's big patch, including contributions from Moshe: + Changed the db_query() API. + Wrapped all links in l(), lm(), la(), ..., drupal_url() functions. + XHTML-ified some HTML. + Wrapped a lot of text in the administrative pages in a t() function. + Replaced all $REQUEST_URI/$PATH_INFOs by request_uri(). + Small bugfixes (eg. bug in book_export_html() and clean-ups (eg. RSS code). + Fixed some bugs in the taxonomy module (eg. tree making bug), added new functionality (eg. new APIs for use by other modules), included Moshe's taxonomy extensions, and some documentation udpates. + ... --- modules/locale.module | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'modules/locale.module') diff --git a/modules/locale.module b/modules/locale.module index 25c2455f0..0b79a22f6 100644 --- a/modules/locale.module +++ b/modules/locale.module @@ -41,7 +41,7 @@ function locale_perm() { function locale_link($type) { if ($type == "admin" && user_access("administer locales")) { - $links[] = "locales"; + $links[] = la(t("locales"), array("mod" => "locale")); } return $links ? $links : array(); @@ -59,7 +59,7 @@ function locale_delete($lid) { function locale_save($lid) { global $edit; foreach ($edit as $key=>$value) { - db_query("UPDATE locales SET $key = '". check_query($value) ."' WHERE lid = '$lid'"); + db_query("UPDATE locales SET $key = '%s' WHERE lid = '$lid'", $value); } locale_refresh_cache(); // delete form data so it will remember where it came from @@ -70,7 +70,7 @@ function locale_refresh_cache() { global $languages; foreach (array_keys($languages) as $locale) { - $result = db_query("SELECT string, ". check_query($locale) ." FROM locales"); + $result = db_query("SELECT string, %s FROM locales", $locale); while ($data = db_fetch_object($result)) { $t[$data->string] = $data->$locale; } @@ -106,10 +106,10 @@ function locale_links($translation) { foreach ($languages as $key=>$value) { if ($translation) { - $output .= "translated '$key' strings | "; + $output .= la(t("translated '$key' strings"), array("mod" => "locale", "op" => "translated", "language" => $key))." | "; } else { - $output .= "untranslated '$key' strings | "; + $output .= la(t("untranslated '$key' strings"), array("mod" => "locale", "op" => "untranslated", "language" => $key))." | "; } } @@ -191,7 +191,7 @@ function locale_seek() { $output .= "". check_output(locale_languages($locale)) .""; } - $output .= "lid\">edit localelid\">delete locale"; + $output .= "".la(t("edit locale"), array("mod" => "locale", "op" => "edit", "id" => $locale->lid))."".la(t("delete locale"), array("mod" => "locale", "op" => "delete", "id" => $locale->lid)).""; } $output .= "\n"; } @@ -216,7 +216,7 @@ function locale_admin() { print status("locale disabled."); } else if (user_access("administer locales")) { - print "". locale_links(1) . locale_links(0) ."search | overview | help
\n"; + print "". locale_links(1) . locale_links(0) .la(t("search"), array("mod" => "locale", "op" => "Search"))." | ".la(t("overview"), array("mod" => "locale", "op" => "overview"))." | ".la(t("help"), array("mod" => "locale", "op" => "help"))."
\n"; switch ($op) { case "delete": @@ -266,9 +266,9 @@ function locale($string) { $string = check_output($locale_t[$string]); } else { - $result = db_query("SELECT lid, $locale FROM locales WHERE STRCMP(string, '". addslashes($string) ."') = 0"); + $result = db_query("SELECT lid, $locale FROM locales WHERE string = '%s'", $string); if (!db_fetch_object($result)) { - db_query("INSERT INTO locales (string, location) VALUES ('". check_query($string) ."', '". check_query(getenv("REQUEST_URI")) ."')"); + db_query("INSERT INTO locales (string, location) VALUES ('%s', '%s')", $string, getenv("PATH_INFO")); } } } -- cgit v1.2.3