diff options
author | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2001-07-25 08:31:53 +0000 |
---|---|---|
committer | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2001-07-25 08:31:53 +0000 |
commit | 1e5afb398e3cdd53c221ff0c94ab6d79ceeaae75 (patch) | |
tree | 77518f494afc74dfe272732e5adc81332ca4671a /modules | |
parent | 6fbd8403df60e3afcf6ca2569c4ba1c7908c52f8 (diff) | |
download | brdo-1e5afb398e3cdd53c221ff0c94ab6d79ceeaae75.tar.gz brdo-1e5afb398e3cdd53c221ff0c94ab6d79ceeaae75.tar.bz2 |
comment.inc
- removed comment_controls().
- modified comment_render() to use $theme->comment_controls().
theme.inc
- added BaseTheme->comment_controls().
locale.module
- can now search for status independant of language.
- string is now a regular expression. For wildcard searches do .*text.*.
- can search in modules + pages, all modules or a specific module.
account.php
- fixed viewing other accounts info would show the active users name in the
real name field.
- now shows users recent contributions and comments (if the user has access to
them).
Diffstat (limited to 'modules')
-rw-r--r-- | modules/locale.module | 36 | ||||
-rw-r--r-- | modules/locale/locale.module | 36 |
2 files changed, 52 insertions, 20 deletions
diff --git a/modules/locale.module b/modules/locale.module index 05d6d4318..4281ecb6b 100644 --- a/modules/locale.module +++ b/modules/locale.module @@ -140,13 +140,29 @@ function locale_untranslated($language) { function locale_search() { global $edit, $languages, $REQUEST_URI; - if (is_array($edit)) { - if ($edit[language] && $edit[status]) $query[] = check_input($edit[language]) . (check_input($edit[status]) == 1 ? " !=" : " =") ." ''"; - if ($edit[module]) $query[] = "location LIKE '%mod=". check_input($edit[module]) ."%'"; - if ($edit[string]) $query[] = "string LIKE '%". check_input($edit[string]) ."%'"; + if ($edit[status]) { + switch ($edit[language]) { + case "all": + foreach ($languages as $key=>$value) { + $tmp[] = $key . (check_input($edit[status]) == 1 ? " !=" : " =") ." ''"; + } + $query[] = implode(" && ", $tmp); + break; + case "any": + foreach ($languages as $key=>$value) { + $tmp[] = $key . (check_input($edit[status]) == 1 ? " !=" : " =") ." ''"; + } + $query[] = "(". implode(" || ", $tmp) .")"; + break; + default: + $query[] = check_input($edit[language]) . (check_input($edit[status]) == 1 ? " !=" : " =") ." ''"; + } + } + if ($edit[module]) $query[] = "location LIKE '%mod=". (check_input($edit[module]) != "all" ? check_input($edit[module]) : "") ."%'"; + if ($edit[string]) $query[] = "string RLIKE '". check_input($edit[string]) ."'"; - $result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". @implode(" && ", $query) : "")); + $result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : "")); $output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n"; $output .= " <TR><TH>string</TH><TH>languages</TH><TH COLSPAN=\"2\">operations</TH></TR>\n"; @@ -154,12 +170,12 @@ function locale_search() { $output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>". check_output($locale->location) ."</I></SMALL></TD><TD ALIGN=\"center\">". check_output(locale_languages($locale)) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->id\">edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->id\">delete locale</A></TD></TR>"; } $output .= "</TABLE>\n"; - } - $form .= form_select("Language", "language", $edit[langauge], array_merge(array(0=>"All"), $languages)); - $form .= form_select("Status", "status", $edit[status], array("All", "Translated", "Untranslated"), "Only used when a language is selected."); - $form .= form_select("Module", "module", $edit[module], array_merge(array(0=>"All"), module_list())); - $form .= form_textfield("String", "string", $edit[string], 30, 30, "Leave blank to show all strings."); + + $form .= form_select("Language", "language", $edit[language], array_merge(array("all" => "All", "any" => "Any"), $languages)); + $form .= form_select("Status", "status", $edit[status], array("All", "Translated", "Untranslated")); + $form .= form_select("Module", "module", $edit[module], array_merge(array("0" => "All modules + pages", "all" => "All modules"), module_list())); + $form .= form_textfield("String", "string", $edit[string], 30, 30, "Leave blank to show all strings. This is treated as a regular expression."); $form .= form_submit("Search"); diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 05d6d4318..4281ecb6b 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -140,13 +140,29 @@ function locale_untranslated($language) { function locale_search() { global $edit, $languages, $REQUEST_URI; - if (is_array($edit)) { - if ($edit[language] && $edit[status]) $query[] = check_input($edit[language]) . (check_input($edit[status]) == 1 ? " !=" : " =") ." ''"; - if ($edit[module]) $query[] = "location LIKE '%mod=". check_input($edit[module]) ."%'"; - if ($edit[string]) $query[] = "string LIKE '%". check_input($edit[string]) ."%'"; + if ($edit[status]) { + switch ($edit[language]) { + case "all": + foreach ($languages as $key=>$value) { + $tmp[] = $key . (check_input($edit[status]) == 1 ? " !=" : " =") ." ''"; + } + $query[] = implode(" && ", $tmp); + break; + case "any": + foreach ($languages as $key=>$value) { + $tmp[] = $key . (check_input($edit[status]) == 1 ? " !=" : " =") ." ''"; + } + $query[] = "(". implode(" || ", $tmp) .")"; + break; + default: + $query[] = check_input($edit[language]) . (check_input($edit[status]) == 1 ? " !=" : " =") ." ''"; + } + } + if ($edit[module]) $query[] = "location LIKE '%mod=". (check_input($edit[module]) != "all" ? check_input($edit[module]) : "") ."%'"; + if ($edit[string]) $query[] = "string RLIKE '". check_input($edit[string]) ."'"; - $result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". @implode(" && ", $query) : "")); + $result = db_query("SELECT * FROM locales". (count($query) ? " WHERE ". implode(" && ", $query) : "")); $output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n"; $output .= " <TR><TH>string</TH><TH>languages</TH><TH COLSPAN=\"2\">operations</TH></TR>\n"; @@ -154,12 +170,12 @@ function locale_search() { $output .= " <TR><TD>". check_output($locale->string) ."<BR><SMALL><I>". check_output($locale->location) ."</I></SMALL></TD><TD ALIGN=\"center\">". check_output(locale_languages($locale)) ."</TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=edit&id=$locale->id\">edit locale</A></TD><TD NOWRAP><A HREF=\"admin.php?mod=locale&op=delete&id=$locale->id\">delete locale</A></TD></TR>"; } $output .= "</TABLE>\n"; - } - $form .= form_select("Language", "language", $edit[langauge], array_merge(array(0=>"All"), $languages)); - $form .= form_select("Status", "status", $edit[status], array("All", "Translated", "Untranslated"), "Only used when a language is selected."); - $form .= form_select("Module", "module", $edit[module], array_merge(array(0=>"All"), module_list())); - $form .= form_textfield("String", "string", $edit[string], 30, 30, "Leave blank to show all strings."); + + $form .= form_select("Language", "language", $edit[language], array_merge(array("all" => "All", "any" => "Any"), $languages)); + $form .= form_select("Status", "status", $edit[status], array("All", "Translated", "Untranslated")); + $form .= form_select("Module", "module", $edit[module], array_merge(array("0" => "All modules + pages", "all" => "All modules"), module_list())); + $form .= form_textfield("String", "string", $edit[string], 30, 30, "Leave blank to show all strings. This is treated as a regular expression."); $form .= form_submit("Search"); |