Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.8/wp-admin/plugin-editor.php

    r11530 r11673  
    8484    }
    8585
    86     if ( use_codepress() )
    87         wp_enqueue_script( 'codepress' );
    88 
    8986    // List of allowable extensions
    9087    $editable_extensions = array('php', 'txt', 'text', 'js', 'css', 'html', 'htm', 'xml', 'inc', 'include');
     
    112109        $functions = wp_doc_link_parse( $content );
    113110
    114         $docs_select = '<select name="docs-list" id="docs-list">';
    115         $docs_select .= '<option value="">' . __( 'Function Name...' ) . '</option>';
    116         foreach ( $functions as $function) {
    117             $docs_select .= '<option value="' . esc_attr( $function ) . '">' . htmlspecialchars( $function ) . '()</option>';
     111        if ( !empty($functions) ) {
     112            $docs_select = '<select name="docs-list" id="docs-list">';
     113            $docs_select .= '<option value="">' . __( 'Function Name...' ) . '</option>';
     114            foreach ( $functions as $function) {
     115                $docs_select .= '<option value="' . esc_attr( $function ) . '">' . htmlspecialchars( $function ) . '()</option>';
     116            }
     117            $docs_select .= '</select>';
    118118        }
    119         $docs_select .= '</select>';
    120119    }
    121120
     
    137136<?php screen_icon(); ?>
    138137<h2><?php echo esc_html( $title ); ?></h2>
    139 <div class="bordertitle">
    140     <form id="themeselector" action="plugin-editor.php" method="post">
    141         <strong><label for="plugin"><?php _e('Select plugin to edit:'); ?> </label></strong>
    142         <select name="plugin" id="plugin">
    143 <?php
    144     foreach ( $plugins as $plugin_key => $a_plugin ) {
    145         $plugin_name = $a_plugin['Name'];
    146         if ( $plugin_key == $plugin )
    147             $selected = " selected='selected'";
    148         else
    149             $selected = '';
    150         $plugin_name = esc_attr($plugin_name);
    151         $plugin_key = esc_attr($plugin_key);
    152         echo "\n\t<option value=\"$plugin_key\" $selected>$plugin_name</option>";
    153     }
    154 ?>
    155         </select>
    156         <input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" />
    157     </form>
    158 </div>
    159 <div class="tablenav">
     138
     139<div class="fileedit-sub">
    160140<div class="alignleft">
    161141<big><?php
     
    173153    ?></big>
    174154</div>
     155<div class="alignright">
     156    <form action="plugin-editor.php" method="post">
     157        <strong><label for="plugin"><?php _e('Select plugin to edit:'); ?> </label></strong>
     158        <select name="plugin" id="plugin">
     159<?php
     160    foreach ( $plugins as $plugin_key => $a_plugin ) {
     161        $plugin_name = $a_plugin['Name'];
     162        if ( $plugin_key == $plugin )
     163            $selected = " selected='selected'";
     164        else
     165            $selected = '';
     166        $plugin_name = esc_attr($plugin_name);
     167        $plugin_key = esc_attr($plugin_key);
     168        echo "\n\t<option value=\"$plugin_key\" $selected>$plugin_name</option>";
     169    }
     170?>
     171        </select>
     172        <input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" />
     173    </form>
     174</div>
    175175<br class="clear" />
    176176</div>
    177 <br class="clear" />
    178     <div id="templateside">
    179     <h3 id="bordertitle"><?php _e('Plugin Files'); ?></h3>
     177
     178<div id="templateside">
     179    <h3><?php _e('Plugin Files'); ?></h3>
    180180
    181181    <ul>
     
    196196<?php endforeach; ?>
    197197    </ul>
    198     </div>
    199     <form name="template" id="template" action="plugin-editor.php" method="post">
     198</div>
     199<form name="template" id="template" action="plugin-editor.php" method="post">
    200200    <?php wp_nonce_field('edit-plugin_' . $file) ?>
    201201        <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea>
     
    204204        <input type="hidden" name="plugin" value="<?php echo esc_attr($plugin) ?>" />
    205205        </div>
    206         <?php if ( isset( $functions ) ) : ?>
     206        <?php if ( !empty( $docs_select ) ) : ?>
    207207        <div id="documentation"><label for="docs-list"><?php _e('Documentation:') ?></label> <?php echo $docs_select ?> <input type="button" class="button" value="<?php esc_attr_e( 'Lookup' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_locale() ) ?>&amp;version=<?php echo urlencode( $wp_version ) ?>&amp;redirect=true'); }" /></div>
    208208        <?php endif; ?>
     
    222222    <p><em><?php _e('You need to make this file writable before you can save your changes. See <a href="http://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.'); ?></em></p>
    223223<?php endif; ?>
    224  </form>
    225 <div class="clear"> &nbsp; </div>
     224</form>
     225<br class="clear" />
    226226</div>
    227227<?php
    228228    break;
    229229}
    230 include("admin-footer.php") ?>
     230include("admin-footer.php");
Note: See TracChangeset for help on using the changeset viewer.