~canonical-sysadmins/wordpress/4.1.3

« back to all changes in this revision

Viewing changes to wp-admin/network/settings.php

  • Committer: Nick Moffitt
  • Date: 2015-01-15 11:05:37 UTC
  • mfrom: (1.1.1 wp4-upstream)
  • Revision ID: nick.moffitt@canonical.com-20150115110537-8bp1y42eyg0jsa7c
Tags: 4.1
MergeĀ upstreamĀ versionĀ 4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
/** Load WordPress Administration Bootstrap */
11
11
require_once( dirname( __FILE__ ) . '/admin.php' );
12
12
 
 
13
/** WordPress Translation Install API */
 
14
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
 
15
 
13
16
if ( ! is_multisite() )
14
17
        wp_die( __( 'Multisite support is not enabled.' ) );
15
18
 
19
22
$title = __( 'Network Settings' );
20
23
$parent_file = 'settings.php';
21
24
 
 
25
/**
 
26
 * Print JavaScript in the header on the Network Settings screen.
 
27
 *
 
28
 * @since 4.1.0
 
29
*/
 
30
function network_settings_add_js() {
 
31
?>
 
32
<script type="text/javascript">
 
33
jQuery(document).ready( function($) {
 
34
        var languageSelect = $( '#WPLANG' );
 
35
        $( 'form' ).submit( function() {
 
36
                // Don't show a spinner for English and installed languages,
 
37
                // as there is nothing to download.
 
38
                if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
 
39
                        $( '#submit', this ).after( '<span class="spinner language-install-spinner" />' );
 
40
                }
 
41
        });
 
42
});
 
43
</script>
 
44
<?php
 
45
}
 
46
add_action( 'admin_head', 'network_settings_add_js' );
 
47
 
22
48
get_current_screen()->add_help_tab( array(
23
49
                'id'      => 'overview',
24
50
                'title'   => __('Overview'),
28
54
                        '<p>' . __('Registration settings can disable/enable public signups. If you let others sign up for a site, install spam plugins. Spaces, not commas, should separate names banned as sites for this network.') . '</p>' .
29
55
                        '<p>' . __('New site settings are defaults applied when a new site is created in the network. These include welcome email for when a new site or user account is registered, and what&#8127;s put in the first post, page, comment, comment author, and comment URL.') . '</p>' .
30
56
                        '<p>' . __('Upload settings control the size of the uploaded files and the amount of available upload space for each site. You can change the default value for specific sites when you edit a particular site. Allowed file types are also listed (space separated only).') . '</p>' .
 
57
                        '<p>' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '</p>' .
31
58
                        '<p>' . __('Menu setting enables/disables the plugin menus from appearing for non super admins, so that only super admins, not site admins, have access to activate plugins.') . '</p>' .
32
59
                        '<p>' . __('Super admins can no longer be added on the Options screen. You must now go to the list of existing users on Network Admin > Users and click on Username or the Edit action link below that name. This goes to an Edit User page where you can check a box to grant super admin privileges.') . '</p>'
33
60
) );
58
85
                'illegal_names', 'limited_email_domains', 'banned_email_domains', 'WPLANG', 'admin_email',
59
86
        );
60
87
 
 
88
        // Handle translation install.
 
89
        if ( ! empty( $_POST['WPLANG'] ) && wp_can_install_language_pack() ) {  // @todo: Skip if already installed
 
90
                $language = wp_download_language_pack( $_POST['WPLANG'] );
 
91
                if ( $language ) {
 
92
                        $_POST['WPLANG'] = $language;
 
93
                }
 
94
        }
 
95
 
61
96
        foreach ( $options as $option_name ) {
62
97
                if ( ! isset($_POST[$option_name]) )
63
98
                        continue;
264
299
 
265
300
                        <tr>
266
301
                                <th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
267
 
                                <td><input name="upload_filetypes" type="text" id="upload_filetypes" class="large-text" value="<?php echo esc_attr( get_site_option('upload_filetypes', 'jpg jpeg png gif') ) ?>" size="45" /></td>
 
302
                                <td><input name="upload_filetypes" type="text" id="upload_filetypes" class="large-text" value="<?php echo esc_attr( get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ) ?>" size="45" /></td>
268
303
                        </tr>
269
304
 
270
305
                        <tr>
275
310
 
276
311
                <?php
277
312
                $languages = get_available_languages();
278
 
                if ( ! empty( $languages ) ) {
 
313
                $translations = wp_get_available_translations();
 
314
                if ( ! empty( $languages ) || ! empty( $translations ) ) {
279
315
                        ?>
280
316
                        <h3><?php _e( 'Language Settings' ); ?></h3>
281
317
                        <table class="form-table">
289
325
                                                }
290
326
 
291
327
                                                wp_dropdown_languages( array(
292
 
                                                        'name'      => 'WPLANG',
293
 
                                                        'id'        => 'WPLANG',
294
 
                                                        'selected'  => $lang,
295
 
                                                        'languages' => $languages,
 
328
                                                        'name'         => 'WPLANG',
 
329
                                                        'id'           => 'WPLANG',
 
330
                                                        'selected'     => $lang,
 
331
                                                        'languages'    => $languages,
 
332
                                                        'translations' => $translations,
 
333
                                                        'show_available_translations' => wp_can_install_language_pack(),
296
334
                                                ) );
297
335
                                                ?>
298
336
                                        </td>