web/wp-admin/includes/theme-install.php
changeset 204 09a1c134465b
parent 194 32102edaa81b
equal deleted inserted replaced
203:f507feede89a 204:09a1c134465b
    56 		echo '<p class="install-help">' . __( 'Search for themes by keyword.' ) . '</p>';
    56 		echo '<p class="install-help">' . __( 'Search for themes by keyword.' ) . '</p>';
    57 	?>
    57 	?>
    58 <form id="search-themes" method="get" action="">
    58 <form id="search-themes" method="get" action="">
    59 	<input type="hidden" name="tab" value="search" />
    59 	<input type="hidden" name="tab" value="search" />
    60 	<?php if ( $type_selector ) : ?>
    60 	<?php if ( $type_selector ) : ?>
       
    61 	<label class="screen-reader-text" for="typeselector"><?php _e('Type of search'); ?></label>
    61 	<select	name="type" id="typeselector">
    62 	<select	name="type" id="typeselector">
    62 	<option value="term" <?php selected('term', $type) ?>><?php _e('Keyword'); ?></option>
    63 	<option value="term" <?php selected('term', $type) ?>><?php _e('Keyword'); ?></option>
    63 	<option value="author" <?php selected('author', $type) ?>><?php _e('Author'); ?></option>
    64 	<option value="author" <?php selected('author', $type) ?>><?php _e('Author'); ?></option>
    64 	<option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option>
    65 	<option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option>
    65 	</select>
    66 	</select>
       
    67 	<label class="screen-reader-text" for="s"><?php
       
    68 	switch ( $type ) {
       
    69 		case 'term':
       
    70 			_e( 'Search by keyword' );
       
    71 			break;
       
    72 		case 'author':
       
    73 			_e( 'Search by author' );
       
    74 			break;
       
    75 		case 'tag':
       
    76 			_e( 'Search by tag' );
       
    77 			break;
       
    78 	}
       
    79 	?></label>
       
    80 	<?php else : ?>
       
    81 	<label class="screen-reader-text" for="s"><?php _e('Search by keyword'); ?></label>
    66 	<?php endif; ?>
    82 	<?php endif; ?>
    67 	<input type="search" name="s" size="30" value="<?php echo esc_attr($term) ?>" />
    83 	<input type="search" name="s" id="s" size="30" value="<?php echo esc_attr($term) ?>" autofocus="autofocus" />
    68 	<?php submit_button( __( 'Search' ), 'button', 'search', false ); ?>
    84 	<?php submit_button( __( 'Search' ), 'button', 'search', false ); ?>
    69 </form>
    85 </form>
    70 <?php
    86 <?php
    71 }
    87 }
    72 
    88 
   116 }
   132 }
   117 add_action('install_themes_dashboard', 'install_themes_dashboard');
   133 add_action('install_themes_dashboard', 'install_themes_dashboard');
   118 
   134 
   119 function install_themes_upload($page = 1) {
   135 function install_themes_upload($page = 1) {
   120 ?>
   136 ?>
   121 <h4><?php _e('Install a theme in .zip format') ?></h4>
   137 <h4><?php _e('Install a theme in .zip format'); ?></h4>
   122 <p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.') ?></p>
   138 <p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.'); ?></p>
   123 <form method="post" enctype="multipart/form-data" action="<?php echo self_admin_url('update.php?action=upload-theme') ?>">
   139 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url('update.php?action=upload-theme'); ?>">
   124 	<?php wp_nonce_field( 'theme-upload') ?>
   140 	<?php wp_nonce_field( 'theme-upload'); ?>
   125 	<input type="file" name="themezip" />
   141 	<input type="file" name="themezip" />
   126 	<?php submit_button( __( 'Install Now' ), 'button', 'install-theme-submit', false ); ?>
   142 	<?php submit_button( __( 'Install Now' ), 'button', 'install-theme-submit', false ); ?>
   127 </form>
   143 </form>
   128 	<?php
   144 	<?php
   129 }
   145 }