Changes in trunk/wp-admin/plugin-editor.php [15132:17183]
- File:
-
- 1 edited
-
trunk/wp-admin/plugin-editor.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/plugin-editor.php
r15132 r17183 10 10 require_once('./admin.php'); 11 11 12 if ( is_multisite() && ! is_network_admin() ) { 13 wp_redirect( network_admin_url( 'plugin-editor.php' ) ); 14 exit(); 15 } 16 12 17 if ( !current_user_can('edit_plugins') ) 13 18 wp_die( __('You do not have sufficient permissions to edit plugins for this site.') ); … … 68 73 exit; 69 74 } 70 wp_redirect( "plugin-editor.php?file=$file&a=te&scrollto=$scrollto");71 } else { 72 wp_redirect( "plugin-editor.php?file=$file&scrollto=$scrollto");75 wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") ); 76 } else { 77 wp_redirect( self_admin_url("plugin-editor.php?file=$file&scrollto=$scrollto") ); 73 78 } 74 79 exit; … … 85 90 wp_die( $error ); 86 91 87 if ( ! is_plugin_active($file) )92 if ( ( ! empty( $_GET['networkwide'] ) && ! is_plugin_active_for_network($file) ) || ! is_plugin_active($file) ) 88 93 activate_plugin($file, "plugin-editor.php?file=$file&phperror=1", ! empty( $_GET['networkwide'] ) ); // we'll override this later if the plugin can be included without fatal error 89 94 90 wp_redirect( "plugin-editor.php?file=$file&a=te&scrollto=$scrollto");95 wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") ); 91 96 exit; 92 97 } … … 112 117 '<p>' . __('Choose a plugin to edit from the menu in the upper right and click the Select button. Click once on any file name to load it in the editor, and make your changes. Don’t forget to save your changes (Update File) when you’re finished.') . '</p>' . 113 118 '<p>' . __('The Documentation menu below the editor lists the PHP functions recognized in the plugin file. Clicking Lookup takes you to a web page about that particular function.') . '</p>' . 114 '<p>' . __('If you want to make changes but don’t want them to be overwritten when the plugin is updated, you may be ready to think about writing your own plugin. For information on how to edit a plugin or start from scratch, check out the links below.') . '</p>' . 119 '<p>' . __('If you want to make changes but don’t want them to be overwritten when the plugin is updated, you may be ready to think about writing your own plugin. For information on how to edit plugins, write your own from scratch, or just better understand their anatomy, check out the links below.') . '</p>' . 120 ( is_network_admin() ? '<p>' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '</p>' : '' ) . 115 121 '<p><strong>' . __('For more information:') . '</strong></p>' . 116 122 '<p>' . __('<a href="http://codex.wordpress.org/Plugins_Editor_SubPanel" target="_blank">Documentation on Editing Plugins</a>') . '</p>' . 123 '<p>' . __('<a href="http://codex.wordpress.org/Writing_a_Plugin" target="_blank">Documentation on Writing Plugins</a>') . '</p>' . 117 124 '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' 118 125 ); 119 126 120 require_once( './admin-header.php');127 require_once(ABSPATH . 'wp-admin/admin-header.php'); 121 128 122 129 update_recently_edited(WP_PLUGIN_DIR . '/' . $file); … … 137 144 } 138 145 139 $content = htmlspecialchars( $content );146 $content = esc_textarea( $content ); 140 147 ?> 141 148 <?php if (isset($_GET['a'])) : ?> … … 186 193 ?> 187 194 </select> 188 < input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" />195 <?php submit_button( __( 'Select' ), 'button', 'Submit', false ); ?> 189 196 </form> 190 197 </div> … … 230 237 <p class="submit"> 231 238 <?php 232 if ( isset($_GET['phperror']) ) 233 echo "<input type='hidden' name='phperror' value='1' /><input type='submit' name='submit' class='button-primary' value='" . esc_attr__('Update File and Attempt to Reactivate') . "' tabindex='2' />"; 234 else 235 echo "<input type='submit' name='submit' class='button-primary' value='" . esc_attr__('Update File') . "' tabindex='2' />"; 239 if ( isset($_GET['phperror']) ) { 240 echo "<input type='hidden' name='phperror' value='1' />"; 241 submit_button( __( 'Update File and Attempt to Reactivate' ), 'primary', 'submit', false, array( 'tabindex' => '2' ) ); 242 } else { 243 submit_button( __( 'Update File' ), 'primary', 'submit', false, array( 'tabindex' => '2' ) ); 244 } 236 245 ?> 237 246 </p> … … 253 262 break; 254 263 } 255 include( "./admin-footer.php");264 include(ABSPATH . "wp-admin/admin-footer.php");
Note: See TracChangeset
for help on using the changeset viewer.