Index: trunk/kernel/include/globals.php
===================================================================
diff -u -N -r8413 -r8436
--- trunk/kernel/include/globals.php (.../globals.php) (revision 8413)
+++ trunk/kernel/include/globals.php (.../globals.php) (revision 8436)
@@ -867,50 +867,20 @@
}
}
-function language($phrase,$LangId=0)
+function language($phrase, $LangId = 0)
{
- global $objSession, $objLanguageCache, $objLanguages;
-
- if ($LangId == 0) {
- $LangId = $objSession->Get('Language');
- }
-
- if ($LangId == 0) {
- $LangId = $objLanguages->GetPrimary();
- }
-
- return $objLanguageCache->GetTranslation($phrase,$LangId);
+ $application =& kApplication::Instance();
+ return $application->Phrase($phrase);
}
-function admin_language($phrase,$lang=0,$LinkMissing=FALSE)
+function admin_language($phrase, $lang = 0, $LinkMissing = false)
{
- global $objSession, $objLanguageCache, $objLanguages;
-
- //echo "Language passed: $lang
";
-
- if($lang==0)
- $lang = $objSession->Get("Language");
-
- //echo "Language from session: $lang
";
-
- if($lang==0)
- $lang = $objLanguages->GetPrimary();
-
- //echo "Language after primary: $lang
";
- //echo "Phrase: $phrase
";
- $translation = $objLanguageCache->GetTranslation($phrase,$lang);
- if($LinkMissing && substr($translation,0,1)=="!" && substr($translation,-1)=="!")
- {
- $res = "$translation";
- return $res;
- }
- else
- return $translation;
+ return language($phrase, $lang);
}
-function prompt_language($phrase,$lang=0)
+function prompt_language($phrase, $lang = 0)
{
- return admin_language($phrase,$lang,TRUE);
+ return language($phrase, $lang);
}
function GetPrimaryTranslation($Phrase)
@@ -1626,7 +1596,7 @@
}
foreach($main as $vl_key => $vl_value) {
- // we need to skip wid here, otherwise empty wid will become 0 and the window name for javascript will be changed (to main_0),
+ // we need to skip wid here, otherwise empty wid will become 0 and the window name for javascript will be changed (to main_0),
// making all links to original (main) window open in new window
if ($vl_key == 'wid') continue;
if(!$vl_value) $main[$vl_key] = '0'; // unset($main[$vl_key]);