Make WordPress Core


Ignore:
Timestamp:
08/09/2008 05:36:14 AM (17 years ago)
Author:
ryan
Message:

Trailing whitespace cleanup

File:
1 edited

Legend:

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

    r8550 r8600  
    99    $args = apply_filters('plugins_api_args', $args, $action); //NOTE: Ensure that an object is returned via this filter.
    1010    $res = apply_filters('plugins_api', false, $action, $args); //NOTE: Allows a plugin to completely override the builtin WordPress.org API.
    11    
     11
    1212    if ( ! $res ) {
    1313        $request = wp_remote_post('http://api.wordpress.org/plugins/info/1.0/', array(), array(), array('action' => $action, 'request' => serialize($args)) );
     
    6868    }
    6969    ?>
    70    
     70
    7171    <p><?php _e('Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> via this page.') ?></p>
    72    
     72
    7373    <h4><?php _e('Search') ?></h4>
    7474    <?php install_search_form() ?>
     
    7777        <?php _e('<strong>Tag:</strong> Searches for plugins tagged as such') ?><br />
    7878        <?php _e('<strong>Author:</strong> Searches for plugins created by the Author, or which the Author contributed to.') ?></p>
    79    
     79
    8080    <h4><?php _e('Popular tags') ?></h4>
    8181    <p><?php _e('You may also search based on these popular tags, These are tags which are most popular on WordPress.org') ?></p>
     
    143143function display_plugins_table($plugins, $page = 1, $totalpages = 1){
    144144    global $tab;
    145    
     145
    146146    $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : '';
    147147    $term = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
     
    167167                'current' => $page
    168168            ));
    169            
     169
    170170            if ( $page_links )
    171                 echo "\t\t<div class='tablenav-pages'>$page_links</div>";   
     171                echo "\t\t<div class='tablenav-pages'>$page_links</div>";
    172172?>
    173173    </div>
     
    187187            if( empty($plugins) )
    188188                echo '<tr><td colspan="5">', __('No plugins match your request.'), '</td></tr>';
    189            
     189
    190190            foreach( (array) $plugins as $plugin ){
    191191                if ( is_object($plugin) )
     
    195195                $description = wp_kses($plugin['description'], $plugins_allowedtags);
    196196                $version = wp_kses($plugin['version'], $plugins_allowedtags);
    197                
     197
    198198                $name = strip_tags($title . ' ' . $version);
    199                
     199
    200200                $author = $plugin['author'];
    201201                if( ! empty($plugin['author']) )
     
    203203
    204204                $author = wp_kses($author, $plugins_allowedtags);
    205                
     205
    206206                if( isset($plugin['homepage']) )
    207207                    $title = '<a target="_blank" href="' . $plugin['homepage'] . '">' . $title . '</a>';
    208                
     208
    209209                $action_links = array();
    210210                $action_links[] = '<a href="' . admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] .
    211211                                    '&TB_iframe=true&width=600&height=800') . '" class="thickbox onclick" title="' .
    212212                                    attribute_escape($name) . '">' . __('Install') . '</a>';
    213                
     213
    214214                $action_links = apply_filters('plugin_install_action_links', $action_links, $plugin);
    215215            ?>
     
    279279function install_plugin_information() {
    280280    global $tab;
    281    
     281
    282282    $api = plugins_api('plugin_information', array('slug' => $_REQUEST['plugin']));
    283283
     
    285285    if( empty($section) || ! isset($api->sections[ $section ]) )
    286286        $section = array_shift( $section_titles = array_keys((array)$api->sections) );
    287    
     287
    288288    install_iframe_header();
    289289    echo "<div id='$tab-header'>\n";
    290290    echo "<ul id='sidemenu'>\n";
    291291    foreach ( (array)$api->sections as $section_name => $content ) {
    292    
     292
    293293        $title = $section_name;
    294294        $title[0] = strtoupper($title[0]); //Capitalize first character.
     
    303303    echo "</ul>\n";
    304304    echo "</div>\n";
    305    
     305
    306306    ?>
    307307    <div class="alignright fyi">
     
    350350            <li><strong><?php _e('Author:') ?></strong> <?php echo links_add_target($api->author, '_blank') ?></li>
    351351<?php endif; if ( ! empty($api->last_updated) ) : ?>
    352             <li><strong><?php _e('Last Updated:') ?></strong> <span title="<?php echo $api->last_updated ?>"><?php 
     352            <li><strong><?php _e('Last Updated:') ?></strong> <span title="<?php echo $api->last_updated ?>"><?php
    353353                            printf( __('%s ago'), human_time_diff(strtotime($api->last_updated)) ) ?></span></li>
    354354<?php endif; if ( ! empty($api->requires) ) : ?>
     
    381381            $title[0] = strtoupper($title[0]);
    382382            $title = str_replace('_', ' ', $title);
    383            
     383
    384384            $content = links_add_base_url($content, 'http://wordpress.org/extend/plugins/' . $api->slug . '/');
    385385            $content = links_add_target($content, '_blank');
    386            
     386
    387387            $san_title = attribute_escape(sanitize_title_with_dashes($title));
    388            
     388
    389389            $display = ( $section_name == $section ) ? 'block' : 'none';
    390            
     390
    391391            echo "\t<div id='section-{$san_title}' style='display: {$display};'>\n";
    392392            echo "\t\t<h2 class='long-header'>$title</h2>";
     
    407407
    408408    install_iframe_header();
    409    
     409
    410410    $api = plugins_api('plugin_information', array('slug' => $plugin, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth.
    411    
     411
    412412    echo '<div class="wrap">';
    413413    echo '<h2>', sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version ), '</h2>';
     
    420420function do_plugin_install($download_url = '', $plugin_information = NULL) {
    421421    global $wp_filesystem;
    422    
     422
    423423    if ( empty($download_url) ) {
    424424        show_message( __('No plugin Specified') );
    425425        return;
    426426    }
    427    
     427
    428428    $plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : '';
    429    
     429
    430430    $url = 'plugin-install.php?tab=install';
    431431    $url = add_query_arg(array('plugin' => $plugin, 'plugin_name' => $_REQUEST['plugin_name'], 'download_url' => $_REQUEST['download_url']), $url);
     
    447447
    448448    $result = wp_install_plugin( $download_url, 'show_message' );
    449    
     449
    450450    if ( is_wp_error($result) ) {
    451451        show_message($result);
     
    490490    if( empty($content_dir) )
    491491        return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).'));
    492    
     492
    493493    $plugins_dir = trailingslashit( $plugins_dir );
    494494    $content_dir = trailingslashit( $content_dir );
     
    513513    // Unzip package to working directory
    514514    $result = unzip_file($download_file, $working_dir);
    515    
     515
    516516    // Once extracted, delete the package
    517517    unlink($download_file);
    518    
     518
    519519    if ( is_wp_error($result) ) {
    520520        $wp_filesystem->delete($working_dir, true);
    521521        return $result;
    522522    }
    523    
     523
    524524    //Get a list of the directories in the working directory before we delete it, We need to know the new folder for the plugin
    525525    $filelist = array_keys( $wp_filesystem->dirlist($working_dir) );
    526    
     526
    527527    if( $wp_filesystem->exists( $plugins_dir . $filelist[0] ) ) {
    528528        $wp_filesystem->delete($working_dir, true);
    529529        return new WP_Error('install_folder_exists', __('Folder allready exists.'), $filelist[0] );
    530530    }
    531    
     531
    532532    apply_filters('install_feedback', __('Installing the plugin'));
    533533    // Copy new version of plugin into place.
     
    543543    // Remove working directory
    544544    $wp_filesystem->delete($working_dir, true);
    545    
     545
    546546    if( empty($filelist) )
    547547        return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup.
    548    
     548
    549549    $folder = $filelist[0];
    550550    $plugin = get_plugins('/' . $folder); //Ensure to pass with leading slash
Note: See TracChangeset for help on using the changeset viewer.