Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

pulldown for languages - How put actual language as selected?


poschiman

Recommended Posts

hello,

i want to create a pulldown for languages like this:

 

$languages_string = '';

reset($lng->catalog_languages);

 

$lng_array = array();

while (list($key, $value) = each($lng->catalog_languages)) {

$lng_array[] = array('id' => $key, 'text' => $value['name']);

}

 

$hidden_get_variables = '';

reset($HTTP_GET_VARS);

while (list($key, $value) = each($HTTP_GET_VARS)) {

if ( ($key != 'language') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {

$hidden_get_variables .= tep_draw_hidden_field($key, $value);

}

}

$lang =$HTTP_GET_VARS['language'];

$info_box_contents = array();

$info_box_contents[] = array('form' => tep_draw_form('languages', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),

'align' => 'center',

'text' => tep_draw_pull_down_menu('language', $lng_array, $lng, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());

 

 

it pretty much works, but i cannot find out, what to do, that the actual language is the selected one.

 

anybody a hint???

 

 

thanks in advance.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...