« auto/share/dist/Nes/cgi-bin/obj/date_time.pl
↑ Summary
auto/share/dist/Nes/cgi-bin/obj/location.pl »
| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | # ----------------------------------------------------------------------------- | ||
| 4 | # | ||
| 5 | # Nes by Skriptke | ||
| 6 | # Copyright 2009 - 2010 Enrique F. Castañón Barbero | ||
| 7 | # Licensed under the GNU GPL. | ||
| 8 | # | ||
| 9 | # CPAN: | ||
| 10 | # http://search.cpan.org/dist/Nes/ | ||
| 11 | # | ||
| 12 | # Sample: | ||
| 13 | # http://nes.sourceforge.net/ | ||
| 14 | # | ||
| 15 | # Repository: | ||
| 16 | # http://github.com/Skriptke/nes | ||
| 17 | # | ||
| 18 | # Version 1.03 | ||
| 19 | # | ||
| 20 | # go_language.pl | ||
| 21 | # | ||
| 22 | # ----------------------------------------------------------------------------- | ||
| 23 | |||
| 24 | use Nes; | ||
| 25 | my $nes = Nes::Singleton->new('./go_language.nhtml'); | ||
| 26 | |||
| 27 | ( my $accept_language, my $none ) = split(/,/, $ENV{'HTTP_ACCEPT_LANGUAGE'}, 2); | ||
| 28 | |||
| 29 | my $count = 1; | ||
| 30 | while ( my $this_param = $nes->{'query'}->{'q'}{'go_language_param_'.$count} ) { | ||
| 31 | my ( $lang, $url ) = split(/\s*:\s*/, $this_param, 2); | ||
| 32 | if ( $accept_language =~ /^$lang/ || !$lang ) { | ||
| 33 | $nes->{'container'}->{'content_obj'}->location( $url ); | ||
| 34 | exit; | ||
| 35 | } | ||
| 36 | $count++; | ||
| 37 | } | ||
| 38 | |||
| 39 | |||
| 40 | 1; | ||
| 41 |