-<?php
-/**
- * @ignore
- *
- * @param array $plugins
- * @param string $context
- */
-function print_plugins_table($plugins, $context = '') {
-?>
-<table class="widefat" cellspacing="0" id="<?php echo $context ?>-plugins-table">
- <thead>
- <tr>
- <th scope="col" class="check-column"><input type="checkbox" /></th>
- <th scope="col"><?php _e('Plugin'); ?></th>
- <th scope="col" class="num"><?php _e('Version'); ?></th>
- <th scope="col"><?php _e('Description'); ?></th>
- <th scope="col" class="action-links"><?php _e('Action'); ?></th>
- </tr>
- </thead>
-
- <tfoot>
- <tr>
- <th scope="col" class="check-column"><input type="checkbox" /></th>
- <th scope="col"><?php _e('Plugin'); ?></th>
- <th scope="col" class="num"><?php _e('Version'); ?></th>
- <th scope="col"><?php _e('Description'); ?></th>
- <th scope="col" class="action-links"><?php _e('Action'); ?></th>
- </tr>
- </tfoot>
-
- <tbody class="plugins">
-<?php
-
- if ( empty($plugins) ) {
- echo '<tr>
- <td colspan="6">' . __('No plugins to show') . '</td>
- </tr>';
- }
- foreach ( (array)$plugins as $plugin_file => $plugin_data) {
- $action_links = array();
-
- if ( 'active' == $context )
- $action_links[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
- else //Inactive or Recently deactivated
- $action_links[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
-
- if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
- $action_links[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
-
- $action_links = apply_filters( 'plugin_action_links', $action_links, $plugin_file, $plugin_data, $context );
- $action_links = apply_filters( "plugin_action_links_$plugin_file", $action_links, $plugin_file, $plugin_data, $context );
-
- echo "
- <tr class='$context'>
- <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . attribute_escape($plugin_file) . "' /></th>
- <td class='name'>{$plugin_data['Title']}</td>
- <td class='vers'>{$plugin_data['Version']}</td>
- <td class='desc'><p>{$plugin_data['Description']}</p></td>
- <td class='togl action-links'>";
- if ( !empty($action_links) )
- echo implode(' | ', $action_links);
- echo '</td>
- </tr>';
- do_action( 'after_plugin_row', $plugin_file, $plugin_data, $context );
- do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $context );
- }
-?>
- </tbody>
-</table>
-<?php
-} //End print_plugins_table()
-
-/**
- * @ignore
- *
- * @param string $context
- */
-function print_plugin_actions($context) {
-?>
- <div class="alignleft actions">
- <select name="action">
- <option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
- <?php if( 'active' != $context ) : ?>
- <option value="activate-selected"><?php _e('Activate'); ?></option>
- <?php endif; ?>
- <?php if ( 'active' == $context ) : ?>
- <option value="deactivate-selected"><?php _e('Deactivate'); ?></option>
- <?php endif; ?>
- <?php if( current_user_can('delete_plugins') && ( 'recent' == $context || 'inactive' == $context ) ) : ?>
- <option value="delete-selected"><?php _e('Delete'); ?></option>
- <?php endif; ?>
- </select>
- <input type="submit" name="doaction_active" value="<?php _e('Apply'); ?>" class="button-secondary action" />
- <?php if( 'recent' == $context ) : ?>
- <input type="submit" name="clear-recent-list" value="<?php _e('Clear List') ?>" class="button-secondary" />
- <?php endif; ?>
- </div>
-<?php
-}
-?>
-
-<?php if ( ! empty($active_plugins) ) : ?>
-<h3 id="currently-active"><?php _e('Currently Active Plugins') ?></h3>
-<form method="post" action="<?php echo admin_url('plugins.php') ?>">
-<?php wp_nonce_field('bulk-manage-plugins') ?>
-
-<div class="tablenav">
-<?php print_plugin_actions('active') ?>
-</div>
-<div class="clear"></div>
-<?php print_plugins_table($active_plugins, 'active') ?>