Changeset 29634
- Timestamp:
- 08/27/2014 01:31:05 AM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/themes.css
r29616 r29634 1092 1092 display: inline; 1093 1093 } 1094 .upload-theme { 1094 .upload-theme, 1095 .upload-plugin { 1095 1096 -webkit-box-sizing: border-box; 1096 1097 -moz-box-sizing: border-box; … … 1104 1105 top: 10px; 1105 1106 } 1106 body.show-upload-theme .upload-theme { 1107 display: block; 1108 } 1109 .upload-theme .wp-upload-form { 1107 body.show-upload-theme .upload-theme, 1108 .upload-plugin { 1109 display: block; 1110 } 1111 .upload-theme .wp-upload-form, 1112 .upload-plugin .wp-upload-form { 1110 1113 background: #fafafa; 1111 1114 border: 1px solid #e5e5e5; … … 1114 1117 max-width: 380px; 1115 1118 } 1116 .upload-theme .install-help { 1119 .upload-theme .install-help, 1120 .upload-plugin .install-help { 1117 1121 color: #999; 1118 1122 font-size: 18px; -
trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php
r29597 r29634 70 70 $tabs['beta'] = _x( 'Beta Testing', 'Plugin Installer' ); 71 71 } 72 73 $nonmenu_tabs = array( 'upload', 'plugin-information' ); //Valid actions to perform which do not have a Menu item. 72 if ( current_user_can( 'upload_plugins' ) ) { 73 // No longer a real tab. Here for filter compatibility. 74 // Gets juggled into $nonmenu_tabs below. 75 $tabs['upload'] = __( 'Upload Plugin' ); 76 } 77 78 $nonmenu_tabs = array( 'plugin-information' ); // Valid actions to perform which do not have a Menu item. 74 79 75 80 /** … … 91 96 */ 92 97 $nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs ); 98 99 if ( isset( $tabs['upload'] ) ) { 100 unset( $tabs['upload'] ); 101 $nonmenu_tabs[] = 'upload'; 102 } 93 103 94 104 // If a non-valid menu tab has been selected, And it's not a non-menu action. -
trunk/src/wp-admin/includes/plugin-install.php
r29597 r29634 196 196 function install_plugins_upload( $page = 1 ) { 197 197 ?> 198 <h4><?php _e('Install a plugin in .zip format'); ?></h4>198 <div class="upload-plugin"> 199 199 <p class="install-help"><?php _e('If you have a plugin in a .zip format, you may install it by uploading it here.'); ?></p> 200 200 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url('update.php?action=upload-plugin'); ?>"> … … 204 204 <?php submit_button( __( 'Install Now' ), 'button', 'install-plugin-submit', false ); ?> 205 205 </form> 206 </div> 206 207 <?php 207 208 } -
trunk/src/wp-admin/plugin-install.php
r29218 r29634 27 27 $wp_list_table->prepare_items(); 28 28 29 $title = __( 'Install Plugins');29 $title = __( 'Add Plugins' ); 30 30 $parent_file = 'plugins.php'; 31 31 … … 76 76 <h2> 77 77 <?php 78 echo esc_html( $title ); 79 $href = self_admin_url( 'plugin-install.php?tab=upload' ); 78 echo esc_html( $title ); 79 if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) { 80 if ( $tab === 'upload' ) { 81 $href = self_admin_url( 'plugin-install.php' ); 82 $text = _x( 'Browse', 'plugins' ); 83 } else { 84 $href = self_admin_url( 'plugin-install.php?tab=upload' ); 85 $text = __( 'Upload Plugin' ); 86 } 87 echo ' <a href="' . $href . '" class="upload add-new-h2">' . $text . '</a>'; 88 } 80 89 ?> 81 <a href="<?php echo $href; ?>" class="upload add-new-h2"><?php _e( 'Upload Plugin' ); ?></a>82 90 </h2> 83 91 84 <?php $wp_list_table->views(); ?> 92 <?php 93 if ( $tab !== 'upload' ) { 94 $wp_list_table->views(); 95 echo '<br class="clear" />'; 96 } 85 97 86 <br class="clear" />87 <?php88 98 /** 89 99 * Fires after the plugins list table in each tab of the Install Plugins screen. -
trunk/src/wp-admin/theme-install.php
r29596 r29634 27 27 $submenu_file = 'themes.php'; 28 28 } 29 30 $tabs = array(31 'upload' => __( 'Upload Theme' ),32 'browse-themes' => _x( 'Browse', 'themes' ),33 );34 29 35 30 $sections = array( … … 114 109 ?> 115 110 <div class="wrap"> 116 <h2> 117 <?php echo esc_html( $title ); ?> 118 <?php 119 /** 120 * Filter the tabs shown on the Install Themes screen. 121 * 122 * @since 2.8.0 123 * @param array $tabs The tabs shown on the Install Themes screen. Defaults are 124 * 'upload' and 'browse-themes'. 125 */ 126 $tabs = apply_filters( 'install_themes_tabs', $tabs ); 127 foreach ( $tabs as $tab_slug => $tab_name ) { 128 echo '<a href="#" class="' . esc_attr( $tab_slug ) . ' add-new-h2">' . $tab_name . '</a>'; 129 } 130 ?> 131 </h2> 111 <h2><?php 112 echo esc_html( $title ); 113 114 /** 115 * Filter the tabs shown on the Add Themes screen. 116 * 117 * This filter is for backwards compatibility only, 118 * for the suppression of the upload tab. 119 * 120 * @since 2.8.0 121 * @param array $tabs The tabs shown on the Add Themes screen. Default is 'upload'. 122 */ 123 $tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) ); 124 if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) { 125 echo ' <a href="#" class="upload add-new-h2">' . __( 'Upload Theme' ) . '</a>'; 126 echo ' <a href="#" class="browse-themes add-new-h2">' . _x( 'Browse', 'themes' ) . '</a>'; 127 } 128 ?></h2> 132 129 133 130 <div class="upload-theme"> -
trunk/src/wp-admin/update.php
r28500 r29634 124 124 } elseif ( 'upload-plugin' == $action ) { 125 125 126 if ( ! current_user_can( 'install_plugins') )126 if ( ! current_user_can( 'upload_plugins' ) ) { 127 127 wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) ); 128 } 128 129 129 130 check_admin_referer('plugin-upload'); … … 228 229 } elseif ( 'upload-theme' == $action ) { 229 230 230 if ( ! current_user_can( 'install_themes') )231 if ( ! current_user_can( 'upload_themes' ) ) { 231 232 wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) ); 233 } 232 234 233 235 check_admin_referer('theme-upload'); -
trunk/src/wp-includes/capabilities.php
r29170 r29634 1263 1263 case 'delete_plugins': 1264 1264 case 'install_plugins': 1265 case 'upload_plugins': 1265 1266 case 'update_themes': 1266 1267 case 'delete_themes': 1267 1268 case 'install_themes': 1269 case 'upload_themes': 1268 1270 case 'update_core': 1269 1271 // Disallow anything that creates, deletes, or updates core, plugin, or theme files. 1270 1272 // Files in uploads are excepted. 1271 if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) 1273 if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) { 1272 1274 $caps[] = 'do_not_allow'; 1273 elseif ( is_multisite() && ! is_super_admin( $user_id ) )1275 } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) { 1274 1276 $caps[] = 'do_not_allow'; 1275 else 1277 } elseif ( 'upload_themes' === $cap ) { 1278 $caps[] = 'install_themes'; 1279 } elseif ( 'upload_plugins' === $cap ) { 1280 $caps[] = 'install_plugins'; 1281 } else { 1276 1282 $caps[] = $cap; 1283 } 1277 1284 break; 1278 1285 case 'activate_plugins':
Note: See TracChangeset
for help on using the changeset viewer.