-<table class="widefat" cellspacing="0" id="<?php echo $context ?>-plugins-table">
- <thead>
- <tr>
- <th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
- <th scope="col" class="manage-column"><?php _e('Plugin'); ?></th>
- <th scope="col" class="manage-column"><?php _e('Description'); ?></th>
- </tr>
- </thead>
-
- <tfoot>
- <tr>
- <th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
- <th scope="col" class="manage-column"><?php _e('Plugin'); ?></th>
- <th scope="col" class="manage-column"><?php _e('Description'); ?></th>
- </tr>
- </tfoot>
-
- <tbody class="plugins">
-<?php
-
- if ( empty($plugins) ) {
- echo '<tr>
- <td colspan="3">' . __('No plugins to show') . '</td>
- </tr>';
- }
- foreach ( (array)$plugins as $plugin_file => $plugin_data) {
- $actions = array();
- $is_active = is_plugin_active($plugin_file);
-
- if ( $is_active )
- $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
- else
- $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, '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) )
- $actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
-
- if ( ! $is_active && current_user_can('delete_plugins') )
- $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
-
- $actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
- $actions = apply_filters( "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
- $action_count = count($actions);
- $class = $is_active ? 'active' : 'inactive';
- echo "
- <tr class='$class'>
- <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>
- <td class='plugin-title'><strong>{$plugin_data['Name']}</strong></td>
- <td class='desc'><p>{$plugin_data['Description']}</p></td>
- </tr>
- <tr class='$class second'>
- <td></td>
- <td class='plugin-title'>";
- echo '<div class="row-actions-visible">';
- foreach ( $actions as $action => $link ) {
- $sep = end($actions) == $link ? '' : ' | ';
- echo "<span class='$action'>$link$sep</span>";
- }
- echo "</div></td>
- <td class='desc'>";
- $plugin_meta = array();
- if ( !empty($plugin_data['Version']) )
- $plugin_meta[] = sprintf(__('Version %s'), $plugin_data['Version']);
- if ( !empty($plugin_data['Author']) ) {
- $author = $plugin_data['Author'];
- if ( !empty($plugin_data['AuthorURI']) )
- $author = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . __( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>';
- $plugin_meta[] = sprintf( __('By %s'), $author );
- }
- if ( ! empty($plugin_data['PluginURI']) )
- $plugin_meta[] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . __( 'Visit plugin site' ) . '">' . __('Visit plugin site') . '</a>';
-
- $plugin_meta = apply_filters('plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $context);
- echo implode(' | ', $plugin_meta);
- echo "</td>
- </tr>\n";