Changeset 5357 for trunk/include/functions.inc.php
- Timestamp:
- Mar 25, 2010, 9:18:28 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r5335 r5357 397 397 * @returns array 398 398 */ 399 function get_languages( $target_charset = null)400 { 401 if ( empty($target_charset) )402 { 403 $target_charset = get_pwg_charset();404 }405 $target_charset = strtolower($target_charset);406 407 $dir = opendir(PHPWG_ROOT_PATH.'language'); 399 function get_languages() 400 { 401 $query = ' 402 SELECT id, name 403 FROM '.LANGUAGES_TABLE.' 404 ORDER BY name ASC 405 ;'; 406 $result = pwg_query($query); 407 408 408 $languages = array(); 409 410 while ($file = readdir($dir)) 411 { 412 $path = PHPWG_ROOT_PATH.'language/'.$file; 413 if (!is_link($path) and is_dir($path) and file_exists($path.'/iso.txt')) 414 { 415 list($language_name) = @file($path.'/iso.txt'); 416 417 $languages[$file] = convert_charset($language_name, $target_charset); 418 } 419 } 420 closedir($dir); 421 @asort($languages); 409 while ($row = pwg_db_fetch_assoc($result)) 410 { 411 if (is_dir(PHPWG_ROOT_PATH.'language/'.$row['id'])) 412 { 413 $languages[ $row['id'] ] = $row['name']; 414 } 415 } 422 416 423 417 return $languages;
Note: See TracChangeset
for help on using the changeset viewer.