[wp-cvs] wordpress/wp-admin admin-functions.php, 1.81, 1.82 theme-editor.php, 1.10, 1.11

Matthew Mullenweg saxmatt at users.sourceforge.net
Mon Feb 14 04:24:27 GMT 2005


Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3481/wp-admin

Modified Files:
	admin-functions.php theme-editor.php 
Log Message:
Friendlier file names in theme editor - http://mosquito.wordpress.org/view.php?id=598

Index: admin-functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/admin-functions.php,v
retrieving revision 1.81
retrieving revision 1.82
diff -C2 -d -r1.81 -r1.82
*** admin-functions.php	12 Feb 2005 09:32:00 -0000	1.81
--- admin-functions.php	14 Feb 2005 04:24:25 -0000	1.82
***************
*** 903,911 ****
  	global $wp_file_descriptions;
  
! 	if (isset($wp_file_descriptions[$file])) {
! 		return $wp_file_descriptions[$file];
  	}
  
! 	return $file;
  }
  
--- 903,915 ----
  	global $wp_file_descriptions;
  
! 	if ( isset($wp_file_descriptions[basename($file)] ) ) {
! 		return $wp_file_descriptions[basename($file)];
! 	} else {
! 		$template_data = implode('', file(ABSPATH . $file));
! 		if ( preg_match("|Template Name:(.*)|i", $template_data, $name) )
! 			return $name[1];
  	}
  
! 	return basename( $file );
  }
  

Index: theme-editor.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/theme-editor.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** theme-editor.php	23 Jan 2005 23:00:15 -0000	1.10
--- theme-editor.php	14 Feb 2005 04:24:25 -0000	1.11
***************
*** 101,107 ****
    <?php
  	if (is_writeable($real_file)) {
! 		echo '<h2>' . sprintf(__('Editing <strong>%s</strong>'), $file) . '</h2>';
  	} else {
! 		echo '<h2>' . sprintf(__('Browsing <strong>%s</strong>'), $file) . '</h2>';
  	}
  	?>
--- 101,107 ----
    <?php
  	if (is_writeable($real_file)) {
! 		echo '<h2>' . sprintf(__('Editing <code>%s</code>'), $file) . '</h2>';
  	} else {
! 		echo '<h2>' . sprintf(__('Browsing <code>%s</code>'), $file) . '</h2>';
  	}
  	?>
***************
*** 114,118 ****
    <ul>
  <?php foreach($allowed_files as $allowed_file) : ?>
! 		 <li><a href="theme-editor.php?file=<?php echo "$allowed_file"; ?>&amp;theme=<?php echo urlencode($theme) ?>"><?php echo get_file_description(basename($allowed_file)); ?></a></li>
  <?php endforeach; ?>
    </ul>
--- 114,118 ----
    <ul>
  <?php foreach($allowed_files as $allowed_file) : ?>
! 		 <li><a href="theme-editor.php?file=<?php echo "$allowed_file"; ?>&amp;theme=<?php echo urlencode($theme) ?>"><?php echo get_file_description($allowed_file); ?></a></li>
  <?php endforeach; ?>
    </ul>



More information about the cvs mailing list