summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0de68d6)
raw | patch | inline | side by side (parent: 0de68d6)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Aug 2007 10:24:26 +0000 (10:24 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Aug 2007 10:24:26 +0000 (10:24 +0000) |
added parameter to strip region tag from language code "de_DE" -> "de"
Implemented this function into gophonequeue in ogroups
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6983 594d385d-05f5-0310-b6e9-bd551577e9d8
Implemented this function into gophonequeue in ogroups
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6983 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions.inc | patch | blob | history | |
plugins/admin/ogroups/class_phonequeue.inc | patch | blob | history |
diff --git a/include/functions.inc b/include/functions.inc
index ab5f5db9d9559d7c97daae9e5727480e6da31204..9b3e05498995ac19d0b2019ca7c796c5b6e1ebfe 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
}
-function get_languages($languages_in_own_language = FALSE)
+function get_languages($languages_in_own_language = FALSE,$strip_region_tag = FALSE)
{
$tmp = array(
"de_DE" => "German",
foreach($tmp as $key => $name){
$lang = $key.".UTF-8";
setlocale(LC_ALL, $lang);
- $ret[$key] = _($name);
+
+ if($strip_region_tag){
+ $ret[preg_replace("/^([^_]*).*$/","\\1",$key)] = _($name);
+ }else{
+ $ret[$key] = _($name);
+ }
}
setlocale(LC_ALL, $old_lang);
}else{
foreach($tmp as $key => $name){
- $ret[$key] = _($name);
+ if($strip_region_tag){
+ $ret[preg_replace("/^([^_]*).*/","\\1",$key)] = _($name);
+ }else{
+ $ret[$key] = _($name);
+ }
}
}
return($ret);
diff --git a/plugins/admin/ogroups/class_phonequeue.inc b/plugins/admin/ogroups/class_phonequeue.inc
index 7e712a4a0ce0814f602b93fe08d9339437069302..569c1268c2dd8fbc0015ad9a3ad6deb6538021c5 100644 (file)
/* Assign samrty variables */
$smarty= get_smarty();
- $smarty->assign("goFonQueueLanguageOptions",array('de'=>_('German')));
+ $smarty->assign("goFonQueueLanguageOptions",get_languages(FALSE,TRUE));
$smarty->assign("goFonQueueStrategyOptions", $this->goFonQueueStrategyOptions);
foreach($this->attributes as $key => $val){