| 1 |
<?php |
| 2 |
$unq_class = mt_rand(100000, 999999); |
| 3 |
$blockuniqueclass = ''; |
| 4 |
|
| 5 |
if (!empty($attributes['uniqueClass'])) { |
| 6 |
$blockuniqueclass = $attributes['uniqueClass']; |
| 7 |
} else { |
| 8 |
$blockuniqueclass = 'blockspare-posts-block-list-' . $unq_class; |
| 9 |
} |
| 10 |
|
| 11 |
$mainClass = $blockuniqueclass; |
| 12 |
$mainClass .= ' ' . $attributes['blockHoverEffect']; |
| 13 |
|
| 14 |
$wrapClass = 'bs-search-wrapper bs-grid-' . $attributes['sectionAlign']; |
| 15 |
$toggleClass = 'bs-search-' . $attributes['sectionAlign']; |
| 16 |
if ($attributes['searchStyle'] == "icon" && $attributes['iconOption'] == "dropdown") { |
| 17 |
$toggleClass .= ' bs-search-dropdown-toggle'; |
| 18 |
} |
| 19 |
if ($attributes['searchStyle'] == "icon" && $attributes['iconOption'] == "overlay") { |
| 20 |
$toggleClass .= ' bs-site-search-toggle'; |
| 21 |
} |
| 22 |
if ($attributes['searchStyle'] == "form") { |
| 23 |
$toggleClass .= ' bs-search-form-header'; |
| 24 |
} |
| 25 |
if ($attributes['animation']) { |
| 26 |
$toggleClass .= ' blockspare-block-animation ' . $attributes['animation']; |
| 27 |
} |
| 28 |
|
| 29 |
$iconClass = 'bs-search-icon--toggle blockspare-hover-item blockspare-hover-text ' . $attributes['searchIcon']; |
| 30 |
$alignclass = blockspare_checkalignment($attributes['align'], $attributes); |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
?> |
| 35 |
<div class="<?php echo esc_attr($mainClass); ?> align<?php echo esc_attr($alignclass) ?>"> |
| 36 |
<?php echo search_style_control($blockuniqueclass, $attributes); ?> |
| 37 |
<section class="<?php echo esc_attr($wrapClass); ?>"> |
| 38 |
<div class="<?php echo esc_attr($toggleClass); ?>"> |
| 39 |
<?php if ($attributes['searchStyle'] == "icon") { ?> |
| 40 |
<button class="<?php echo esc_attr($iconClass); ?>"> |
| 41 |
<span class="screen-reader-text"> |
| 42 |
<?php echo esc_html__('Enter Keyword', 'blockspare'); ?> |
| 43 |
</span> |
| 44 |
</button> |
| 45 |
<?php if ($attributes['iconOption'] == "dropdown") { ?> |
| 46 |
<div class="bs-search--toggle-dropdown"> |
| 47 |
<div class="bs-search--toggle-dropdown-wrapper"> |
| 48 |
<?php echo blockspare_search_html($attributes); ?> |
| 49 |
</div> |
| 50 |
</div> |
| 51 |
<?php } ?> |
| 52 |
<?php } ?> |
| 53 |
<?php if ($attributes['searchStyle'] == "form") { ?> |
| 54 |
<div class="bs-search-form--wrapper"> |
| 55 |
<?php echo blockspare_search_html($attributes); ?> |
| 56 |
</div> |
| 57 |
<?php } ?> |
| 58 |
</div> |
| 59 |
<?php if ($attributes['searchStyle'] == "icon" && $attributes['iconOption'] == "overlay") { ?> |
| 60 |
<div class="bs-search--toggle"> |
| 61 |
<div class="bs-search-toggle--wrapper"> |
| 62 |
<?php echo blockspare_search_html($attributes); ?> |
| 63 |
</div> |
| 64 |
<button class="bs--site-search-close fas fa-times"> |
| 65 |
<span class="screen-reader-text"> <?php echo esc_html__('Close', 'blockspare'); ?></span> |
| 66 |
</button> |
| 67 |
</div> |
| 68 |
<?php } ?> |
| 69 |
</section> |
| 70 |
</div> |
| 71 |
<?php |
| 72 |
|