Don't even show parent theme files when viewing the child theme. see #15672.

git-svn-id: https://develop.svn.wordpress.org/trunk@16714 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-12-04 03:52:59 +00:00
parent a01db8b692
commit c8fc17767f
4 changed files with 29 additions and 12 deletions

View File

@ -1 +1 @@
#template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}#templateside ul li a span.highlight{display:block;}.nonessential{font-size:11px;font-style:italic;padding-left:12px;}.highlight{padding:3px 3px 3px 12px;margin-left:-12px;font-weight:bold;-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;}
h3 span{font-weight:normal;}#template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}#templateside ul li a span.highlight{display:block;}.nonessential{font-size:11px;font-style:italic;padding-left:12px;}.highlight{padding:3px 3px 3px 12px;margin-left:-12px;font-weight:bold;-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;}

View File

@ -1,3 +1,7 @@
h3 span {
font-weight: normal;
}
#template textarea {
font-family: Consolas, Monaco, Courier, monospace;
font-size: 12px;

View File

@ -125,7 +125,9 @@ default:
<?php endif;
$description = get_file_description($file);
$desc_header = ( $description != $file_show ) ? "<strong>$description</strong> (%s)" : "%s";
$desc_header = ( $description != $file_show ) ? "$description <span>(%s)</span>" : "<span>%s</span>";
$is_child_theme = $themes[$theme]['Template'] != $themes[$theme]['Stylesheet'];
?>
<div class="wrap">
<?php screen_icon(); ?>
@ -133,7 +135,12 @@ $desc_header = ( $description != $file_show ) ? "<strong>$description</strong> (
<div class="fileedit-sub">
<div class="alignleft">
<big><?php echo sprintf($desc_header, $file_show); ?></big>
<h3><?php
if ( $is_child_theme && strpos( $file, $themes[$theme]['Template Dir'] ) === 0 )
echo $themes[$theme]['Parent Theme'] . ': ';
else
echo $themes[$theme]['Name'] . ': ';
printf( $desc_header, $file_show ); ?></h3>
</div>
<div class="alignright">
<form action="theme-editor.php" method="post">
@ -155,16 +162,22 @@ $desc_header = ( $description != $file_show ) ? "<strong>$description</strong> (
<br class="clear" />
</div>
<div id="templateside">
<?php
if ($allowed_files) :
?>
<h3><?php _e('Templates'); ?></h3>
<?php if ( $is_child_theme ) : ?>
<p class="howto"><?php printf( __( 'This child theme inherits templates from a parent theme, %s.' ), $themes[$theme]['Parent Theme'] ); ?></p>
<?php endif; ?>
<ul>
<?php
$template_mapping = array();
$template_dir = $themes[$theme]['Template Dir'];
foreach ( $themes[$theme]['Template Files'] as $template_file ) {
// Don't show parent templates.
if ( $is_child_theme && strpos( $template_file, $themes[$theme]['Template Dir'] ) === 0 )
continue;
$description = trim( get_file_description($template_file) );
$template_show = basename($template_file);
$filedesc = ( $description != $template_file ) ? "$description<br /><span class='nonessential'>($template_show)</span>" : "$description";
@ -192,6 +205,10 @@ if ($allowed_files) :
$template_mapping = array();
$stylesheet_dir = $themes[$theme]['Stylesheet Dir'];
foreach ( $themes[$theme]['Stylesheet Files'] as $style_file ) {
// Don't show parent styles.
if ( $is_child_theme && strpos( $style_file, $themes[$theme]['Template Dir'] ) === 0 )
continue;
$description = trim( get_file_description($style_file) );
$style_show = basename($style_file);
$filedesc = ( $description != $style_file ) ? "$description<br /><span class='nonessential'>($style_show)</span>" : "$description";
@ -224,13 +241,9 @@ if ($allowed_files) :
<?php } ?>
<div>
<?php if ( is_child_theme() ) :
if ( strpos( $file, $themes[$theme]['Template Dir'] ) === 0 ) { ?>
<?php if ( is_child_theme() && ! $is_child_theme && $themes[$theme]['Template'] == get_option('template') ) : ?>
<p><?php if ( is_writeable( $file ) ) { ?><strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
<?php printf( __( 'This is a file in your parent theme, &#8220;%s.&#8221;' ), $themes[$theme]['Parent Theme'] ); ?></p>
<?php } else { ?>
<p><?php printf( __( 'This is a file in your child theme, &#8220;%s.&#8221;' ), $themes[$theme]['Name'] ); ?></p>
<?php } ?>
<?php _e( 'This is a file in your current parent theme.' ); ?></p>
<?php endif; ?>
<?php
if ( is_writeable( $file ) ) :

View File

@ -506,7 +506,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'widgets', "/wp-admin/css/widgets$suffix.css", array(), '20100610' );
$styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css", array(), '20101020' );
$styles->add( 'install', "/wp-admin/css/install$suffix.css", array(), '20101020' ); // Readme as well
$styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20100514' );
$styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20101203' );
$styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20101020' );
$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' );
$styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20101020' );