web/wp-admin/themes.php
branchwordpress
changeset 132 4d4862461b8d
parent 109 03b0d1493584
equal deleted inserted replaced
131:a4642baaf829 132:4d4862461b8d
   125 
   125 
   126 ?>
   126 ?>
   127 
   127 
   128 <div class="wrap">
   128 <div class="wrap">
   129 <?php screen_icon(); ?>
   129 <?php screen_icon(); ?>
   130 <h2><?php echo esc_html( $title ); ?></h2>
   130 <h2><?php echo esc_html( $title ); ?> <a href="theme-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a></h2>
   131 
   131 
   132 <h3><?php _e('Current Theme'); ?></h3>
   132 <h3><?php _e('Current Theme'); ?></h3>
   133 <div id="current-theme">
   133 <div id="current-theme">
   134 <?php if ( $ct->screenshot ) : ?>
   134 <?php if ( $ct->screenshot ) : ?>
   135 <img src="<?php echo content_url($ct->stylesheet_dir . '/' . $ct->screenshot); ?>" alt="<?php _e('Current theme preview'); ?>" />
   135 <img src="<?php echo $ct->theme_root_uri . '/' . $ct->stylesheet . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" />
   136 <?php endif; ?>
   136 <?php endif; ?>
   137 <h4><?php
   137 <h4><?php
   138 	/* translators: 1: theme title, 2: theme version, 3: theme author */
   138 	/* translators: 1: theme title, 2: theme version, 3: theme author */
   139 	printf(__('%1$s %2$s by %3$s'), $ct->title, $ct->version, $ct->author) ; ?></h4>
   139 	printf(__('%1$s %2$s by %3$s'), $ct->title, $ct->version, $ct->author) ; ?></h4>
   140 <p class="theme-description"><?php echo $ct->description; ?></p>
   140 <p class="theme-description"><?php echo $ct->description; ?></p>
   141 <?php if ($ct->parent_theme) { ?>
   141 <?php if ($ct->parent_theme) { ?>
   142 	<p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir, $ct->title, $ct->parent_theme); ?></p>
   142 	<p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ), $ct->title, $ct->parent_theme); ?></p>
   143 <?php } else { ?>
   143 <?php } else { ?>
   144 	<p><?php printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir); ?></p>
   144 	<p><?php printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ) ); ?></p>
   145 <?php } ?>
   145 <?php } ?>
   146 <?php if ( $ct->tags ) : ?>
   146 <?php if ( $ct->tags ) : ?>
   147 <p><?php _e('Tags:'); ?> <?php echo join(', ', $ct->tags); ?></p>
   147 <p><?php _e('Tags:'); ?> <?php echo join(', ', $ct->tags); ?></p>
   148 <?php endif; ?>
   148 <?php endif; ?>
   149 <?php theme_update_available($ct); ?>
   149 <?php theme_update_available($ct); ?>
   201 	$author = $themes[$theme_name]['Author'];
   201 	$author = $themes[$theme_name]['Author'];
   202 	$screenshot = $themes[$theme_name]['Screenshot'];
   202 	$screenshot = $themes[$theme_name]['Screenshot'];
   203 	$stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
   203 	$stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
   204 	$template_dir = $themes[$theme_name]['Template Dir'];
   204 	$template_dir = $themes[$theme_name]['Template Dir'];
   205 	$parent_theme = $themes[$theme_name]['Parent Theme'];
   205 	$parent_theme = $themes[$theme_name]['Parent Theme'];
       
   206 	$theme_root = $themes[$theme_name]['Theme Root'];
       
   207 	$theme_root_uri = $themes[$theme_name]['Theme Root URI'];
   206 	$preview_link = esc_url(get_option('home') . '/');
   208 	$preview_link = esc_url(get_option('home') . '/');
   207 	if ( is_ssl() )
   209 	if ( is_ssl() )
   208 		$preview_link = str_replace( 'http://', 'https://', $preview_link );
   210 		$preview_link = str_replace( 'http://', 'https://', $preview_link );
   209 	$preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), $preview_link ) );
   211 	$preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), $preview_link ) );
   210 	$preview_text = esc_attr( sprintf( __('Preview of &#8220;%s&#8221;'), $title ) );
   212 	$preview_text = esc_attr( sprintf( __('Preview of &#8220;%s&#8221;'), $title ) );
   221 
   223 
   222 	$actions = implode ( ' | ', $actions );
   224 	$actions = implode ( ' | ', $actions );
   223 ?>
   225 ?>
   224 		<a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
   226 		<a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
   225 <?php if ( $screenshot ) : ?>
   227 <?php if ( $screenshot ) : ?>
   226 			<img src="<?php echo content_url($stylesheet_dir . '/' . $screenshot); ?>" alt="" />
   228 			<img src="<?php echo $theme_root_uri . '/' . $stylesheet . '/' . $screenshot; ?>" alt="" />
   227 <?php endif; ?>
   229 <?php endif; ?>
   228 		</a>
   230 		</a>
   229 <h3><?php
   231 <h3><?php
   230 	/* translators: 1: theme title, 2: theme version, 3: theme author */
   232 	/* translators: 1: theme title, 2: theme version, 3: theme author */
   231 	printf(__('%1$s %2$s by %3$s'), $title, $version, $author) ; ?></h3>
   233 	printf(__('%1$s %2$s by %3$s'), $title, $version, $author) ; ?></h3>
   232 <p class="description"><?php echo $description; ?></p>
   234 <p class="description"><?php echo $description; ?></p>
   233 <span class='action-links'><?php echo $actions ?></span>
   235 <span class='action-links'><?php echo $actions ?></span>
   234 	<?php if ($parent_theme) {
   236 	<?php if ($parent_theme) {
   235 	/* translators: 1: theme title, 2:  template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?>
   237 	/* translators: 1: theme title, 2:  template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?>
   236 	<p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $title, $template_dir, $stylesheet_dir, $title, $parent_theme); ?></p>
   238 	<p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ), $title, $parent_theme); ?></p>
   237 <?php } else { ?>
   239 <?php } else { ?>
   238 	<p><?php printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $title, $template_dir, $stylesheet_dir); ?></p>
   240 	<p><?php printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ) ); ?></p>
   239 <?php } ?>
   241 <?php } ?>
   240 <?php if ( $tags ) : ?>
   242 <?php if ( $tags ) : ?>
   241 <p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p>
   243 <p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p>
   242 <?php endif; ?>
   244 <?php endif; ?>
   243 		<?php theme_update_available( $themes[$theme_name] ); ?>
   245 		<?php theme_update_available( $themes[$theme_name] ); ?>
   268 ?>
   270 ?>
   269 
   271 
   270 <h2><?php _e('Broken Themes'); ?></h2>
   272 <h2><?php _e('Broken Themes'); ?></h2>
   271 <p><?php _e('The following themes are installed but incomplete.  Themes must have a stylesheet and a template.'); ?></p>
   273 <p><?php _e('The following themes are installed but incomplete.  Themes must have a stylesheet and a template.'); ?></p>
   272 
   274 
   273 <table width="100%" cellpadding="3" cellspacing="3">
   275 <table id="broken-themes">
   274 	<tr>
   276 	<tr>
   275 		<th><?php _e('Name'); ?></th>
   277 		<th><?php _e('Name'); ?></th>
   276 		<th><?php _e('Description'); ?></th>
   278 		<th><?php _e('Description'); ?></th>
   277 	</tr>
   279 	</tr>
   278 <?php
   280 <?php