Share

phpESP - php Easy Survey Package

Tracker: Bugs

5 language dropdown shown at login - ID: 2898674
Last Update: Comment added ( liedekef )

When including phpESP using /public/handler.php you can specify the
language of your survey by supplying the language in a $lang variable. If
you specify this variable, the login screen should not show the language
chooser dropdown, unfortunately this does not work.

Reason is the fact that the language variable is not available within the
function show_login() that is part of admin/include/lib/esphtml.forms.inc

Solution is to change the variable $lang into $_SESSION['language'] on line
194:

# if the variable $lang is set, we assume we don't need to ask for the
language
if ((!isset($_REQUEST['lang']) && !isset($lang)) || empty($lang)) {

fixed:

# if the variable $lang is set, we assume we don't need to ask for the
language
if ((!isset($_REQUEST['lang']) && !$_SESSION['language']) ||
empty($_SESSION['language'])) {



Arjen


Arjen van Bochoven ( bochoven ) - 2009-11-16 20:47

5

Closed

Fixed

Nobody/Anonymous

None

None

Public


Comments ( 5 )

Date: 2009-11-18 21:50
Sender: liedekefProject Admin

Well, I was right about the localization, but indeed the $lang needs to be
replaced with $_SESSION['language'], fixed in svn


Date: 2009-11-18 21:43
Sender: liedekefProject Admin

The login box *is* localized, but I suspect the same reason counts as in
bugreport 2897990: you need to include phpESP.first.php before any other
html output.
The words "Username:" and "Password:" weren't localized though, I fixed
that in SVN

Franky


Date: 2009-11-17 20:24
Sender: bochoven

I would really like a way to loose the dropdown, so the respondents don't
get confused. I assumed from the comment that supplying the $lang variable
was the proper way to do just that.

Eventually I think a MVC approach would be better (separating presentation
logic from business logic) so anyone could switch in their own templates,
but that would require a large rewrite.

As a minor point I noticed that the login box is not localized, maybe a
todo item?

cheers

Arjen


Date: 2009-11-17 20:00
Sender: bishopbProject Admin

Might we want the drop-down to remain, even though the value is preset?
Argument from usability: that gives the user the option to choosing the
language that is appropriate for them.

Of course, we don't handle multi-language survey questions anyway, so this
usability argument may be specious. Or maybe this should be handled at
configuration time (either static in the .ini files or in the survey
itself)?


Date: 2009-11-16 20:52
Sender: liedekefProject Admin

will take a look at it asap :-)
Tx for the work already!

Franky


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2009-11-18 21:50 liedekef
resolution_id None 2009-11-18 21:50 liedekef
allow_comments 1 2009-11-18 21:50 liedekef
close_date - 2009-11-18 21:50 liedekef