Make WordPress Core

Changeset 10829


Ignore:
Timestamp:
03/20/2009 01:31:00 PM (18 years ago)
Author:
ryan
Message:

Split add new plugin dashboard into search and upload.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/plugin-install.php

    r10823 r10829  
    128128        <p class="install-help"><?php _e('Search for plugins by keyword, author, or tag.') ?></p>
    129129        <?php install_search_form(); ?>
    130 
    131         <h4><?php _e('Install a plugin in .zip format') ?></h4>
    132         <p class="install-help"><?php _e('If you have a plugin in a .zip format, You may install it by uploading it here.') ?></p>
    133         <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('plugin-install.php?tab=upload') ?>">
    134                 <?php wp_nonce_field( 'plugin-upload') ?>
    135                 <input type="file" name="pluginzip" />
    136                 <input type="submit" class="button" value="<?php _e('Install Now') ?>" />
    137         </form>
    138130
    139131        <h4><?php _e('Popular tags') ?></h4>
    … …  
    204196        $api = plugins_api('query_plugins', $args);
    205197        display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']);
     198}
     199
     200add_action('install_plugins_upload', 'install_plugins_upload', 10, 1);
     201/**
     202 * Upload from zip
     203 * @since 2.8.0
     204 *
     205 * @param string $page
     206 */
     207function install_plugins_upload( $page = 1 ) {
     208?>
     209        <h4><?php _e('Install a plugin in .zip format') ?></h4>
     210        <p class="install-help"><?php _e('If you have a plugin in a .zip format, You may install it by uploading it here.') ?></p>
     211        <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('plugin-install.php?tab=do_upload') ?>">
     212                <?php wp_nonce_field( 'plugin-upload') ?>
     213                <input type="file" name="pluginzip" />
     214                <input type="submit" class="button" value="<?php _e('Install Now') ?>" />
     215        </form>
     216<?php
    206217}
    207218
    … …  
    536547
    537548
    538 add_action('install_plugins_upload', 'upload_plugin');
     549add_action('install_plugins_do_upload', 'upload_plugin');
    539550function upload_plugin() {
    540551
  • trunk/wp-admin/plugin-install.php

    r10150 r10829  
    2525//These are the tabs which are shown on the page,
    2626$tabs = array();
    27 $tabs['dashboard'] = __('Start Page'); //TODO: Better name?
     27$tabs['dashboard'] = __('Search'); //TODO: Better name?
    2828if ( 'search' == $tab )
    2929        $tabs['search'] = __('Search Results');
     30$tabs['upload'] = __('Upload');
    3031$tabs['featured'] = __('Featured');
    3132$tabs['popular']  = __('Popular');
    … …  
    3334$tabs['updated']  = __('Recently Updated');
    3435
    35 $nonmenu_tabs = array('install', 'plugin-information', 'upload'); //Valid actions to perform which do not have a Menu item.
     36$nonmenu_tabs = array('install', 'plugin-information', 'do_upload'); //Valid actions to perform which do not have a Menu item.
    3637
    3738$tabs = apply_filters('install_plugins_tabs', $tabs );
Note: See TracChangeset for help on using the changeset viewer.