Commit 54774aa8 authored by Dries's avatar Dries
Browse files

- Removed the module field from the locale search form.  It won't work and
  there is no easy replacement.

- Wrapped the strings in htmlentities() such that one can see the HTML.
parent 1839f42c
......@@ -102,8 +102,13 @@ function locale_edit($lid) {
$result = db_query("SELECT * FROM locales WHERE lid = '$lid'");
if ($translation = db_fetch_object($result)) {
$form .= form_item(t("Original text"), "<pre>". wordwrap($translation->string) ."</pre>");
foreach ($languages as $code=>$language) $form .= (strlen($translation->string) > 30) ? form_textarea($language, $code, $translation->$code, 50, 10) : form_textfield($language, $code, $translation->$code, 50, 128);
$form .= form_item(t("Original text"), wordwrap(htmlentities($translation->string)));
foreach ($languages as $code=>$language) {
$form .= (strlen($translation->string) > 30) ? form_textarea($language, $code, $translation->$code, 50, 10) : form_textfield($language, $code, $translation->$code, 50, 128);
}
$form .= form_submit(t("Save translations"));
return form($form);
......@@ -154,10 +159,6 @@ function locale_seek() {
}
}
if ($edit["module"]) {
$query[] = "location LIKE '%mod=". (check_query($edit["module"]) != "all" ? check_query($edit["module"]) : "") ."%'";
}
if ($edit["string"]) {
$string_query[] = "string LIKE '%". check_query($edit["string"]) ."%'";
if ($edit["status"] != 2) {
......@@ -184,10 +185,9 @@ function locale_seek() {
reset($languages);
$form .= form_textfield(t("String"), "string", $edit["string"], 30, 30, t("Leave blank to show all strings. This is treated as a regular expression."));
$form .= form_textfield(t("Strings to search for"), "string", $edit["string"], 30, 30, t("Leave blank to show all strings."));
$form .= form_select(t("Language"), "language", ($edit["language"] ? $edit["language"] : key($languages)), array_merge(array("any" => t("Any language"), "all" => t("All languages")), $languages), t("In which language must the string be translated/untranslated (see status)?"));
$form .= form_select(t("Status"), "status", $edit["status"], array(2 => t("Untranslated"), 1 => t("Translated"), 0 => t("All")));
$form .= form_select(t("Module"), "module", $edit["module"], array_merge(array("0" => t("All modules + pages"), "all" => t("All modules")), module_list()));
$form .= form_submit(t("Search"));
$output .= form($form);
......
......@@ -102,8 +102,13 @@ function locale_edit($lid) {
$result = db_query("SELECT * FROM locales WHERE lid = '$lid'");
if ($translation = db_fetch_object($result)) {
$form .= form_item(t("Original text"), "<pre>". wordwrap($translation->string) ."</pre>");
foreach ($languages as $code=>$language) $form .= (strlen($translation->string) > 30) ? form_textarea($language, $code, $translation->$code, 50, 10) : form_textfield($language, $code, $translation->$code, 50, 128);
$form .= form_item(t("Original text"), wordwrap(htmlentities($translation->string)));
foreach ($languages as $code=>$language) {
$form .= (strlen($translation->string) > 30) ? form_textarea($language, $code, $translation->$code, 50, 10) : form_textfield($language, $code, $translation->$code, 50, 128);
}
$form .= form_submit(t("Save translations"));
return form($form);
......@@ -154,10 +159,6 @@ function locale_seek() {
}
}
if ($edit["module"]) {
$query[] = "location LIKE '%mod=". (check_query($edit["module"]) != "all" ? check_query($edit["module"]) : "") ."%'";
}
if ($edit["string"]) {
$string_query[] = "string LIKE '%". check_query($edit["string"]) ."%'";
if ($edit["status"] != 2) {
......@@ -184,10 +185,9 @@ function locale_seek() {
reset($languages);
$form .= form_textfield(t("String"), "string", $edit["string"], 30, 30, t("Leave blank to show all strings. This is treated as a regular expression."));
$form .= form_textfield(t("Strings to search for"), "string", $edit["string"], 30, 30, t("Leave blank to show all strings."));
$form .= form_select(t("Language"), "language", ($edit["language"] ? $edit["language"] : key($languages)), array_merge(array("any" => t("Any language"), "all" => t("All languages")), $languages), t("In which language must the string be translated/untranslated (see status)?"));
$form .= form_select(t("Status"), "status", $edit["status"], array(2 => t("Untranslated"), 1 => t("Translated"), 0 => t("All")));
$form .= form_select(t("Module"), "module", $edit["module"], array_merge(array("0" => t("All modules + pages"), "all" => t("All modules")), module_list()));
$form .= form_submit(t("Search"));
$output .= form($form);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment