[vhffs-dev] [1922] fixed language change |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1922
Author: gradator
Date: 2012-01-22 02:34:53 +0100 (Sun, 22 Jan 2012)
Log Message:
-----------
fixed language change
Modified Paths:
--------------
trunk/TODO
trunk/vhffs-api/src/Vhffs/Panel/Main.pm
trunk/vhffs-panel/templates/misc/header.tt
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2012-01-22 01:09:23 UTC (rev 1921)
+++ trunk/TODO 2012-01-22 01:34:53 UTC (rev 1922)
@@ -17,6 +17,3 @@
clean description new object (\r)
corriger tableau ACL
-
-changement langue prefs d'un objet d'un projet
-
Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm 2012-01-22 01:09:23 UTC (rev 1921)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm 2012-01-22 01:34:53 UTC (rev 1922)
@@ -266,6 +266,7 @@
# lang cookie
my $lang = $cgi->param('lang');
+ $cgi->delete('lang') if defined $lang;
$self->add_cookie( $cgi->cookie( -name=>'language', -value=>$lang, -expires=>'+10y' ) ) if defined $lang;
$lang = $cgi->cookie('language') unless defined $lang;
$lang = $vhffs->get_config->get_default_language() unless defined $lang;
@@ -278,6 +279,7 @@
# theme cookie
my $theme = $cgi->param('theme');
+ $cgi->delete('theme') if defined $theme;
$self->add_cookie( $cgi->cookie( -name=>'theme', -value=>$theme, -expires=>'+10y' ) ) if defined $theme;
$theme = $cgi->cookie('theme') unless defined $theme;
$theme = $config->get_panel->{'default_theme'} unless defined $theme;
@@ -479,6 +481,7 @@
$vars = {} unless(defined $vars);
$vars->{do} = $cgi->param('do');
+ $vars->{query_string} = $cgi->query_string;
$vars->{theme} = $conf->get_panel->{default_theme} unless defined $vars->{theme};
$vars->{panel_url} = $conf->get_panel->{url};
$vars->{title} = sprintf( gettext( '%s\'s Panel' ), $conf->get_host_name );
Modified: trunk/vhffs-panel/templates/misc/header.tt
===================================================================
--- trunk/vhffs-panel/templates/misc/header.tt 2012-01-22 01:09:23 UTC (rev 1921)
+++ trunk/vhffs-panel/templates/misc/header.tt 2012-01-22 01:34:53 UTC (rev 1922)
@@ -4,9 +4,9 @@
</div>
<!-- Flag navigations -->
<div class="navflag">
- <a href="?do=[% do %]&lang=en_US"><img src="/themes/light-grey/img/en_US.png" alt="en_US"/></a>
- <a href="?do=[% do %]&lang=fr_FR"><img src="/themes/light-grey/img/fr_FR.png" alt="fr_FR"/></a>
- <a href="?do=[% do %]&lang=es_ES"><img src="/themes/light-grey/img/es_ES.png" alt="es_ES"/></a>
+ <a href="?[% query_string %]&lang=en_US"><img src="/themes/light-grey/img/en_US.png" alt="en_US"/></a>
+ <a href="?[% query_string %]&lang=fr_FR"><img src="/themes/light-grey/img/fr_FR.png" alt="fr_FR"/></a>
+ <a href="?[% query_string %]&lang=es_ES"><img src="/themes/light-grey/img/es_ES.png" alt="es_ES"/></a>
</div>
<!-- Navigation Level 1 -->