[svn r15825] Hide the language form if there is only one language available on the platform

skala
Yannick Warnier 17 years ago
parent 29bdb85998
commit 14188c0bdd
  1. 4
      index.php
  2. 7
      main/inc/lib/main_api.lib.php

@ -20,7 +20,7 @@
/** /**
* @package dokeos.main * @package dokeos.main
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Refactoring * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Refactoring
* @version $Id: index.php 15748 2008-07-08 21:10:31Z yannoo $ * @version $Id: index.php 15825 2008-07-19 17:24:48Z yannoo $
* @todo check the different @todos in this page and really do them * @todo check the different @todos in this page and really do them
* @todo check if the news management works as expected * @todo check if the news management works as expected
*/ */
@ -385,7 +385,7 @@ function display_anonymous_right_menu()
if ( !($_user['user_id']) or api_is_anonymous($_user['user_id']) ) // only display if the user isn't logged in if ( !($_user['user_id']) or api_is_anonymous($_user['user_id']) ) // only display if the user isn't logged in
{ {
api_display_language_form(); api_display_language_form(true);
echo '<br />'; echo '<br />';
display_login_form(); display_login_form();

@ -1881,13 +1881,18 @@ function api_item_property_update($_course, $tool, $item_id, $lastedit_type, $us
/** /**
* Displays a form (drop down menu) so the user can select his/her preferred language. * Displays a form (drop down menu) so the user can select his/her preferred language.
* The form works with or without javascript * The form works with or without javascript
* @param boolean Hide form if only one language available (defaults to false = show the box anyway)
* @return void Display the box directly
*/ */
function api_display_language_form() function api_display_language_form($hide_if_no_choice=false)
{ {
$platformLanguage = api_get_setting('platformLanguage'); $platformLanguage = api_get_setting('platformLanguage');
$dirname = api_get_path(SYS_PATH)."main/lang/"; // this line is probably no longer needed $dirname = api_get_path(SYS_PATH)."main/lang/"; // this line is probably no longer needed
// retrieve a complete list of all the languages. // retrieve a complete list of all the languages.
$language_list = api_get_languages(); $language_list = api_get_languages();
if (count($language_list['name'])<=1 && $hide_if_no_choice == true) {
return; //don't show any form
}
// the the current language of the user so that his/her language occurs as selected in the dropdown menu // the the current language of the user so that his/her language occurs as selected in the dropdown menu
if(isset($_SESSION['user_language_choice'])) if(isset($_SESSION['user_language_choice']))
{ {

Loading…
Cancel
Save