Ticket #28753: 28753.2.diff
| File 28753.2.diff, 14.7 KB (added by , 12 years ago) |
|---|
-
trunk/src/wp-admin/css/forms.css
751 751 margin: -3px 3px; 752 752 } 753 753 754 /*------------------------------------------------------------------------------ 755 21.0 - Upload File 756 ------------------------------------------------------------------------------*/ 757 758 .wp-upload-container { 759 -webkit-box-sizing: border-box; 760 -moz-box-sizing: border-box; 761 box-sizing: border-box; 762 margin: 0px 0 0; 763 padding: 0; 764 width: 100%; 765 overflow: hidden; 766 position: relative; 767 top: 10px; 768 } 769 .wp-upload-container-hidden { 770 display: none; 771 } 772 .wp-upload-container .wp-upload-form { 773 background: #fafafa; 774 border: 1px solid #e5e5e5; 775 padding: 30px; 776 margin: 30px auto; 777 max-width: 380px; 778 } 779 .wp-upload-container .install-help { 780 color: #999; 781 font-size: 18px; 782 font-style: normal; 783 margin: 0; 784 padding: 40px 0 0; 785 text-align: center; 786 } 787 788 body.show-upload-container .hide-on-upload, 789 body.show-upload-container .wp-upload-show { 790 display: none; 791 } 792 body.show-upload-container .wp-upload-container-hidden { 793 display: block; 794 } 795 796 .wp-upload-hide { 797 display: none; 798 } 799 body.show-upload-container .wp-upload-hide { 800 display: inline; 801 } 802 754 803 /* =Media Queries 755 804 -------------------------------------------------------------- */ 756 805 806 @media only screen and (max-width: 1120px) { 807 .wp-upload-container .wp-upload-form { 808 margin: 20px 0; 809 max-width: 100%; 810 } 811 .wp-upload-container .install-help { 812 font-size: 15px; 813 padding: 20px 0 0; 814 text-align: left; 815 } 816 } 817 757 818 @media screen and ( max-width: 782px ) { 758 819 /* Input Elements */ 759 820 textarea { -
trunk/src/wp-admin/css/themes.css
1103 1103 position: relative; 1104 1104 width: 100%; 1105 1105 } 1106 .theme-install-php a.upload,1107 .theme-install-php a.browse-themes {1108 cursor: pointer;1109 }1110 .theme-install-php a.browse-themes,1111 .theme-install-php.show-upload-theme a.upload {1112 display: none;1113 }1114 .theme-install-php.show-upload-theme a.browse-themes {1115 display: inline;1116 }1117 .upload-theme {1118 -webkit-box-sizing: border-box;1119 -moz-box-sizing: border-box;1120 box-sizing: border-box;1121 display: none;1122 margin: 0px 0 0;1123 padding: 0;1124 width: 100%;1125 overflow: hidden;1126 position: relative;1127 top: 10px;1128 }1129 body.show-upload-theme .upload-theme {1130 display: block;1131 }1132 .upload-theme .wp-upload-form {1133 background: #fafafa;1134 border: 1px solid #e5e5e5;1135 padding: 30px;1136 margin: 30px auto;1137 max-width: 380px;1138 }1139 .upload-theme .install-help {1140 color: #999;1141 font-size: 18px;1142 font-style: normal;1143 margin: 0;1144 padding: 40px 0 0;1145 text-align: center;1146 }1147 body.show-upload-theme .upload-theme + .theme-navigation,1148 body.show-upload-theme .upload-theme + .theme-navigation + .theme-browser {1149 display: none;1150 }1151 1106 .theme-navigation .theme-count { 1152 1107 margin-left: 0; 1153 1108 position: absolute; … … 1340 1295 body.no-results p.no-themes { 1341 1296 display: block; 1342 1297 } 1343 body.show-upload- themep.no-themes {1298 body.show-upload-container p.no-themes { 1344 1299 display: none !important; 1345 1300 } 1346 1301 … … 1358 1313 .more-filters-container { 1359 1314 border-bottom: 1px solid #eee; 1360 1315 } 1361 .upload-theme .wp-upload-form {1362 margin: 20px 0;1363 max-width: 100%;1364 }1365 .upload-theme .install-help {1366 font-size: 15px;1367 padding: 20px 0 0;1368 text-align: left;1369 }1370 1316 .more-filters-container .filters-group { 1371 1317 margin-bottom: 0; 1372 1318 margin-top: 5px; -
trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php
27 27 // These are the tabs which are shown on the page 28 28 $tabs = array(); 29 29 $tabs['dashboard'] = __( 'Search' ); 30 if ( 'search' == $tab ) 30 if ( 'search' == $tab ) { 31 31 $tabs['search'] = __( 'Search Results' ); 32 $tabs['upload'] = __( 'Upload' );32 } 33 33 $tabs['featured'] = _x( 'Featured', 'Plugin Installer' ); 34 34 $tabs['popular'] = _x( 'Popular', 'Plugin Installer' ); 35 35 $tabs['new'] = _x( 'Newest', 'Plugin Installer' ); … … 46 46 * @since 2.7.0 47 47 * 48 48 * @param array $tabs The tabs shown on the Plugin Install screen. Defaults are 'dashboard', 'search', 49 * ' upload', 'featured', 'popular', 'new', and 'favorites'.49 * 'featured', 'popular', 'new', and 'favorites'. 50 50 */ 51 51 $tabs = apply_filters( 'install_plugins_tabs', $tabs ); 52 52 … … 112 112 * Filter API request arguments for each Plugin Install screen tab. 113 113 * 114 114 * The dynamic portion of the hook name, $tab, refers to the plugin install tabs. 115 * Default tabs are 'dashboard', 'search', ' upload', 'featured', 'popular', 'new',115 * Default tabs are 'dashboard', 'search', 'featured', 'popular', 'new', 116 116 * and 'favorites'. 117 117 * 118 118 * @since 3.7.0 -
trunk/src/wp-admin/includes/plugin-install.php
126 126 127 127 function install_dashboard() { 128 128 ?> 129 <p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%1$s">WordPress Plugin Directory</a> or upload a plugin in .zip format via <a href="%2$s">this page</a>.' ), 'https://wordpress.org/plugins/', self_admin_url( 'plugin-install.php?tab=upload' ) ); ?></p>129 <p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%1$s">WordPress Plugin Directory</a> or <a href="%2$s" class="wp-upload-show">upload a plugin</a> in .zip format.' ), 'https://wordpress.org/plugins/', self_admin_url( 'plugin-install.php?upload' ) ); ?></p> 130 130 131 131 <h4><?php _e('Search') ?></h4> 132 132 <?php install_search_form( false ); ?> … … 187 187 */ 188 188 function install_plugins_upload( $page = 1 ) { 189 189 ?> 190 <h4><?php _e('Install a plugin in .zip format'); ?></h4> 191 <p class="install-help"><?php _e('If you have a plugin in a .zip format, you may install it by uploading it here.'); ?></p> 192 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url('update.php?action=upload-plugin'); ?>"> 193 <?php wp_nonce_field( 'plugin-upload'); ?> 194 <label class="screen-reader-text" for="pluginzip"><?php _e('Plugin zip file'); ?></label> 195 <input type="file" id="pluginzip" name="pluginzip" /> 196 <?php submit_button( __( 'Install Now' ), 'button', 'install-plugin-submit', false ); ?> 197 </form> 190 <div class="wp-upload-container wp-upload-container-hidden"> 191 <p class="install-help"><?php _e( 'If you have a plugin in a .zip format, you may install it by uploading it here.' ); ?></p> 192 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-plugin' ); ?>"> 193 <?php wp_nonce_field( 'plugin-upload' ); ?> 194 <label class="screen-reader-text" for="pluginzip"><?php _e( 'Plugin zip file' ); ?></label> 195 <input type="file" id="pluginzip" name="pluginzip" /> 196 <?php submit_button( __( 'Install Now' ), 'button', 'install-plugin-submit', false ); ?> 197 </form> 198 </div> 198 199 <?php 199 200 } 200 201 add_action('install_plugins_upload', 'install_plugins_upload', 10, 1); -
trunk/src/wp-admin/includes/theme-install.php
136 136 137 137 function install_themes_upload() { 138 138 ?> 139 <p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.'); ?></p> 140 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url('update.php?action=upload-theme'); ?>"> 141 <?php wp_nonce_field( 'theme-upload'); ?> 142 <input type="file" name="themezip" /> 143 <?php submit_button( __( 'Install Now' ), 'button', 'install-theme-submit', false ); ?> 144 </form> 145 <?php 139 <div class="wp-upload-container wp-upload-container-hidden"> 140 <p class="install-help"><?php _e( 'If you have a theme in a .zip format, you may install it by uploading it here.' ); ?></p> 141 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-theme' ); ?>"> 142 <?php wp_nonce_field( 'theme-upload' ); ?> 143 <input type="file" name="themezip" /> 144 <?php submit_button( __( 'Install Now' ), 'button', 'install-theme-submit', false ); ?> 145 </form> 146 </div> 147 <?php 146 148 } 147 149 // add_action('install_themes_upload', 'install_themes_upload', 10, 0); 148 150 -
trunk/src/wp-admin/js/theme.js
1497 1497 searchContainer: $( '.theme-navigation' ), 1498 1498 1499 1499 uploader: function() { 1500 $( ' a.upload' ).on( 'click', function( event ) {1500 $( '.wp-upload-show' ).on( 'click', function( event ) { 1501 1501 event.preventDefault(); 1502 $( 'body' ).addClass( 'show-upload- theme' );1502 $( 'body' ).addClass( 'show-upload-container' ); 1503 1503 themes.router.navigate( themes.router.baseUrl( '?upload' ), { replace: true } ); 1504 1504 }); 1505 $( ' a.browse-themes' ).on( 'click', function( event ) {1505 $( '.wp-upload-hide' ).on( 'click', function( event ) { 1506 1506 event.preventDefault(); 1507 $( 'body' ).removeClass( 'show-upload- theme' );1507 $( 'body' ).removeClass( 'show-upload-container' ); 1508 1508 themes.router.navigate( themes.router.baseUrl( '' ), { replace: true } ); 1509 1509 }); 1510 1510 }, … … 1642 1642 1643 1643 // Support the `upload` route by going straight to upload section 1644 1644 themes.router.on( 'route:upload', function() { 1645 $( ' a.upload' ).trigger( 'click' );1645 $( '.wp-upload-show' ).trigger( 'click' ); 1646 1646 }); 1647 1647 1648 1648 // The `search` route event. The router populates the input field. -
trunk/src/wp-admin/plugin-install.php
29 29 $title = __('Install Plugins'); 30 30 $parent_file = 'plugins.php'; 31 31 32 wp_enqueue_script( 'plugin-install' ); 32 wp_localize_script( 'plugin', '_wpPluginSettings', array( 33 'plugins' => false, 34 'settings' => array( 35 'isInstall' => true, 36 'canInstall' => current_user_can( 'install_plugins' ), 37 'installURI' => current_user_can( 'install_plugins' ) ? self_admin_url( 'plugin-install.php' ) : null, 38 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ) 39 ), 40 'l10n' => array( 41 'pluginInformation' => __('Plugin Information:'), 42 'ays' => __('Are you sure you want to install this plugin?') 43 ), 44 ) ); 45 46 wp_enqueue_script( 'plugin' ); 47 33 48 if ( 'plugin-information' != $tab ) 34 49 add_thickbox(); 35 50 … … 73 88 include(ABSPATH . 'wp-admin/admin-header.php'); 74 89 ?> 75 90 <div class="wrap"> 76 <h2><?php echo esc_html( $title ); ?></h2> 91 <h2> 92 <?php echo esc_html( $title ); ?> 93 94 <a href="#" class="wp-upload-show add-new-h2"><?php echo __( 'Upload Plugin' ); ?></a> 95 <a href="#" class="wp-upload-hide add-new-h2"><?php echo __( 'Browse', 'plugins' ); ?></a> 96 </h2> 77 97 78 <?php $wp_list_table->views(); ?>98 <?php install_plugins_upload(); ?> 79 99 80 <br class="clear" /> 81 <?php 82 /** 83 * Fires after the plugins list table in each tab of the Install Plugins screen. 84 * 85 * The dynamic portion of the action hook, $tab, allows for targeting 86 * individual tabs, for instance 'install_plugins_plugin-information'. 87 * 88 * @since 2.7.0 89 * 90 * @param int $paged The current page number of the plugins list table. 91 */ 92 ?> 93 <?php do_action( "install_plugins_$tab", $paged ); ?> 100 <div class="hide-on-upload"> 101 <?php $wp_list_table->views(); ?> 102 103 <br class="clear" /> 104 105 <?php 106 /** 107 * Fires after the plugins list table in each tab of the Install Plugins screen. 108 * 109 * The dynamic portion of the action hook, $tab, allows for targeting 110 * individual tabs, for instance 'install_plugins_plugin-information'. 111 * 112 * @since 2.7.0 113 * 114 * @param int $paged The current page number of the plugins list table. 115 */ 116 do_action( "install_plugins_$tab", $paged ); ?> 117 </div> 94 118 </div> 95 119 <?php 96 120 /** -
trunk/src/wp-admin/theme-install.php
125 125 */ 126 126 $tabs = apply_filters( 'install_themes_tabs', $tabs ); 127 127 foreach ( $tabs as $tab_slug => $tab_name ) { 128 echo '<a href="#" class="' . esc_attr( $tab_slug ) . ' add-new-h2">' . $tab_name . '</a>'; 128 $visibility = $tab_slug == 'upload' ? ' wp-upload-show' : ' wp-upload-hide'; 129 130 echo '<a href="#" class="' . esc_attr( $tab_slug ) . $visibility . ' add-new-h2">' . $tab_name . '</a>'; 129 131 } 130 132 ?> 131 133 </h2> 132 134 133 <div class="upload-theme">134 135 <?php install_themes_upload(); ?> 135 </div> 136 137 <div class="theme-navigation"> 136 137 <div class="theme-navigation hide-on-upload"> 138 138 <span class="theme-count"></span> 139 139 <a class="theme-section" href="#" data-sort="featured"><?php _ex( 'Featured', 'themes' ); ?></a> 140 140 <a class="theme-section" href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a> … … 175 175 </div> 176 176 </div> 177 177 </div> 178 <div class="theme-browser "></div>178 <div class="theme-browser hide-on-upload"></div> 179 179 <div class="theme-install-overlay wp-full-overlay expanded"></div> 180 180 181 181 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> -
trunk/src/wp-includes/script-loader.php
486 486 'error' => __('Error while saving the changes.') 487 487 ) ); 488 488 489 $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), false, 1 ); 490 did_action( 'init' ) && $scripts->localize( 'plugin-install', 'plugininstallL10n', array( 491 'plugin_information' => __('Plugin Information:'), 492 'ays' => __('Are you sure you want to install this plugin?') 493 ) ); 489 $scripts->add( 'plugin', "/wp-admin/js/plugin$suffix.js", array( 'wp-backbone' ), false, 1 ); 494 490 495 491 $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery' ) ); 496 492