Changeset 11788 for trunk/wp-admin/theme-editor.php
- Timestamp:
- 08/08/2009 07:22:19 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/theme-editor.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/theme-editor.php
r11647 r11788 10 10 require_once('admin.php'); 11 11 12 if ( !current_user_can('edit_themes') ) 13 wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>'); 14 12 15 $title = __("Edit Themes"); 13 16 $parent_file = 'themes.php'; … … 37 40 $file = validate_file_to_edit($file, $allowed_files); 38 41 $real_file = get_real_file_to_edit($file); 42 $scrollto = isset($_REQUEST['scrollto']) ? (int) $_REQUEST['scrollto'] : 0; 39 43 40 44 $file_show = basename( $file ); … … 45 49 46 50 check_admin_referer('edit-theme_' . $file . $theme); 47 48 if ( !current_user_can('edit_themes') )49 wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');50 51 51 52 $newcontent = stripslashes($_POST['newcontent']); … … 57 58 fwrite($f, $newcontent); 58 59 fclose($f); 59 $location = "theme-editor.php?file=$file&theme=$theme&a=te ";60 $location = "theme-editor.php?file=$file&theme=$theme&a=te&scrollto=$scrollto"; 60 61 } else { 61 $location = "theme-editor.php?file=$file&theme=$theme ";62 $location = "theme-editor.php?file=$file&theme=$theme&scrollto=$scrollto"; 62 63 } 63 64 } else { 64 $location = "theme-editor.php?file=$file&theme=$theme ";65 $location = "theme-editor.php?file=$file&theme=$theme&scrollto=$scrollto"; 65 66 } 66 67 … … 74 75 75 76 default: 76 77 if ( !current_user_can('edit_themes') )78 wp_die('<p>'.__('You do not have sufficient permissions to edit themes for this blog.').'</p>');79 77 80 78 if ( use_codepress() ) … … 202 200 <input type="hidden" name="file" value="<?php echo esc_attr($file) ?>" /> 203 201 <input type="hidden" name="theme" value="<?php echo esc_attr($theme) ?>" /> 202 <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" /> 204 203 </div> 205 204 <?php if ( isset($functions ) && count($functions) ) { ?> … … 230 229 <br class="clear" /> 231 230 </div> 231 <script type="text/javascript"> 232 /* <![CDATA[ */ 233 jQuery(document).ready(function($){ 234 $('#template').submit(function(){ $('#scrollto').val( $('#newcontent').scrollTop() ); }); 235 $('#newcontent').scrollTop( $('#scrollto').val() ); 236 }); 237 /* ]]> */ 238 </script> 232 239 <?php 233 240 break;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)