2015-10-24 14:21:25 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Customize API: WP_Customize_Themes_Section class
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Customize
|
|
|
|
* @since 4.4.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Customize Themes Section class.
|
|
|
|
*
|
2016-11-04 13:18:26 -04:00
|
|
|
* A UI container for theme controls, which behaves like a backwards Panel.
|
2015-10-24 14:21:25 -04:00
|
|
|
*
|
|
|
|
* @since 4.2.0
|
|
|
|
*
|
|
|
|
* @see WP_Customize_Section
|
|
|
|
*/
|
|
|
|
class WP_Customize_Themes_Section extends WP_Customize_Section {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Customize section type.
|
|
|
|
*
|
|
|
|
* @since 4.2.0
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $type = 'themes';
|
|
|
|
|
|
|
|
/**
|
2016-11-04 13:18:26 -04:00
|
|
|
* Render the themes section, which behaves like a panel.
|
2015-10-24 14:21:25 -04:00
|
|
|
*
|
2016-11-04 13:18:26 -04:00
|
|
|
* @since 4.2.0
|
2015-10-24 14:21:25 -04:00
|
|
|
*/
|
2016-11-04 13:18:26 -04:00
|
|
|
protected function render() {
|
|
|
|
$classes = 'accordion-section control-section control-section-' . $this->type;
|
2015-10-24 14:21:25 -04:00
|
|
|
?>
|
2016-11-04 13:18:26 -04:00
|
|
|
<li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
|
|
|
|
<h3 class="accordion-section-title">
|
|
|
|
<?php
|
|
|
|
if ( $this->manager->is_theme_active() ) {
|
|
|
|
echo '<span class="customize-action">' . __( 'Active theme' ) . '</span> ' . $this->title;
|
2015-10-24 14:21:25 -04:00
|
|
|
} else {
|
2016-11-04 13:18:26 -04:00
|
|
|
echo '<span class="customize-action">' . __( 'Previewing theme' ) . '</span> ' . $this->title;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php if ( count( $this->controls ) > 0 ) : ?>
|
|
|
|
<button type="button" class="button change-theme" tabindex="0"><?php _ex( 'Change', 'theme' ); ?></button>
|
|
|
|
<?php endif; ?>
|
|
|
|
</h3>
|
|
|
|
<div class="customize-themes-panel control-panel-content themes-php">
|
|
|
|
<h3 class="accordion-section-title customize-section-title">
|
2017-09-11 01:23:48 -04:00
|
|
|
<button class="customize-section-back" tabindex="0" type="button"><span class="screen-reader-text"><?php _e( 'Back' ); ?></span></button>
|
2016-11-04 13:18:26 -04:00
|
|
|
<span class="customize-action"><?php _e( 'Customizing' ); ?></span>
|
|
|
|
<?php _e( 'Themes' ); ?>
|
|
|
|
<span class="title-count theme-count"><?php echo count( $this->controls ) + 1 /* Active theme */; ?></span>
|
|
|
|
</h3>
|
|
|
|
<h3 class="accordion-section-title customize-section-title">
|
2015-10-24 14:21:25 -04:00
|
|
|
<?php
|
2016-11-04 13:18:26 -04:00
|
|
|
if ( $this->manager->is_theme_active() ) {
|
|
|
|
echo '<span class="customize-action">' . __( 'Active theme' ) . '</span> ' . $this->title;
|
|
|
|
} else {
|
|
|
|
echo '<span class="customize-action">' . __( 'Previewing theme' ) . '</span> ' . $this->title;
|
2015-10-24 14:21:25 -04:00
|
|
|
}
|
|
|
|
?>
|
2016-11-04 13:18:26 -04:00
|
|
|
<button type="button" class="button customize-theme"><?php _e( 'Customize' ); ?></button>
|
|
|
|
</h3>
|
|
|
|
|
2015-10-24 14:21:25 -04:00
|
|
|
<div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div>
|
2016-11-04 13:18:26 -04:00
|
|
|
|
|
|
|
<div id="customize-container"></div>
|
|
|
|
<?php if ( count( $this->controls ) > 4 ) : ?>
|
|
|
|
<p><label for="themes-filter">
|
|
|
|
<span class="screen-reader-text"><?php _e( 'Search installed themes…' ); ?></span>
|
|
|
|
<input type="text" id="themes-filter" placeholder="<?php esc_attr_e( 'Search installed themes…' ); ?>" />
|
|
|
|
</label></p>
|
|
|
|
<?php endif; ?>
|
2015-10-24 14:21:25 -04:00
|
|
|
<div class="theme-browser rendered">
|
2016-11-04 13:18:26 -04:00
|
|
|
<ul class="themes accordion-section-content">
|
2015-10-24 14:21:25 -04:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<?php }
|
|
|
|
}
|