Gossamer Forum
Home : Products : Links 2.0 : Customization :

Re: [Andy] Problem with the nonenglish mod (bug?)

Quote Reply
Re: [Andy] Problem with the nonenglish mod (bug?) In reply to
Yo Andy,

Do you mean the dropdown? The nonenglish mod is here: http://www.gossamer-threads.com/...rsion_2_x/index.html, the second one down. The code for the dropdown is like so:

From site_html_templates.pl:


sub site_html_add_form {
# --------------------------------------------------------
# This routine determines how the add form page will look like.
#
&html_print_headers;

my $category = shift;
# ***************************************** nonenglish modification - begin ****************
# $category ?
# ($category = qq~$category <input type=hidden name="Category" value="$category">~) :
# ($category = &build_select_field ("Category", "$in{'Category'}"));
my ($kategorie) = &kategorie_title_mb ($category);
$category ?
($category = qq~$kategorie <input type=hidden name="Category" value="$category">~) :
($category = &build_select_field ("Category", "$in{'Category'}"));
# ***************************************** nonenglish modification - end ******************

print &load_template ('add.html', {
Category => $category,
%globals
});
}

And from db_utils.pl

sub build_select_field {
# --------------------------------------------------------
# Builds a SELECT field based on information found
# in the database definition.
#
my ($column, $value, $name, $mult) = @_;
my ($size, %values);

$name || ($name = $column);
$size || ($size = 1);

if (! exists $db_select_fields{$column}) {
$db_select_fields{$db_cols[$db_category]} = $db_select_fields{'Mult-Related'} = join (",", &category_list);
}
if ($mult) {
@fields = split (/\,/, $db_select_fields{"Mult-$column"});
%values = map { $_ => 1 } split (/\Q$db_delim\E/, $value);
}
else {
@fields = split (/\,/, $db_select_fields{$column});
$values{$value}++;
}
($#fields >= 0) or return "error building select field: no select fields specified in config for field '$column'!";

$output = qq|<SELECT NAME="$name" $mult SIZE=$size><OPTION>---|;

## next changed LT for nonenglish mod **********

foreach $field (@fields) {
$kategory{$field} = &kategorie_title_mb1($field);

$values{$field} ?

($output .= "<OPTION SELECTED VALUE=\"$field\">$kategory{$field}\n") :
($output .= "<OPTION VALUE=\"$field\">$kategory{$field}");
}
## end LT nonenglish*****************

$output .= "</SELECT>";
return $output;
}

The dropdowns now show like so-- category : sub and category, but in the nonenglish they are entered as category : sub & category


Leonard
aka PerlFlunkie
Subject Author Views Date
Thread Problem with the nonenglish mod (bug?) C. 3817 Sep 1, 2003, 5:06 AM
Thread Re: [C.] Problem with the nonenglish mod (bug?)
PerlFlunkie 3803 Sep 1, 2003, 12:26 PM
Thread Re: [PerlFlunkie] Problem with the nonenglish mod (bug?)
Andy 3772 Sep 1, 2003, 1:41 PM
Thread Re: [Andy] Problem with the nonenglish mod (bug?)
PerlFlunkie 3758 Sep 1, 2003, 2:10 PM
Thread Re: [PerlFlunkie] Problem with the nonenglish mod (bug?)
Andy 3772 Sep 1, 2003, 2:30 PM
Thread Re: [Andy] Problem with the nonenglish mod (bug?)
PerlFlunkie 3740 Sep 1, 2003, 8:02 PM
Thread Re: [PerlFlunkie] Problem with the nonenglish mod (bug?)
C. 3740 Sep 3, 2003, 10:05 AM
Thread Re: [C.] Problem with the nonenglish mod (bug?)
PerlFlunkie 3723 Sep 3, 2003, 10:44 AM
Thread Re: [PerlFlunkie] Problem with the nonenglish mod (bug?)
C. 3689 Sep 4, 2003, 5:19 PM
Post Re: [C.] Problem with the nonenglish mod (bug?)
PerlFlunkie 3677 Sep 4, 2003, 7:53 PM
Post Re: [PerlFlunkie] Problem with the nonenglish mod (bug?)
C. 3761 Sep 1, 2003, 5:25 PM