Make WordPress Core

Changeset 2319


Ignore:
Timestamp:
02/14/2005 04:24:25 AM (22 years ago)
Author:
saxmatt
Message:

Friendlier file names in theme editor - http://mosquito.wordpress.org/view.php?id=598

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r2291 r2319  
    903903        global $wp_file_descriptions;
    904904
    905         if (isset($wp_file_descriptions[$file])) {
    906                 return $wp_file_descriptions[$file];
    907         }
    908 
    909         return $file;
     905        if ( isset($wp_file_descriptions[basename($file)] ) ) {
     906                return $wp_file_descriptions[basename($file)];
     907        } else {
     908                $template_data = implode('', file(ABSPATH . $file));
     909                if ( preg_match("|Template Name:(.*)|i", $template_data, $name) )
     910                        return $name[1];
     911        }
     912
     913        return basename( $file );
    910914}
    911915
  • trunk/wp-admin/theme-editor.php

    r2120 r2319  
    101101  <?php
    102102        if (is_writeable($real_file)) {
    103                 echo '<h2>' . sprintf(__('Editing <strong>%s</strong>'), $file) . '</h2>';
     103                echo '<h2>' . sprintf(__('Editing <code>%s</code>'), $file) . '</h2>';
    104104        } else {
    105                 echo '<h2>' . sprintf(__('Browsing <strong>%s</strong>'), $file) . '</h2>';
     105                echo '<h2>' . sprintf(__('Browsing <code>%s</code>'), $file) . '</h2>';
    106106        }
    107107        ?>
     
    114114  <ul>
    115115<?php foreach($allowed_files as $allowed_file) : ?>
    116                  <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>
     116                 <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>
    117117<?php endforeach; ?>
    118118  </ul>
Note: See TracChangeset for help on using the changeset viewer.