Ticket #1657: 1657.diff

File 1657.diff, 2.3 KB (added by davidhouse, 6 years ago)
  • wp-admin/plugins.php

     
    8383                <th><?php _e('Plugin'); ?></th> 
    8484                <th><?php _e('Version'); ?></th> 
    8585                <th><?php _e('Description'); ?></th> 
    86                 <th><?php _e('Action'); ?></th> 
     86                <th colspan="2"><?php _e('Action'); ?></th> 
    8787        </tr> 
    8888<?php 
    8989        $style = ''; 
     
    9898                $style = ('class="alternate"' == $style|| 'class="alternate active"' == $style) ? '' : 'alternate'; 
    9999 
    100100                if (!empty($current_plugins) && in_array($plugin_file, $current_plugins)) { 
    101                         $action = "<a href='plugins.php?action=deactivate&amp;plugin=$plugin_file' title='".__('Deactivate this plugin')."' class='delete'>".__('Deactivate')."</a>"; 
     101                        $toggle = "<a href='plugins.php?action=deactivate&amp;plugin=$plugin_file' title='".__('Deactivate this plugin')."' class='delete'>".__('Deactivate')."</a>"; 
    102102                        $plugin_data['Title'] = "<strong>{$plugin_data['Title']}</strong>"; 
    103103                        $style .= $style == 'alternate' ? ' active' : 'active'; 
    104104                } else { 
    105                         $action = "<a href='plugins.php?action=activate&amp;plugin=$plugin_file' title='".__('Activate this plugin')."' class='edit'>".__('Activate')."</a>"; 
     105                        $toggle = "<a href='plugins.php?action=activate&amp;plugin=$plugin_file' title='".__('Activate this plugin')."' class='edit'>".__('Activate')."</a>"; 
    106106                } 
    107107                $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()) ); ; 
    108108                if ($style != '') $style = 'class="' . $style . '"'; 
     109                if (current_user_can('edit_plugins') && is_writable(ABSPATH . 'wp-content/plugins/' . $plugin_file)) { 
     110                        $edit = "<a href='plugin-editor.php?file=$plugin_file' title='".__('Open this file in the Plugin Editor')."' class='edit'>".__('Edit')."</a>"; 
     111                } 
    109112                echo " 
    110113        <tr $style> 
    111114                <td class='name'>{$plugin_data['Title']}</td> 
    112115                <td class='vers'>{$plugin_data['Version']}</td> 
    113116                <td class='desc'>{$plugin_data['Description']} <cite>".sprintf(__('By %s'), $plugin_data['Author']).".</cite></td> 
    114                 <td class='togl'>$action</td> 
     117                <td class='togl'>$toggle</td> 
     118                <td>$edit</td> 
    115119        </tr>"; 
    116120        } 
    117121?>