Make WordPress Core

Changeset 4313


Ignore:
Timestamp:
10/04/2006 06:48:52 AM (17 years ago)
Author:
markjaquith
Message:

edit link next to each plugin. Props David House. fixes #1657

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugins.php

    r4258 r4313  
    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"<?php if ( current_user_can('edit_plugins') ) echo ' colspan="2"'; ?>><?php _e('Action'); ?></th>
    8888    </tr>
    8989    </thead>
     
    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 ( 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        else
     115            $edit = '';
     116
    111117        echo "
    112118    <tr $style>
     
    114120        <td class='vers'>{$plugin_data['Version']}</td>
    115121        <td class='desc'>{$plugin_data['Description']} <cite>".sprintf(__('By %s'), $plugin_data['Author']).".</cite></td>
    116         <td class='togl'>$action</td>
     122        <td class='togl'>$toggle</td>";
     123        if ( current_user_can('edit_plugins') )
     124        echo "
     125        <td>$edit</td>";
     126        echo"
    117127    </tr>";
    118128    }
Note: See TracChangeset for help on using the changeset viewer.