Changeset 5357
- Timestamp:
- Mar 25, 2010, 9:18:28 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin.php
r5196 r5357 112 112 'U_CONFIG_EXTENTS'=> $link_start.'extend_for_templates', 113 113 'U_CONFIG_MENUBAR'=> $link_start.'menubar', 114 'U_CONFIG_LANGUAGES' => $link_start.'languages_installed', 114 115 'U_CONFIG_THEMES'=> $link_start.'themes_installed', 115 116 'U_CATEGORIES'=> $link_start.'cat_list', -
trunk/admin/include/functions.php
r5196 r5357 1950 1950 case 'themes_new': 1951 1951 case 'themes_installed': 1952 case 'languages_installed': 1952 1953 return 5; 1953 1954 } -
trunk/admin/themes/default/default-layout.css
r5304 r5357 37 37 } 38 38 39 /* Plugins tables */39 /* Plugins, languages tables */ 40 40 TABLE.plugins { min-width: 400px; } 41 41 TABLE.plugins A { border: 0; } … … 43 43 TABLE.plugins TR TD.pluginState { padding: 4px 16px; } 44 44 45 TABLE.plugins TR TD.active { 45 TABLE.plugins TR TD.active, 46 TABLE.languages TR TD.active { 46 47 background: url(icon/plugin_active.gif) no-repeat center left; 47 48 background-color: inherit; /* IE need it */ … … 63 64 64 65 TABLE.plugins ul.pluginsActions li { display: inline; } 66 67 TABLE.languages { min-width: 400px; } 68 TABLE.languages TR TD { text-align: center; padding: 4px 20px; } 65 69 66 70 /* categoryOrdering */ -
trunk/admin/themes/default/template/admin.tpl
r5293 r5357 85 85 <li><a href="{$U_CONFIG_MENUBAR}">{'Menu'|@translate}</a></li> 86 86 <li><a href="{$U_CONFIG_EXTENTS}">{'Templates'|@translate}</a></li> 87 <li><a href="{$U_CONFIG_LANGUAGES}">{'Languages'|@translate}</a></li> 87 88 <li><a href="{$U_CONFIG_THEMES}">{'Themes'|@translate}</a></li> 88 89 </ul> -
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; -
trunk/install.php
r5341 r5357 189 189 include(PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php'); 190 190 191 include(PHPWG_ROOT_PATH . 'admin/include/languages.class.php'); 192 $languages = new languages('utf-8'); 193 191 194 if (isset($_GET['language'])) 192 195 { … … 197 200 $language = 'en_UK'; 198 201 // Try to get browser language 199 foreach ( get_languages('utf-8')as $language_code => $language_name)202 foreach ($languages->fs_languages as $language_code => $language_name) 200 203 { 201 204 if (substr($language_code,0,2) == @substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2)) … … 287 290 $pwg_db_charset = 'latin1'; 288 291 $install_charset_collate = ''; 289 if ( !array_key_exists($language, get_languages($pwg_charset) ) )292 if ( !array_key_exists($language, $languages->get_fs_languages($pwg_charset) ) ) 290 293 { 291 294 $language='en_UK'; … … 376 379 377 380 // fill languages table 378 $inserts = array(); 379 foreach (get_languages('utf-8') as $language_code => $language_name) 380 { 381 $inserts[] = array( 382 'id' => $language_code, 383 'name' => $language_name, 384 ); 385 } 386 mass_inserts(LANGUAGES_TABLE, array('id', 'name'), $inserts); 381 foreach ($languages->get_fs_languages($pwg_charset) as $language_code => $language_name) 382 { 383 $languages->perform_action('activate', $language_code); 384 } 387 385 388 386 // fill $conf global array … … 476 474 $dbengines = available_engines(); 477 475 478 foreach ( get_languages('utf-8')as $language_code => $language_name)476 foreach ($languages->fs_languages as $language_code => $language_name) 479 477 { 480 478 if ($language == $language_code) -
trunk/install/db/90-database.php
r5341 r5357 45 45 46 46 // Fill table 47 $inserts = array(); 48 foreach (get_languages('utf-8') as $language_code => $language_name) 47 include_once(PHPWG_ROOT_PATH.'include/constants.php'); 48 include_once(PHPWG_ROOT_PATH.'admin/include/languages.class.php'); 49 50 $languages = new languages(PWG_CHARSET); 51 52 foreach ($languages->fs_languages as $language_code => $language_name) 49 53 { 50 $inserts[] = array( 51 'id' => $language_code, 52 'name' => $language_name, 53 ); 54 $languages->perform_action('activate', $language_code); 54 55 } 55 mass_inserts(PREFIX_TABLE.'languages', array('id', 'name'), $inserts);56 56 57 57 echo -
trunk/language/en_UK/admin.lang.php
r5328 r5357 750 750 $lang['Activate field "%s"'] = 'Activate field "%s"'; 751 751 $lang['Photo Properties'] = 'Photo Properties'; 752 $lang['Allow user customization'] = 'Allow user customization'; 752 $lang['Allow user customization'] = 'Allow user customization'; 753 $lang['Languages'] = 'Languages'; 753 754 ?> -
trunk/language/fr_FR/admin.lang.php
r5304 r5357 752 752 $lang['Visit Piwigo project website'] = 'Visiter le site web du projet Piwigo'; 753 753 $lang['pLoader stands for <em>Piwigo Uploader</em>. From your computer, pLoader prepares your photos and transfer them to your Piwigo photo gallery.'] = 'pLoader signifie <em>Piwigo Uploader</em>. Depuis votre ordinateur, pLoader prépare vos photos et les transfert vers votre galerie photo Piwigo.'; 754 $lang['Languages'] = 'Langues'; 754 755 ?>
Note: See TracChangeset
for help on using the changeset viewer.