tementa Posted January 27, 2009 Share Posted January 27, 2009 Hi, How I can to display $languagebox in a drop-down menu? The file that makes the $languagebox display is includes/boxes/languages.php I tried this but I get no the right result <!-- languages //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_LANGUAGES); new infoBoxHeading($info_box_contents, false, false); if (!isset($lng) || (isset($lng) && !is_object($lng))) { include(DIR_WS_CLASSES . 'language.php'); $lng = new language; } $languages_string = ''; reset($lng->catalog_languages); while (list($key, $value) = each($lng->catalog_languages)) { $languages_string .= '<option><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a></option>'; } $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => $languages_string); new infoBox($info_box_contents); ?> </td> </tr> <!-- languages_eof //--> Please help Thanks in advance Quote Link to comment Share on other sites More sharing options...
tementa Posted January 27, 2009 Author Share Posted January 27, 2009 I get this now <!-- languages //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_LANGUAGES); new infoBoxHeading($info_box_contents, false, false); if (!isset($lng) || (isset($lng) && !is_object($lng))) { include(DIR_WS_CLASSES . 'language.php'); $lng = new language; } $languages_string = ''; reset($lng->catalog_languages); $languages_array = array(); while (list($key, $value) = each($lng->catalog_languages)) { $languages_array[] = array ('<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a>'); } $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => tep_draw_pull_down_menu('languages', $languages_string) . $hidden_get_variables . tep_hide_session_id()); new infoBox($info_box_contents); ?> </td> </tr> <!-- languages_eof //--> An the error that displays is this: Fatal error: Cannot use string offset as an array in C:\wamp\www\tienda\includes\functions\html_output.php on line 306 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.