From df3a83a5fb3ee035a4180d61da4efd07f3ff6a8a Mon Sep 17 00:00:00 2001 From: saxmatt Date: Mon, 14 Feb 2005 04:24:25 +0000 Subject: [PATCH] Friendlier file names in theme editor - http://mosquito.wordpress.org/view.php?id=598 git-svn-id: http://svn.automattic.com/wordpress/trunk@2319 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 10 +++++++--- wp-admin/theme-editor.php | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 9fe57bd7e8..5c01e7a5d5 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -902,11 +902,15 @@ $wp_file_descriptions = function get_file_description($file) { global $wp_file_descriptions; - if (isset($wp_file_descriptions[$file])) { - return $wp_file_descriptions[$file]; + 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 $file; + return basename( $file ); } function update_recently_edited($file) { diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index f65d91af17..d89376d852 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -100,9 +100,9 @@ default:
' . sprintf(__('Editing %s'), $file) . ''; + echo '

' . sprintf(__('Editing %s'), $file) . '

'; } else { - echo '

' . sprintf(__('Browsing %s'), $file) . '

'; + echo '

' . sprintf(__('Browsing %s'), $file) . '

'; } ?>
@@ -113,7 +113,7 @@ if ($allowed_files) : ?>