-unset( $plugin_array_name );
-
-foreach ( (array) $all_plugins as $plugin_file => $plugin_data) {
- // Filter into individual sections
- if ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) {
- unset( $all_plugins[ $plugin_file ] );
- continue;
- } elseif ( is_plugin_active_for_network($plugin_file) ) {
- $network_plugins[ $plugin_file ] = $plugin_data;
- } elseif ( is_plugin_active($plugin_file) ) {
- $active_plugins[ $plugin_file ] = $plugin_data;
- } else {
- if ( isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
- $recent_plugins[ $plugin_file ] = $plugin_data;
- $inactive_plugins[ $plugin_file ] = $plugin_data;
- }
-
- if ( isset( $current->response[ $plugin_file ] ) )
- $upgrade_plugins[ $plugin_file ] = $plugin_data;
-}
-
-if ( !current_user_can('update_plugins') )
- $upgrade_plugins = array();
-
-$total_all_plugins = count($all_plugins);
-$total_inactive_plugins = count($inactive_plugins);
-$total_active_plugins = count($active_plugins);
-$total_recent_plugins = count($recent_plugins);
-$total_upgrade_plugins = count($upgrade_plugins);
-$total_network_plugins = count($network_plugins);
-$total_mustuse_plugins = count($mustuse_plugins);
-$total_dropins_plugins = count($dropins_plugins);
-
-// Searching.
-if ( !empty($_GET['s']) ) {
- function _search_plugins_filter_callback($plugin) {
- static $term;
- if ( is_null($term) )
- $term = stripslashes($_GET['s']);
- if ( stripos($plugin['Name'], $term) !== false ||
- stripos($plugin['Description'], $term) !== false ||
- stripos($plugin['Author'], $term) !== false ||
- stripos($plugin['PluginURI'], $term) !== false ||
- stripos($plugin['AuthorURI'], $term) !== false ||
- stripos($plugin['Version'], $term) !== false )
- return true;
- else
- return false;
- }
- $status = 'search';
- $search_plugins = array_filter($all_plugins, '_search_plugins_filter_callback');
- $total_search_plugins = count($search_plugins);
-}
-
-$plugin_array_name = "${status}_plugins";
-if ( empty($$plugin_array_name) && !in_array($status, array('all', 'search')) ) {
- $status = 'all';
- $plugin_array_name = "${status}_plugins";
-}
-
-$plugins = &$$plugin_array_name;
-
-// Paging.
-$total_this_page = "total_{$status}_plugins";
-$total_this_page = $$total_this_page;
-$plugins_per_page = (int) get_user_option( 'plugins_per_page' );
-if ( empty( $plugins_per_page ) || $plugins_per_page < 1 )
- $plugins_per_page = 999;
-$plugins_per_page = apply_filters( 'plugins_per_page', $plugins_per_page );
-
-$start = ($page - 1) * $plugins_per_page;
-
-$page_links = paginate_links( array(
- 'base' => add_query_arg( 'paged', '%#%' ),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => ceil($total_this_page / $plugins_per_page),
- 'current' => $page
-));
-$page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
- number_format_i18n( $start + 1 ),
- number_format_i18n( min( $page * $plugins_per_page, $total_this_page ) ),
- '<span class="total-type-count">' . number_format_i18n( $total_this_page ) . '</span>',
- $page_links
-);
-
-/**
- * @ignore
- *
- * @param array $plugins
- * @param string $context
- */
-function print_plugins_table($plugins, $context = '') {
- global $page;
- $checkbox = ! in_array( $context, array( 'mustuse', 'dropins' ) ) ? '<input type="checkbox" />' : '';