<?php
/**
 * Search form
 *
 * @package Multi
 */

?>
<?php
if ( ! isset( $args['type'] ) ) {
	$args['type'] = '';
}
switch ( $args['type'] ) {
	case 'product-search':
		?>
	<form role="search" method="get" class="woocommerce-product-search searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
	<fieldset>
		<label for="woocommerce-product-search-field" class="screen-reader-text"><?php esc_html_e( 'Search products', 'multimagazine' ); ?></label>
		<input type="search" id="woocommerce-product-search-field-<?php echo isset( $index ) ? absint( $index ) : 0; ?>" class="search-field" placeholder="<?php esc_attr_e( 'Search products&hellip;', 'multimagazine' ); ?>" value="<?php echo get_search_query(); ?>" name="s">
		<button type="submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'multimagazine' ); ?>" class="search-button" aria-label="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>"><i class="m-icon m-icon-search" aria-hidden="true"></i></button>
		<input type="hidden" name="post_type" value="product">
	</fieldset>
	</form>
		<?php
		break;
	case 'bp-legacy-groups':
		?>
	<div id="group-dir-search" class="buddy-search in-page-search" role="search">
		<form role="search" action="" method="get" id="search-groups-form" class="searchform">
			<fieldset>
				<label for="groups_search" class="screen-reader-text"><?php esc_html_e( 'Search groups', 'multimagazine' ); ?></label>
				<input type="text" name="s" id="groups_search" placeholder="<?php echo esc_attr( $args['search_value'] ); ?>">
				<button type="submit" class="search-button" id="groups_search_submit" name="groups_search_submit" value="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>" aria-label="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>"><i class="m-icon m-icon-search" aria-hidden="true"></i></button>
			</fieldset>
		</form>
	</div>
		<?php
		break;
	case 'bp-legacy-members':
		?>
	<div id="members-dir-search" class="buddy-search in-page-search" role="search">
		<form role="search" action="" method="get" id="search-members-form" class="searchform">
			<fieldset>
				<label for="members_search" class="screen-reader-text"><?php esc_html_e( 'Search members', 'multimagazine' ); ?></label>
				<input type="text" name="s" id="members_search" placeholder="<?php echo esc_attr( $args['search_value'] ); ?>">
				<button type="submit" class="search-button" id="members_search_submit" name="members_search_submit" value="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>" aria-label="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>"><i class="m-icon m-icon-search" aria-hidden="true"></i></button>
			</fieldset>
		</form>
	</div>
		<?php
		break;
	case 'bbp-topic':
		?>
	<form role="search" method="get" id="bbp-topic-search-form" class="bbp-search-form searchform">
		<fieldset>
			<label class="screen-reader-text" for="ts"><?php esc_html_e( 'Search topics:', 'multimagazine' ); ?></label>
			<input type="text" value="<?php bbp_search_terms(); ?>" name="ts" id="ts" placeholder="<?php esc_attr_e( 'Search topics:', 'multimagazine' ); ?>">
			<button class="search-button" type="submit" id="bbp_search_submit" value="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>" aria-label="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>"><i class="m-icon m-icon-search" aria-hidden="true"></i></button>
		</fieldset>
	</form>
		<?php
		break;
	case 'bbp-reply':
		?>
	<form role="search" method="get" id="bbp-reply-search-form" class="bbp-search-form searchform">
		<fieldset>
			<label class="screen-reader-text" for="rs"><?php esc_html_e( 'Search replies:', 'multimagazine' ); ?></label>
			<input type="text" value="<?php bbp_search_terms(); ?>" name="rs" id="rs" placeholder="<?php esc_attr_e( 'Search replies:', 'multimagazine' ); ?>">
			<button class="search-button" type="submit" id="bbp_search_submit" value="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>" aria-label="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>"><i class="m-icon m-icon-search" aria-hidden="true"></i></span></button>
		</fieldset>
	</form>
		<?php
		break;
	case 'bbp-search':
		?>
	<form role="search" method="get" id="bbp-search-form" class="bbp-search-form searchform" action="<?php bbp_search_url(); ?>">
		<fieldset>
			<input type="hidden" name="action" value="bbp-search-request">
			<label for="bbp_search" class="screen-reader-text"><?php esc_html_e( 'Search', 'multimagazine' ); ?></label>
			<input tabindex="<?php bbp_tab_index(); ?>" type="text" value="<?php echo esc_attr( bbp_get_search_terms() ); ?>" name="bbp_search" id="bbp_search" placeholder="<?php esc_attr_e( 'Search for:', 'multimagazine' ); ?>">
			<button tabindex="<?php bbp_tab_index(); ?>" class="search-button" type="submit" id="bbp_search_submit" class="search-button" value="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>" name="searchsubmit" aria-label="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>"><i class="m-icon m-icon-search" aria-hidden="true"></i></button>
		</fieldset>
	</form>
		<?php
		break;
	default:
		?>
	<form role="search" method="get" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
	<fieldset>
		<label class="screen-reader-text"><?php esc_html_e( 'Search', 'multimagazine' ); ?></label>
		<input type="text" value="<?php the_search_query(); ?>" name="s" placeholder="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>"><button type="submit" class="search-button" name="searchsubmit" value="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>" aria-label="<?php esc_attr_e( 'Search', 'multimagazine' ); ?>"><i class="m-icon m-icon-search" aria-hidden="true"></i></button>
	</fieldset>
	</form>
		<?php
}

