Opal-Estate-Pro/templates/search-box/collapse-city.php

94 lines
3.5 KiB
PHP
Raw Permalink Normal View History

2019-09-10 06:27:33 +02:00
<?php
/**
* The template for collapse city search
*
* @version 1.0.0
*/
defined( 'ABSPATH' ) || exit;
2019-12-30 11:08:00 +01:00
$unique_id = esc_attr( opalestate_unique_id() );
2019-09-10 06:27:33 +02:00
$GLOBALS['group-info-column'] = 4;
if ( isset( $nobutton ) && $nobutton ) {
$grid = [
0 => 7,
1 => 4,
2 => 1,
3 => 0,
];
} else {
$grid = [
0 => 6,
1 => 3,
2 => 1,
3 => 2,
];
}
$display_more_options = isset( $display_more_options ) ? $display_more_options : true;
2020-06-18 06:09:45 +02:00
$max_range = isset( $max_range ) && $max_range ? $max_range : apply_filters( 'opalestate_search_geo_max_range', 10 );
$range_unit = isset( $range_unit ) ? $range_unit : 'km';
2019-09-10 06:27:33 +02:00
$form_classes = [
'opalestate-search-form',
'opalestate-search-form--collapse-city',
isset( $hidden_labels ) && $hidden_labels ? 'hidden-labels' : '',
];
?>
<form class="<?php echo esc_attr( implode( ' ', array_map( 'sanitize_html_class', $form_classes ) ) ); ?>" action="<?php echo esc_url( opalestate_get_search_link() ); ?>" method="GET">
<div class="opal-row">
<div class="col-lg-<?php echo esc_attr( $grid[0] ) ?> col-md-<?php echo esc_attr( $grid[0] ); ?> col-sm-<?php echo esc_attr( $grid[0] ); ?> col-xs-12">
2020-06-18 06:09:45 +02:00
<?php echo opalestate_load_template_path( 'search-box/fields/search-city-text', [ 'max_range' => $max_range, 'range_unit' => $range_unit ] ); ?>
2019-09-10 06:27:33 +02:00
</div>
<div class="col-lg-<?php echo esc_attr( $grid[1] ); ?> col-md-<?php echo esc_attr( $grid[1] ); ?> col-sm-<?php echo esc_attr( $grid[1] ); ?> col-xs-12">
<?php echo opalestate_load_template_path( 'search-box/fields/status' ); ?>
</div>
<div class="col-lg-<?php echo esc_attr( $grid[2] ); ?> col-md-<?php echo esc_attr( $grid[2] ); ?> col-sm-<?php echo esc_attr( $grid[2] ); ?> col-xs-12">
<button type="button" class="opal-collapse-button opalestate-collapse-btn btn btn-primary" data-collapse="#collapse-city-<?php echo esc_attr( $unique_id ); ?>">
2019-10-10 05:41:57 +02:00
<?php echo apply_filters( 'opalestate_search_form_collapse_button', '<i class="fa fa-caret-down" aria-hidden="true"></i>' ); ?>
2019-09-10 06:27:33 +02:00
</button>
</div>
<?php if ( ! isset( $nobutton ) || ! $nobutton ) : ?>
<div class="col-lg-<?php echo esc_attr( $grid[3] ); ?> col-md-<?php echo esc_attr( $grid[3] ); ?> col-sm-<?php echo esc_attr( $grid[3] ); ?> col-xs-12">
<?php echo opalestate_load_template_path( 'search-box/fields/submit-button' ); ?>
</div>
<?php endif; ?>
</div>
<div id="collapse-city-<?php echo esc_attr( $unique_id ); ?>" class="opal-collapse-container collapse-city-inputs">
<div class="opal-row">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
<?php echo opalestate_load_template_path( 'search-box/fields/types' ); ?>
</div>
<?php echo opalestate_load_template_path( 'search-box/fields/group-info' ); ?>
2019-10-10 05:41:57 +02:00
<?php if ( opalestate_is_enable_price_field() ) : ?>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<?php echo opalestate_load_template_path( 'search-box/fields/price' ); ?>
</div>
<?php endif; ?>
<?php if ( opalestate_is_enable_areasize_field() ) : ?>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<?php echo opalestate_load_template_path( 'search-box/fields/areasize' ); ?>
</div>
<?php endif; ?>
2019-09-10 06:27:33 +02:00
</div>
2019-10-10 05:41:57 +02:00
<?php
if ( $display_more_options ) {
echo opalestate_load_template_path( 'search-box/fields/more-options' );
}
?>
2019-09-10 06:27:33 +02:00
</div>
<?php do_action( 'opalestate_after_search_properties_form' ); ?>
</form>