Ticket #1657: edit_plugins_refresh.diff

File edit_plugins_refresh.diff, 2.6 KB (added by markjaquith, 6 years ago)

Fresh patch for /trunk/ ... old one had rotted

  • wp-admin/plugins.php

     
    8484                <th><?php _e('Plugin'); ?></th> 
    8585                <th style="text-align: center"><?php _e('Version'); ?></th> 
    8686                <th><?php _e('Description'); ?></th> 
    87                 <th style="text-align: center"><?php _e('Action'); ?></th> 
     87                <th style="text-align: center" colspan="2"><?php _e('Action'); ?></th> 
    8888        </tr> 
    8989        </thead> 
    9090<?php 
     
    100100                $style = ('class="alternate"' == $style|| 'class="alternate active"' == $style) ? '' : 'alternate'; 
    101101 
    102102                if (!empty($current_plugins) && in_array($plugin_file, $current_plugins)) { 
    103                         $action = "<a href='" . wp_nonce_url("plugins.php?action=deactivate&amp;plugin=$plugin_file", 'deactivate-plugin_' . $plugin_file) . "' title='".__('Deactivate this plugin')."' class='delete'>".__('Deactivate')."</a>"; 
     103                        $toggle = "<a href='" . wp_nonce_url("plugins.php?action=deactivate&amp;plugin=$plugin_file", 'deactivate-plugin_' . $plugin_file) . "' title='".__('Deactivate this plugin')."' class='delete'>".__('Deactivate')."</a>"; 
    104104                        $plugin_data['Title'] = "<strong>{$plugin_data['Title']}</strong>"; 
    105105                        $style .= $style == 'alternate' ? ' active' : 'active'; 
    106106                } else { 
    107                         $action = "<a href='" . wp_nonce_url("plugins.php?action=activate&amp;plugin=$plugin_file", 'activate-plugin_' . $plugin_file) . "' title='".__('Activate this plugin')."' class='edit'>".__('Activate')."</a>"; 
     107                        $toggle = "<a href='" . wp_nonce_url("plugins.php?action=activate&amp;plugin=$plugin_file", 'activate-plugin_' . $plugin_file) . "' title='".__('Activate this plugin')."' class='edit'>".__('Activate')."</a>"; 
    108108                } 
    109109                $plugin_data['Description'] = wp_kses($plugin_data['Description'], array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()) ); ; 
    110                 if ($style != '') $style = 'class="' . $style . '"'; 
     110                if ( $style != '' ) 
     111                        $style = 'class="' . $style . '"'; 
     112                if ( current_user_can('edit_plugins') && is_writable(ABSPATH . 'wp-content/plugins/' . $plugin_file) ) 
     113                        $edit = "<a href='plugin-editor.php?file=$plugin_file' title='".__('Open this file in the Plugin Editor')."' class='edit'>".__('Edit')."</a>"; 
     114 
    111115                echo " 
    112116        <tr $style> 
    113117                <td class='name'>{$plugin_data['Title']}</td> 
    114118                <td class='vers'>{$plugin_data['Version']}</td> 
    115119                <td class='desc'>{$plugin_data['Description']} <cite>".sprintf(__('By %s'), $plugin_data['Author']).".</cite></td> 
    116                 <td class='togl'>$action</td> 
     120                <td class='togl'>$toggle</td> 
     121                <td>$edit</td> 
    117122        </tr>"; 
    118123        } 
    119124?>