-?>
- <div class="tablenav">
- <div class="alignleft actions">
- <?php do_action('install_plugins_table_header'); ?>
- </div>
- <?php
- $url = esc_url($_SERVER['REQUEST_URI']);
- if ( ! empty($term) )
- $url = add_query_arg('s', $term, $url);
- if ( ! empty($type) )
- $url = add_query_arg('type', $type, $url);
-
- $page_links = paginate_links( array(
- 'base' => add_query_arg('paged', '%#%', $url),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => $totalpages,
- 'current' => $page
- ));
-
- if ( $page_links )
- echo "\t\t<div class='tablenav-pages'>$page_links</div>";
-?>
- <br class="clear" />
- </div>
- <table class="widefat" id="install-plugins" cellspacing="0">
- <thead>
- <tr>
- <th scope="col" class="name"><?php _e('Name'); ?></th>
- <th scope="col" class="num"><?php _e('Version'); ?></th>
- <th scope="col" class="num"><?php _e('Rating'); ?></th>
- <th scope="col" class="desc"><?php _e('Description'); ?></th>
- </tr>
- </thead>
-
- <tfoot>
- <tr>
- <th scope="col" class="name"><?php _e('Name'); ?></th>
- <th scope="col" class="num"><?php _e('Version'); ?></th>
- <th scope="col" class="num"><?php _e('Rating'); ?></th>
- <th scope="col" class="desc"><?php _e('Description'); ?></th>
- </tr>
- </tfoot>
-
- <tbody class="plugins">
- <?php
- if ( empty($plugins) )
- echo '<tr><td colspan="5">', __('No plugins match your request.'), '</td></tr>';
-
- foreach ( (array) $plugins as $plugin ){
- if ( is_object($plugin) )
- $plugin = (array) $plugin;
-
- $title = wp_kses($plugin['name'], $plugins_allowedtags);
- //Limit description to 400char, and remove any HTML.
- $description = strip_tags($plugin['description']);
- if ( strlen($description) > 400 )
- $description = mb_substr($description, 0, 400) . '…';
- //remove any trailing entities
- $description = preg_replace('/&[^;\s]{0,6}$/', '', $description);
- //strip leading/trailing & multiple consecutive lines
- $description = trim($description);
- $description = preg_replace("|(\r?\n)+|", "\n", $description);
- //\n => <br>
- $description = nl2br($description);
- $version = wp_kses($plugin['version'], $plugins_allowedtags);
-
- $name = strip_tags($title . ' ' . $version);
-
- $author = $plugin['author'];
- if ( ! empty($plugin['author']) )
- $author = ' <cite>' . sprintf( __('By %s'), $author ) . '.</cite>';
-
- $author = wp_kses($author, $plugins_allowedtags);
-
- $action_links = array();
- $action_links[] = '<a href="' . admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] .
- '&TB_iframe=true&width=600&height=550') . '" class="thickbox" title="' .
- esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '">' . __('Details') . '</a>';
-
- if ( current_user_can('install_plugins') || current_user_can('update_plugins') ) {
- $status = install_plugin_install_status($plugin);
-
- switch ( $status['status'] ) {
- case 'install':
- if ( $status['url'] )
- $action_links[] = '<a class="install-now" href="' . $status['url'] . '" title="' . esc_attr( sprintf( __( 'Install %s' ), $name ) ) . '">' . __('Install Now') . '</a>';
- break;
- case 'update_available':
- if ( $status['url'] )
- $action_links[] = '<a href="' . $status['url'] . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $status['version'] ) ) . '">' . sprintf( __('Update Now'), $status['version'] ) . '</a>';
- break;
- case 'latest_installed':
- case 'newer_installed':
- $action_links[] = '<span title="' . esc_attr__( 'This plugin is already installed and is up to date' ) . ' ">' . __('Installed') . '</span>';
- break;
- }
- }
-
- $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
- ?>
- <tr>
- <td class="name"><strong><?php echo $title; ?></strong>
- <div class="action-links"><?php if ( !empty($action_links) ) echo implode(' | ', $action_links); ?></div>
- </td>
- <td class="vers"><?php echo $version; ?></td>
- <td class="vers">
- <div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $plugin['num_ratings']), number_format_i18n($plugin['num_ratings'])) ?>">
- <div class="star star-rating" style="width: <?php echo esc_attr($plugin['rating']) ?>px"></div>
- <div class="star star5"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('5 stars') ?>" /></div>
- <div class="star star4"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('4 stars') ?>" /></div>
- <div class="star star3"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('3 stars') ?>" /></div>
- <div class="star star2"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('2 stars') ?>" /></div>
- <div class="star star1"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('1 star') ?>" /></div>
- </div>
- </td>
- <td class="desc"><?php echo $description, $author; ?></td>
- </tr>
- <?php