/
search.php
executable file
·167 lines (143 loc) · 5.64 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
/**
* @package Argent Neue
*/
get_header(); ?>
<section class="container-fluid busca dark"><div class="wrapper center-block clearfix row">
<div class="col-xs-12 col-sm-10">
<h1 class="brand-heading">
<?php include get_template_directory() . '/assets/sub.glyph.publicacoes.svg'; ?>Publicações<span class="hidden">.cultura.gov.br</span></h1>
</div>
</div></section>
<main role="main"><div class="wrapper center-block clearfix row">
<header class="page-header hidden">
<h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'argent' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
</header>
<aside class="col-xs-12 col-sm-4">
<div class="search">
<?php echo get_search_form(); ?>
</div>
<?php if (is_search()): ?>
<div class="alert alert-info" role="alert">
<p>
Estamos trabalhando para que você consiga achar tudo o que procura através de uma única busca. Para melhorar nosso entendimento do que as pessoas esperam do SNIIC, estamos coletando e analisando os termos mais buscados.
<?php if (SaveSearch::getTopCount() > 50): ?>
Até agora são:
<?php
$termos = SaveSearch::getTopTerms();
foreach ($termos as $i => $termo) : if (empty($termo)) continue;
?><em><?php echo trim($termo); ?></em><?php
echo ($i < sizeof($termos) -1) ? ', ' : '.';
endforeach;
?>
<?php endif; ?>
</p>
<p>
<strong>Enquanto isso, utilize os campos abaixo para ajudá-lo a encontrar o que procura.</strong>
</p>
</div>
<button class="hidden visible-xs col-xs-12 btn btn-link"
type="button"
data-toggle="collapse"
data-target="#collapseSearchOptions"
aria-expanded="false"
aria-controls="collapseSearchOptions">
<a>Mais opções</a>
</button>
<?php endif; // is_search() ?>
<aside class="filter">
<div class="form-group">
<label class="title" for="select-area">Tema</label>
<?php wp_dropdown_categories(array(
'orderby' => 'NAME',
'show_option_none' => 'Selecione um tema',
'order' => 'ASC',
'hide_empty' => false,
'selected' => is_tax('tema') ? get_queried_object()->term_id : false,
'name' => 'tema',
'id' => 'select-tema',
'class' => 'postform form-control',
'depth' => 0,
'tab_index' => 0,
'taxonomy' => 'tema',
'hide_if_empty' => false,
'value_field' => 'slug',
)); ?>
</div>
<div class="form-group">
<label class="title" for="select-tipo">Tipo de publicação</label>
<?php wp_dropdown_categories(array(
'orderby' => 'NAME',
'show_option_none' => 'Selecione um tipo',
'order' => 'ASC',
'hide_empty' => false,
'selected' => is_tax('tipo') ? get_queried_object()->term_id : false,
'name' => 'tipo',
'id' => 'select-tipo',
'class' => 'postform form-control',
'depth' => 0,
'tab_index' => 0,
'taxonomy' => 'tipo',
'hide_if_empty' => false,
'value_field' => 'slug',
)); ?>
</div>
</aside>
<script type="text/javascript">
<!--
var tema = document.getElementById("select-tema");
var tipo = document.getElementById("select-tipo");
function onTemaChange() {
if ( tema.options[tema.selectedIndex].value != -1 ) {
location.href = "<?php echo esc_url( home_url( '/' ) ); ?>/tema/"+tema.options[tema.selectedIndex].value;
}
}
tema.onchange = onTemaChange;
function onTipoChange() {
if ( tipo.options[tipo.selectedIndex].value != -1 ) {
location.href = "<?php echo esc_url( home_url( '/' ) ); ?>/tipo/"+tipo.options[tipo.selectedIndex].value;
}
}
tipo.onchange = onTipoChange;
-->
</script>
<?php if (get_search_query()): ?>
<aside>
<h4>Buscar nas plataformas</h4>
<ul class="list-unstyled">
<li>
<h5 class="brand-heading">
<img src="<?php echo get_template_directory_uri() ?>/assets/sub.glyph.mapas.svg"/>
Mapas<span>.cultura.gov.br</span></h5>
<ul class="list-unstyled">
<li><a href="<?php echo MAPAS_URL; ?>/busca/##(global:(enabled:(agent:!t),filterEntity:agent),agent:(keyword:'<?php echo get_search_query(); ?>'))" target="blank">
Agentes Culturais com "<em><?php echo get_search_query(); ?></em>"
</a></li>
<li><a href="<?php echo MAPAS_URL; ?>/busca/##(global:(enabled:(space:!t),filterEntity:space),space:(keyword:'<?php echo get_search_query(); ?>'))" target="blank">
Espaços Culturais com "<em><?php echo get_search_query(); ?></em>"
</a></li>
<li><a href="<?php echo MAPAS_URL; ?>/busca/##(global:(enabled:(event:!t),filterEntity:event),space:(keyword:'<?php echo get_search_query(); ?>'))" target="blank">
Eventos Culturais com "<em><?php echo get_search_query(); ?></em>"
</a></li>
</ul>
</li>
<li class="hidden">
<h5 class="brand-heading">
<img src="<?php echo get_template_directory_uri() ?>/assets/sub.glyph.dados.svg"/>
<span>Dados</span>.cultura.gov.br</h5>
<ul>
<li><a href="http://dados.cultura.gov.br/dataset?q=<?php echo get_search_query(); ?>" target="blank">
<em><?php echo get_search_query(); ?></em> nos dados abertos
</a></li>
</ul>
</li>
</ul>
</aside>
<?php endif; ?>
</aside>
<div class="col-xs-12 col-sm-8">
<?php get_template_part( 'content/content', 'listing' ); ?>
</div>
</main>
<?php get_sidebar(); ?>
<?php get_footer(); ?>