Changes from trunk/wp-admin/plugin-editor.php at r11530 to branches/2.8/wp-admin/plugin-editor.php at r11673
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.8/wp-admin/plugin-editor.php
r11530 r11673 84 84 } 85 85 86 if ( use_codepress() )87 wp_enqueue_script( 'codepress' );88 89 86 // List of allowable extensions 90 87 $editable_extensions = array('php', 'txt', 'text', 'js', 'css', 'html', 'htm', 'xml', 'inc', 'include'); … … 112 109 $functions = wp_doc_link_parse( $content ); 113 110 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>'; 118 118 } 119 $docs_select .= '</select>';120 119 } 121 120 … … 137 136 <?php screen_icon(); ?> 138 137 <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"> 160 140 <div class="alignleft"> 161 141 <big><?php … … 173 153 ?></big> 174 154 </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> 175 175 <br class="clear" /> 176 176 </div> 177 <br class="clear" /> 178 179 <h3 id="bordertitle"><?php _e('Plugin Files'); ?></h3>177 178 <div id="templateside"> 179 <h3><?php _e('Plugin Files'); ?></h3> 180 180 181 181 <ul> … … 196 196 <?php endforeach; ?> 197 197 </ul> 198 199 198 </div> 199 <form name="template" id="template" action="plugin-editor.php" method="post"> 200 200 <?php wp_nonce_field('edit-plugin_' . $file) ?> 201 201 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea> … … 204 204 <input type="hidden" name="plugin" value="<?php echo esc_attr($plugin) ?>" /> 205 205 </div> 206 <?php if ( isset( $functions) ) : ?>206 <?php if ( !empty( $docs_select ) ) : ?> 207 207 <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() ) + '&locale=<?php echo urlencode( get_locale() ) ?>&version=<?php echo urlencode( $wp_version ) ?>&redirect=true'); }" /></div> 208 208 <?php endif; ?> … … 222 222 <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> 223 223 <?php endif; ?> 224 225 < div class="clear"> </div>224 </form> 225 <br class="clear" /> 226 226 </div> 227 227 <?php 228 228 break; 229 229 } 230 include("admin-footer.php") ?>230 include("admin-footer.php");
Note: See TracChangeset
for help on using the changeset viewer.