PluginProbe
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites / trunk
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites vtrunk
4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 2.6.1 All 38 releases
blockspare / build / block / search / render.php

render.php in BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites trunk, at build/block/search/render.php

72 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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