forked from science-ation/science-ation
add default language and language detection
xhtml 1.0 transitional compliance changes
This commit is contained in:
parent
23b938d6fb
commit
0e93f59524
@ -32,6 +32,16 @@ else
|
|||||||
$config['languages'][$r->lang]=$r->langname;
|
$config['languages'][$r->lang]=$r->langname;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//now if no language has been set yet, lets set it to the default language
|
||||||
|
if(!$_SESSION['lang'])
|
||||||
|
{
|
||||||
|
//first try the default language, if that doesnt work, use "en"
|
||||||
|
if($config['default_language'])
|
||||||
|
$_SESSION['lang']=$config['default_language'];
|
||||||
|
else
|
||||||
|
$_SESSION['lang']="en";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//if the user has switched languages, go ahead and switch the session variable
|
//if the user has switched languages, go ahead and switch the session variable
|
||||||
if($_GET['switchlanguage'])
|
if($_GET['switchlanguage'])
|
||||||
@ -46,7 +56,6 @@ if($_GET['switchlanguage'])
|
|||||||
{
|
{
|
||||||
//invalid language, dont do anything
|
//invalid language, dont do anything
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -118,16 +127,18 @@ echo "<h1>".i18n($config['FAIRNAME'])."</h1>";
|
|||||||
<li><a href="config/"><?=i18n("SFIAB Configuration")?></a></li>
|
<li><a href="config/"><?=i18n("SFIAB Configuration")?></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<div class="aligncenter">
|
||||||
|
|
||||||
<?
|
<?
|
||||||
|
|
||||||
if(count($config['languages'])>1)
|
if(count($config['languages'])>1)
|
||||||
{
|
{
|
||||||
echo "<form name=languageselect method=GET action=\"".$_SERVER['PHP_SELF']."\">";
|
echo "<br />";
|
||||||
echo "<select name=switchlanguage onChange=\"document.forms.languageselect.submit()\">\n";
|
echo "<form name=\"languageselect\" method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">";
|
||||||
|
echo "<select name=\"switchlanguage\" onchange=\"document.forms.languageselect.submit()\">\n";
|
||||||
foreach($config['languages'] AS $key=>$val)
|
foreach($config['languages'] AS $key=>$val)
|
||||||
{
|
{
|
||||||
if($_SESSION['lang']==$key) $selected="selected"; else $selected="";
|
if($_SESSION['lang']==$key) $selected="selected=\"selected\""; else $selected="";
|
||||||
|
|
||||||
echo "<option $selected value=\"$key\">$val</option>";
|
echo "<option $selected value=\"$key\">$val</option>";
|
||||||
}
|
}
|
||||||
@ -137,12 +148,8 @@ if(count($config['languages'])>1)
|
|||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<p class="aligncenter">
|
|
||||||
<a href="http://www.sfiab.ca/"><?=i18n("Return to SFIAB Development Page")?></a>
|
<a href="http://www.sfiab.ca/"><?=i18n("Return to SFIAB Development Page")?></a>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user