diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-04-18 16:51:16 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-04-18 16:51:16 +0000 |
commit | 65899a8f41b2d096f44c4e545ced8c7014b2ce03 (patch) | |
tree | c304f7f23e61b44eae63a35c5836a317a9081fee /wp-admin/wpmu-options.php | |
parent | ca142aadcb796b92dace1e227d317fb546af3f5c (diff) | |
download | wordpress-mu-65899a8f41b2d096f44c4e545ced8c7014b2ce03.tar.gz wordpress-mu-65899a8f41b2d096f44c4e545ced8c7014b2ce03.tar.xz wordpress-mu-65899a8f41b2d096f44c4e545ced8c7014b2ce03.zip |
Improved language selector, props momo360modena, fixes #529
Various clean ups. Replaced glob() with opendir()
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1249 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/wpmu-options.php')
-rw-r--r-- | wp-admin/wpmu-options.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/wp-admin/wpmu-options.php b/wp-admin/wpmu-options.php index ce539a5..dc72e7e 100644 --- a/wp-admin/wpmu-options.php +++ b/wp-admin/wpmu-options.php @@ -145,21 +145,18 @@ if (isset($_GET['updated'])) { <h3><?php _e('Site Wide Settings <em>(These settings may be overridden by blog owners)</em>') ?></h3> <table class="form-table"> <?php - $lang_files = glob( ABSPATH . LANGDIR . '/*.mo' ); + if( is_dir( ABSPATH . LANGDIR ) && $dh = opendir( ABSPATH . LANGDIR ) ) + while( ( $lang_file = readdir( $dh ) ) !== false ) + if( substr( $lang_file, -3 ) == '.mo' ) + $lang_files[] = $lang_file; $lang = get_site_option('WPLANG'); - if( is_array( $lang_files ) ) { + if( is_array($lang_files) && !empty($lang_files) ) { ?> <tr valign="top"> <th width="33%"><?php _e('Default Language') ?></th> <td> <select name="WPLANG" id="WPLANG"> - <?php - echo '<option value=""'.((empty($lang)) ? ' selected="selected"' : '').'>'.__('English')."</option>"; - foreach ( (array) $lang_files as $key => $val ) { - $code_lang = basename( $val, '.mo' ); - echo '<option value="'.$code_lang.'"'.(($lang == $code_lang) ? ' selected="selected"' : '').'> '.format_code_lang($code_lang).'</option>'; - } - ?> + <?php mu_dropdown_languages( $lang_files, get_site_option('WPLANG') ); ?> </select> </td> </tr> |