X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8f374b7233bc2815ccc387e448d208c5434eb961..53f4633144ed68c8b8fb5861f992b5489894a940:/wp-admin/network/themes.php diff --git a/wp-admin/network/themes.php b/wp-admin/network/themes.php index ba56a4a4..2b9132f1 100644 --- a/wp-admin/network/themes.php +++ b/wp-admin/network/themes.php @@ -8,16 +8,11 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( './admin.php' ); +require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! is_multisite() ) wp_die( __( 'Multisite support is not enabled.' ) ); -$menu_perms = get_site_option( 'menu_items', array() ); - -if ( empty( $menu_perms['themes'] ) && ! is_super_admin() ) - wp_die( __( 'Cheatin’ uh?' ) ); - if ( !current_user_can('manage_network_themes') ) wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) ); @@ -45,14 +40,12 @@ if ( $action ) { else wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) ); exit; - break; case 'disable': check_admin_referer('disable-theme_' . $_GET['theme']); unset( $allowed_themes[ $_GET['theme'] ] ); update_site_option( 'allowedthemes', $allowed_themes ); wp_safe_redirect( add_query_arg( 'disabled', '1', $referer ) ); exit; - break; case 'enable-selected': check_admin_referer('bulk-themes'); $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); @@ -65,7 +58,6 @@ if ( $action ) { update_site_option( 'allowedthemes', $allowed_themes ); wp_safe_redirect( add_query_arg( 'enabled', count( $themes ), $referer ) ); exit; - break; case 'disable-selected': check_admin_referer('bulk-themes'); $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); @@ -78,7 +70,6 @@ if ( $action ) { update_site_option( 'allowedthemes', $allowed_themes ); wp_safe_redirect( add_query_arg( 'disabled', count( $themes ), $referer ) ); exit; - break; case 'update-selected' : check_admin_referer( 'bulk-themes' ); @@ -95,8 +86,7 @@ if ( $action ) { require_once(ABSPATH . 'wp-admin/admin-header.php'); echo '
' . __('For more information:') . '
' . - '' . __('Documentation on Network Themes') . '
' . - '' . __('Support Forums') . '
' + '' . __('Documentation on Network Themes') . '
' . + '' . __('Support Forums') . '
' ); $title = __('Themes'); $parent_file = 'themes.php'; +wp_enqueue_script( 'theme-preview' ); + require_once(ABSPATH . 'wp-admin/admin-header.php'); ?>' . sprintf( _n( 'Theme enabled.', '%s themes enabled.', $_GET['enabled'] ), number_format_i18n( $_GET['enabled'] ) ) . '
' . sprintf( $message, number_format_i18n( $enabled ) ) . '
' . sprintf( _n( 'Theme disabled.', '%s themes disabled.', $_GET['disabled'] ), number_format_i18n( $_GET['disabled'] ) ) . '
' . sprintf( $message, number_format_i18n( $disabled ) ) . '
' . sprintf( _nx( 'Theme deleted.', '%s themes deleted.', $_GET['deleted'], 'network' ), number_format_i18n( $_GET['deleted'] ) ) . '
' . sprintf( $message, number_format_i18n( $deleted ) ) . '
' . __( 'No theme selected.' ) . '
' . __( 'No theme selected.' ) . '
' . __( 'You cannot delete a theme while it is active on the main site.' ) . '
' . __( 'You cannot delete a theme while it is active on the main site.' ) . '
' . __('The following themes are installed but incomplete. Themes must have a stylesheet and a template.') . '
'; ?> -