- $file_description = get_file_description( $absolute_filename );
- if ( $file_description != basename( $filename ) )
+ if ( $file_type !== $previous_file_type ) {
+ if ( '' !== $previous_file_type ) {
+ echo "\t</ul>\n";
+ }
+
+ switch ( $file_type ) {
+ case '.php':
+ if ( $has_templates || $theme->parent() ) :
+ echo "\t<h2>" . __( 'Templates' ) . "</h2>\n";
+ if ( $theme->parent() ) {
+ echo '<p class="howto">' . sprintf( __( 'This child theme inherits templates from a parent theme, %s.' ),
+ sprintf( '<a href="%s">%s</a>',
+ self_admin_url( 'theme-editor.php?theme=' . urlencode( $theme->get_template() ) ),
+ $theme->parent()->display( 'Name' )
+ )
+ ) . "</p>\n";
+ }
+ endif;
+ break;
+ case '.css':
+ echo "\t<h2>" . _x( 'Styles', 'Theme stylesheets in theme editor' ) . "</h2>\n";
+ break;
+ default:
+ /* translators: %s: file extension */
+ echo "\t<h2>" . sprintf( __( '%s files' ), $file_type ) . "</h2>\n";
+ break;
+ }
+
+ echo "\t<ul>\n";
+ }
+
+ $file_description = get_file_description( $filename );
+ if ( $filename !== basename( $absolute_filename ) || $file_description !== $filename ) {