Changeset 2132 for trunk/include/functions_user.inc.php
- Timestamp:
- Oct 10, 2007, 12:43:09 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_user.inc.php
r2127 r2132 930 930 } 931 931 932 /**933 * return the file path of the given language filename, depending on the934 * availability of the file935 *936 * in descending order of preference:937 * param language, user language, default language938 * PhpWebGallery default language.939 *940 * @param string filename941 * @param string dirname942 * @param string language943 * @return string filepath944 */945 function get_language_filepath($filename, $dirname = '', $language = '')946 {947 global $user, $conf;948 949 if (empty($dirname))950 {951 $dirname = PHPWG_ROOT_PATH;952 }953 $dirname .= 'language'.'/';954 955 $dir_methods = array();956 957 if (!empty($language))958 {959 $dir_methods[] = 1;960 }961 962 $dir_methods[] = 2;963 $dir_methods[] = 3;964 $dir_methods[] = 4;965 966 foreach ($dir_methods as $dir_method)967 {968 switch ($dir_method)969 {970 case '1':971 {972 $directory = $dirname.$language;973 break;974 }975 case '2':976 {977 $directory = $dirname.$user['language'];978 break;979 }980 case '3':981 {982 $directory = $dirname.get_default_language();983 break;984 }985 case '4':986 default:987 {988 $directory = $dirname.PHPWG_DEFAULT_LANGUAGE;989 break;990 }991 {992 $directory = '.';993 }994 }995 996 $filepath = $directory.'/'.$filename;997 998 if (file_exists($filepath))999 {1000 return $filepath;1001 }1002 }1003 1004 return false;1005 }1006 932 1007 933 /**
Note: See TracChangeset
for help on using the changeset viewer.