+ <h1><?php
+ echo esc_html( $title );
+
+ /**
+ * Filters the tabs shown on the Add Themes screen.
+ *
+ * This filter is for backward compatibility only, for the suppression of the upload tab.
+ *
+ * @since 2.8.0
+ *
+ * @param array $tabs The tabs shown on the Add Themes screen. Default is 'upload'.
+ */
+ $tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
+ if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {
+ echo ' <button type="button" class="upload-view-toggle page-title-action hide-if-no-js" aria-expanded="false">' . __( 'Upload Theme' ) . '</button>';
+ }
+ ?></h1>
+ <div class="error hide-if-js">
+ <p><?php _e( 'The Theme Installer screen requires JavaScript.' ); ?></p>
+ </div>
+
+ <div class="upload-theme">
+ <?php install_themes_upload(); ?>
+ </div>
+
+ <h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Filter themes list' ); ?></h2>
+
+ <div class="wp-filter hide-if-no-js">
+ <div class="filter-count">
+ <span class="count theme-count"></span>
+ </div>
+
+ <ul class="filter-links">
+ <li><a href="#" data-sort="featured"><?php _ex( 'Featured', 'themes' ); ?></a></li>
+ <li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
+ <li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
+ <li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li>
+ </ul>
+
+ <button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button>
+
+ <div class="search-form"></div>
+
+ <div class="favorites-form">
+ <?php
+ $action = 'save_wporg_username_' . get_current_user_id();
+ if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) {
+ $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
+ update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
+ } else {
+ $user = get_user_option( 'wporg_favorites' );
+ }
+ ?>
+ <p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p>
+
+ <p>
+ <label for="wporg-username-input"><?php _e( 'Your WordPress.org username:' ); ?></label>
+ <input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" />
+ <input type="search" id="wporg-username-input" value="<?php echo esc_attr( $user ); ?>" />
+ <input type="button" class="button favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" />
+ </p>
+ </div>
+
+ <div class="filter-drawer">
+ <div class="buttons">
+ <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
+ <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
+ </div>
+ <?php
+ $feature_list = get_theme_feature_list();
+ foreach ( $feature_list as $feature_name => $features ) {
+ echo '<fieldset class="filter-group">';
+ $feature_name = esc_html( $feature_name );
+ echo '<legend>' . $feature_name . '</legend>';
+ echo '<div class="filter-group-feature">';
+ foreach ( $features as $feature => $feature_name ) {
+ $feature = esc_attr( $feature );
+ echo '<input type="checkbox" id="filter-id-' . $feature . '" value="' . $feature . '" /> ';
+ echo '<label for="filter-id-' . $feature . '">' . $feature_name . '</label><br>';
+ }
+ echo '</div>';
+ echo '</fieldset>';
+ }
+ ?>
+ <div class="buttons">
+ <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
+ <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
+ </div>
+ <div class="filtered-by">
+ <span><?php _e( 'Filtering by:' ); ?></span>
+ <div class="tags"></div>
+ <button type="button" class="button-link edit-filters"><?php _e( 'Edit Filters' ); ?></button>
+ </div>
+ </div>
+ </div>
+ <h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Themes list' ); ?></h2>
+ <div class="theme-browser content-filterable"></div>
+ <div class="theme-install-overlay wp-full-overlay expanded"></div>
+
+ <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
+ <span class="spinner"></span>