
Catálogo de publicaciones
Se ha producido un error al procesar la plantilla.
Error: on line 581, column 64 in 10154#10194#619708 Expecting a number here, found: 1618565,
1<style>
2
3 #resultados-publicaciones{
4 background-color: white;
5 border-radius: 10px 10px 0 0;
6 }
7
8 #resultados-publicaciones #main-container-title{
9 padding: 10px;
10 font-size: 1em;
11 background-color: #C53BA6;
12 color: white;
13 text-align: center;
14 border-radius: 10px 10px 0 0;
15 font-weight: bold;
16 border-left: 2px solid #C53BA6;
17 border-right: 2px solid #C53BA6;
18 border-top: 2px solid #C53BA6;
19 }
20
21 #resultados-publicaciones .main-container-contenido{
22 position: relative;
23 min-height: 150px;
24 width: 97%;
25 height: auto;
26 margin: 15px auto;
27 border-radius: 0 30px 0 10px;
28 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
29 }
30
31 #resultados-publicaciones .container-info{
32 width: 70%;
33 display: inline-block;
34 overflow: hidden;
35 }
36
37 #resultados-publicaciones .container-img{
38 position: absolute;
39 float: right;
40 width: 30%;
41 height: 100%;
42 display: inline-block;
43 overflow: hidden;
44 border-radius: 0 30px 0 0;
45 text-align: center;
46 }
47
48 #resultados-publicaciones .container-img img{
49 width: 100%;
50 }
51
52 #resultados-publicaciones .container-img .empty-img{
53 width: auto;
54 height: 100%;
55 transform: scale(0.8);
56 }
57
58 #resultados-publicaciones .titulo-contenido{
59 background-color: #E6E6E6;
60 padding: 5px 10px 5px 10px;
61 color: black;
62 font-size: 1em;
63 font-weight: bold;
64 box-sizing: border-box;
65 }
66
67 #resultados-publicaciones .titulo-contenido a{
68 font-weight: bold;
69 text-decoration: none;
70 color: black;
71 display: block;
72 }
73
74 #resultados-publicaciones .content-description{
75 margin: 10px 10px 10px 10px !important;
76 text-align: justify;
77 }
78
79 /* Barra de titulo y enlaces de color azul*/
80 #resultados-publicaciones .titulo-1{
81 border-radius: 0 0 0 10px;
82 border-bottom: 3px solid #0E72B5;
83 }
84
85 #resultados-publicaciones .titulo-1 a:link,
86 #resultados-publicaciones .titulo-1 a:visited{
87 color: black;
88 text-decoration: none;
89 }
90
91 #resultados-publicaciones .titulo-1 a:hover,
92 #resultados-publicaciones .titulo-1 a:active{
93 color: #0E72B5;
94 text-decoration: none;
95 }
96
97 /* Barra de titulo y enlaces de color naranja oscuro*/
98 #resultados-publicaciones .titulo-2{
99 border-radius: 0 0 0 10px;
100 border-bottom: 3px solid #EA620D;
101 }
102
103 #resultados-publicaciones .titulo-2 a:link,
104 #resultados-publicaciones .titulo-2 a:visited{
105 color: black;
106 text-decoration: none;
107 }
108
109 #resultados-publicaciones .titulo-2 a:hover,
110 #resultados-publicaciones .titulo-2 a:active{
111 color: #EA620D;
112 text-decoration: none;
113 }
114
115 /* Barra de titulo y enlaces de color verde*/
116 #resultados-publicaciones .titulo-3{
117 border-radius: 0 0 0 10px;
118 border-bottom: 3px solid #97BF0D;
119 }
120
121 #resultados-publicaciones .titulo-3 a:link,
122 #resultados-publicaciones .titulo-3 a:visited{
123 color: black;
124 text-decoration: none;
125 }
126
127 #resultados-publicaciones .titulo-3 a:hover,
128 #resultados-publicaciones .titulo-3 a:active{
129 color: #97BF0D;
130 text-decoration: none;
131 }
132
133 /* Barra de titulo y enlaces de color naranja*/
134 #resultados-publicaciones .titulo-4{
135 border-radius: 0 0 0 10px;
136 border-bottom: 3px solid #F29400;
137 }
138
139 #resultados-publicaciones .titulo-4 a:link,
140 #resultados-publicaciones .titulo-4 a:visited{
141 color: black;
142 text-decoration: none;
143 }
144
145 #resultados-publicaciones .titulo-4 a:hover,
146 #resultados-publicaciones .titulo-4 a:active{
147 color: #F29400;
148 text-decoration: none;
149 }
150
151 /* Estilos para la tabla que muestra la info del elemento */
152 #resultados-publicaciones .detail-lbl-1,
153 #resultados-publicaciones .detail-lbl-2,
154 #resultados-publicaciones .detail-lbl-3,
155 #resultados-publicaciones .detail-lbl-4{
156 width: 19%;
157 font-style: italic;
158 font-weight: bold;
159 vertical-align: top;
160 }
161
162 #resultados-publicaciones .detail-lbl-1{
163 color: #0E72B5;
164 }
165
166 #resultados-publicaciones .detail-lbl-2{
167 color: #EA620D;
168 }
169
170 #resultados-publicaciones .detail-lbl-3{
171 color: #97BF0D;
172 }
173
174 #resultados-publicaciones .detail-lbl-4{
175 color: #F29400;
176 }
177
178 #resultados-publicaciones .detail-info{
179 padding: 0px 10px 5px 10px;
180 font-size: 0.9em;
181 }
182
183 #resultados-publicaciones .info-table{
184 width: 100%;
185 verical-align: top;
186 }
187
188 #resultados-publicaciones .info-table p{
189 margin: 0;
190 }
191
192 #resultados-publicaciones .selected-category-container{
193 margin: 5px 10px;
194 }
195
196 #resultados-publicaciones .selected-category-container hr{
197 margin: 5px 0;
198 border-top: 1px solid #0E72B5;
199 }
200
201 #resultados-publicaciones .selected-category-name{
202 color: #0E72B5!important;
203 margin: 0!important;
204 padding: 0!important;
205 }
206
207 #resultados-publicaciones .selected-category-description{
208 text-align: justify;
209 }
210
211 #resultados-publicaciones .noresult-msg{
212 width: 100%;
213 margin: 10px 0 10px 0;
214 font-weight: bold;
215 text-align: center;
216 }
217
218 /* Paginación */
219
220 #resultados-publicaciones .pagination-container{
221 width: auto;
222 height: auto;
223 margin: auto;
224 display: block;
225 text-align: center;
226 margin-top: 35px;
227 }
228
229 #resultados-publicaciones .elemento-pagination{
230 width: 34px;
231 height: 34px;
232 background: #97bf0d;
233 color: black;
234 display: inline-block;
235 line-height: 34px;
236 font-size: 1.2em;
237 font-weight: bold;
238 text-decoration: none;
239 }
240
241 #resultados-publicaciones .elemento-pagination:hover,
242 #resultados-publicaciones [id^="page-num-"].cur-page{
243 color: white;
244 }
245
246 #resultados-publicaciones .pagination-track{
247 position: relative;
248 white-space: nowrap;
249 top: 0;
250 left: 0;
251 display: block;
252 margin-left: auto;
253 margin-right: auto;
254 opacity: 1;
255 width: auto;
256 }
257
258 #resultados-publicaciones .pagination-btn{
259 color: #97BF0D;
260 background-color: #272727;
261 cursor: pointer;
262 font-size: 1.4em;
263 height: 34px;
264 width: 34px;
265 font-weight: bold;
266 user-select: none;
267 line-height: 34px;
268 display: inline-block;
269 vertical-align:inherit;
270 }
271
272 #resultados-publicaciones .pagination-btn:hover{
273 color: white;
274 background-color:#272727;
275 }
276
277 #resultados-publicaciones .botones-retroceso,
278 #resultados-publicaciones .botones-avance{
279 display: inline-block;
280 vertical-align: top;
281 }
282
283 #resultados-publicaciones .selector-pagina{
284 display: inline-block;
285 }
286
287 /* RESPONSIVE */
288 @media only screen and (max-width : 767px) and (orientation : portrait) {
289
290 #resultados-publicaciones .main-container-contenido{
291 display: flex;
292 position: relative;
293 flex-direction: column;
294 width: 90%;
295 }
296
297 #resultados-publicaciones .container-info {
298 width: 100%;
299 }
300
301 #resultados-publicaciones .container-img{
302 order: -1;
303 position: relative;
304 width: 100%;
305 height: 200px;
306 }
307
308 #resultados-publicaciones .selector-pagina{
309 max-width: 186px;
310 }
311
312 #resultados-publicaciones .pagination-track{
313 white-space: unset;
314 }
315
316 #resultados-publicaciones .pagination-btn{
317 display: block;
318 margin-bottom: 4px;
319 }
320
321 #resultados-publicaciones .elemento-pagination{
322 margin-bottom: 4px;
323 }
324 }
325
326 @media only screen and (min-width : 1920px) {
327
328 #resultados-publicaciones #main-container-title {
329 font-size: 1.2em;
330 }
331
332 #resultados-publicaciones .main-container-contenido{
333 min-height: 250px;
334 }
335
336 #resultados-publicaciones .container-info {
337 width: 75%;
338 }
339
340 #resultados-publicaciones .container-img {
341 width: 25%;
342 }
343
344 #resultados-publicaciones .titulo-contenido {
345 font-size: 1.2em;
346 line-height: 25px;
347 }
348
349 #resultados-publicaciones .content-description {
350 font-size: 1.2em;
351 }
352
353 #resultados-publicaciones .detail-info{
354 padding-bottom: 12px;
355 }
356
357 #resultados-publicaciones .noresult-msg {
358 font-size: 1.2em;
359 }
360
361 }
362</style>
363
364<#function genera_url_paginacion>
365 <#assign currentURL = portalUtil.getPortalURL(request)+portalUtil.getCurrentURL(request)>
366
367 <#if currentURL?contains('?')>
368 <#if currentURL?contains('&page=')>
369 <#assign aux = currentURL?split("&page=")>
370 <#assign cutURL = aux[0]+'&page='>
371 <#elseif currentURL?contains('?page=')>
372 <#assign aux = currentURL?split("?page=")>
373 <#assign cutURL = aux[0]+'?page='>
374 <#else>
375 <#assign cutURL = currentURL+'&page='>
376 </#if>
377 <#else>
378 <#assign cutURL = currentURL+'?page='>
379 </#if>
380 <#return cutURL>
381</#function>
382
383<#function get_url_parameter param>
384 <#assign currentURL = portalUtil.getPortalURL(request)+portalUtil.getCurrentURL(request)>
385
386 <#assign decoder = objectUtil("java.net.URLDecoder")>
387 <#assign urlDecoded = decoder.decode(currentURL, "UTF-8")>
388 <#assign filters = urlDecoded?split('?')[1]>
389 <#assign filters = filters?split('&')>
390 <#list filters as filter>
391 <#if param == filter?split('=')[0]>
392 <#return filter?split('=')[1]>
393 </#if>
394 </#list>
395</#function>
396
397<#-- Configuración de la paginación -->
398<#assign maxPerPage = 20>
399
400<div id="resultados-publicaciones">
401 <#assign currentURL = portalUtil.getPortalURL(request)+portalUtil.getCurrentURL(request)>
402 <#if (currentURL?contains('filter'))> <!-- Si se ha filtrado por el campo de texto -->
403 <div id="main-container-title" tabindex="0">Resultados obtenidos: "${get_url_parameter('filter')}"</div>
404 <#assign color_count = 1 >
405 <#assign count = 0>
406 <#assign page = []>
407 <#assign pageList = []>
408 <!-- Resultados -->
409 <#if entries?has_content >
410 <#list entries as currentContent>
411 <#assign renderer = currentContent.getAssetRenderer()>
412 <#assign className = renderer.getClassName()>
413 <#if (className == "com.liferay.portlet.journal.model.JournalArticle") >
414 <#assign journalArticle = renderer.getArticle() >
415 <#assign document = saxReaderUtil.read(journalArticle.getContent()) >
416 <#assign decoder = objectUtil("java.net.URLDecoder")>
417 <#assign urlDecoded = decoder.decode(currentURL, "UTF-8")>
418
419 <#assign filters = get_url_parameter('filter')?split(" ")> <!-- Al pasar la URL por el decode el '+' que se para la lista de palabras se transforma en un espacio en blanco ' ' -->
420
421 <#assign filterOk = false>
422 <#list filters as f>
423 <#if filterOk == false>
424 <#if ((document.getStringValue()?upper_case)?contains(f?upper_case))>
425 <#assign filterOk = true>
426 </#if>
427 </#if>
428 </#list>
429
430 <#if (filterOk == true)>
431 <#assign count = count +1>
432 <#assign page = page + [currentContent]>
433 <#if (count == maxPerPage)>
434 <#assign pageList = pageList + [page]>
435 <#assign page = []>
436 <#assign count = 0>
437 </#if>
438 </#if>
439 </#if>
440 </#list>
441
442 <#if (count > 0)>
443 <#assign pageList = pageList + [page]>
444 <#assign count = 0>
445 </#if>
446
447 <#assign currentPage = 0>
448 <#if pageList?size gt 0>
449 <#if (portalUtil.getOriginalServletRequest(request).getParameter('page')?has_content)>
450 <#assign currentPage = portalUtil.getOriginalServletRequest(request).getParameter('page')?number - 1>
451 <#if (currentPage > pageList?size - 1)>
452 <#assign currentPage = pageList?size -1>
453 <#elseif (currentPage < 0)>
454 <#assign currentPage = 0>
455 </#if>
456 <#else>
457 <#assign currentPage = 0>
458 </#if>
459
460 <#list pageList[currentPage] as cPage>
461 <#assign renderer = cPage.getAssetRenderer()>
462 <#assign article = renderer.getArticle()>
463 <#assign document = saxReaderUtil.read(article.getContent()) >
464 <#assign rootElement = document.getRootElement() >
465 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='Titulo']") >
466 <#assign titulo = xPathSelector.selectSingleNode(rootElement).getStringValue() >
467 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='Autor']") >
468 <#assign autores = xPathSelector.selectNodes(rootElement)>
469 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='Edicion']") >
470 <#assign edicion = xPathSelector.selectSingleNode(rootElement).getStringValue() >
471 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='Descripcion']") >
472 <#assign descripcion = xPathSelector.selectSingleNode(rootElement).getStringValue() >
473 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='Foto']") >
474 <#assign foto = xPathSelector.selectSingleNode(rootElement).getStringValue()>
475
476 <#assign url = renderer.getURLViewInContext(renderRequest, renderResponse, '') />
477
478 <div class="main-container-contenido">
479 <div class="container-info">
480 <div class="titulo-contenido titulo-${color_count}">
481 <a href="${url}">${titulo}</a>
482 </div>
483 <div class="content-description">
484 <table class="info-table">
485 <tr>
486 <td class="detail-lbl-${color_count}">Autor</td>
487 <td class="detail-info">
488 <#list autores as autor>
489 <#assign aux = autor.getStringValue()>
490 <p>${aux}</p>
491 </#list>
492 </td>
493 </tr>
494 <tr>
495 <td class="detail-lbl-${color_count}">Edición</td>
496 <td class="detail-info">${edicion}</td>
497 </tr>
498 <tr>
499 <td class="detail-lbl-${color_count}">Descripción</td>
500 <td class="detail-info">${descripcion}</td>
501 </tr>
502 </table>
503 </div>
504 </div>
505 <div class="container-img">
506 <#if (foto?length>5) >
507 <a href="${url}" tabindex="-1"><img src="${foto}" alt='${titulo}'/></a>
508 <#else>
509 <a href="${url}" tabindex="-1"><img class="empty-img" alt ="Imagen de la publicación no disponible" src="/Diputacion-theme/images/cultura_dipva/publicacion-no-disponible.png" alt=""/></a>
510 </#if>
511 </div>
512 </div>
513 <#assign color_count = color_count + 1 >
514 <#if (color_count>4) >
515 <#assign color_count = 1>
516 </#if>
517 </#list>
518
519 <#assign numPage = 0>
520 <#assign pagURL = genera_url_paginacion()>
521 <div class="pagination-container">
522 <div class="pagination-track">
523 <div class="botones-retroceso">
524 <a class="pagination-btn pag-first" href="${pagURL}1"><i class="fa fa-step-backward"></i></a>
525 <div class="pagination-btn pag-left" onclick="paginationLeft()"><i class="fa fa-chevron-left"></i></div>
526 </div>
527 <div class="selector-pagina">
528 <#list pageList as page>
529 <#assign numPage = numPage + 1>
530 <a class="elemento-pagination" href="${pagURL}${numPage}" id="page-num-${numPage}">${numPage}</a>
531 </#list>
532 </div>
533 <div class="botones-avance">
534 <div class="pagination-btn pag-right" onclick="paginationRight()"><i class="fa fa-chevron-right"></i></div>
535 <a class="pagination-btn pag-last" href="${pagURL}${numPage}"><i class="fa fa-step-forward"></i></a>
536 </div>
537 </div>
538 </div>
539 <#else>
540 <div class="noresult-msg">
541 <span> La búsqueda no ha producido ningún resultado.</span>
542 </div>
543 </#if>
544 <#else>
545 <div class="noresult-msg">
546 <span> La búsqueda no ha producido ningún resultado.</span>
547 </div>
548 </#if>
549
550 <#else> <!-- Si no se ha filtrado por el campo de texto -->
551 <div id="main-container-title" tabindex="0">Resultados obtenidos</div>
552 <#assign color_count = 1 >
553 <#assign count = 0>
554 <#assign page = []>
555 <#assign pageList = []>
556 <!-- Resultados -->
557 <#if entries?has_content >
558 <#-- Dividimos los resultados por páginas -->
559 <#list entries as currentContent>
560 <#assign renderer = currentContent.getAssetRenderer()>
561 <#assign className = renderer.getClassName()>
562 <#if (className == "com.liferay.portlet.journal.model.JournalArticle") >
563 <#assign count = count +1>
564 <#assign page = page + [currentContent]>
565 <#if (count == maxPerPage)>
566 <#assign pageList = pageList + [page]>
567 <#assign page = []>
568 <#assign count = 0>
569 </#if>
570 </#if>
571 </#list>
572
573 <#if (count > 0)>
574 <#assign pageList = pageList + [page]>
575 <#assign count = 0>
576 </#if>
577
578 <#assign currentPage = 0>
579 <#if pageList?size gt 0>
580 <#if (portalUtil.getOriginalServletRequest(request).getParameter('page')?has_content)>
581 <#assign currentPage = portalUtil.getOriginalServletRequest(request).getParameter('page')?number - 1>
582 <#if (currentPage > pageList?size - 1)>
583 <#assign currentPage = pageList?size -1>
584 <#elseif (currentPage < 0)>
585 <#assign currentPage = 0>
586 </#if>
587 <#else>
588 <#assign currentPage = 0>
589 </#if>
590
591 <#list pageList[currentPage] as cPage>
592 <#assign renderer = cPage.getAssetRenderer()>
593 <#assign className = renderer.getClassName()>
594 <#if (className == "com.liferay.portlet.journal.model.JournalArticle") >
595 <#assign journalArticle = renderer.getArticle() >
596 <#assign document = saxReaderUtil.read(journalArticle.getContent()) >
597 <#assign rootElement = document.getRootElement() >
598 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='Titulo']") >
599 <#assign titulo = xPathSelector.selectSingleNode(rootElement).getStringValue() >
600 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='Autor']") >
601 <#assign autores = xPathSelector.selectNodes(rootElement)>
602 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='Edicion']") >
603 <#assign edicion = xPathSelector.selectSingleNode(rootElement).getStringValue() >
604 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='Descripcion']") >
605 <#assign descripcion = xPathSelector.selectSingleNode(rootElement).getStringValue() >
606 <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='Foto']") >
607 <#assign foto = xPathSelector.selectSingleNode(rootElement).getStringValue()>
608
609 <#assign url = renderer.getURLViewInContext(renderRequest, renderResponse, '') />
610
611 <div class="main-container-contenido">
612 <div class="container-info">
613 <div class="titulo-contenido titulo-${color_count}">
614 <a href="${url}">${titulo}</a>
615 </div>
616 <div class="content-description">
617 <p><span class="detail-lbl-${color_count}">Autor</span><span class="detail-info"></p>
618 <#list autores as autor>
619 <#assign aux = autor.getStringValue()>
620 <p>${aux}</p>
621 </#list>
622
623 <p><span class="detail-lbl-${color_count}">Edición</span><span class="detail-info">${edicion}</span> </p>
624 <p><span class="detail-lbl-${color_count}">Descripción</span><span class="detail-info">${descripcion}</span> </p>
625
626 </div>
627 </div>
628 <div class="container-img">
629 <#if (foto?length>5) >
630 <a href="${url}" tabindex="-1"><img src="${foto}" alt='${titulo}'/></a>
631 <#else>
632 <a href="${url}" tabindex="-1"><img class="empty-img" alt ="Imagen de la publicación no disponible" src="/Diputacion-theme/images/cultura_dipva/publicacion-no-disponible.png" alt=""/></a>
633 </#if>
634 </div>
635 </div>
636 <#assign color_count = color_count + 1 >
637 <#if (color_count>4) >
638 <#assign color_count = 1>
639 </#if>
640 </#if>
641 </#list>
642
643 <#-- <span>— ${maxPerPage} Resultados por página. Página ${currentPage + 1} de ${pageList?size}.</span> -->
644
645 <#assign numPage = 0>
646 <#assign pagURL = genera_url_paginacion()>
647 <div class="pagination-container">
648 <div class="pagination-track">
649 <div class="botones-retroceso">
650 <button type="button"class="pagination-btn pag-first" id="retrocesototal" onclick="window.location='${pagURL}1'"><span class="fa fa-step-backward"></span></button>
651 <button type="button"class="pagination-btn pag-left" id="retrocesopagina" onclick="paginationLeft()"><span class="fa fa-chevron-left"></span></button>
652 </div>
653 <div class="selector-pagina">
654 <#list pageList as page>
655 <#assign numPage = numPage + 1>
656 <a class="elemento-pagination" href="${pagURL}${numPage}" id="page-num-${numPage}">${numPage}</a>
657 </#list>
658 </div>
659 <div class="botones-avance">
660 <button type="button"class="pagination-btn pag-right" id="avancepagina" onclick="paginationRight()"><span class="fa fa-chevron-right"></span></button>
661 <button type="button"class="pagination-btn pag-last" id="avancetotal" onclick="window.location='${pagURL}${numPage}'"><span class="fa fa-step-forward"></span></button>
662
663 </div>
664 </div>
665 </div>
666 <#else>
667 <div class="noresult-msg">
668 <span> La búsqueda no ha producido ningún resultado.</span>
669 </div>
670 </#if>
671 <#else>
672 <div class="noresult-msg">
673 <span> La búsqueda no ha producido ningún resultado.</span>
674 </div>
675 </#if>
676 </#if>
677</div>
678
679<script>
680 var url = document.URL;
681 var arrayURL = [];
682 var tamanio;
683 var sc;
684 var params;
685 var links = [];
686 $(window).load(function(){
687 if (url.indexOf('categoryIds=')>=0){
688 arrayURL = url.split('&');
689 tamanio = arrayURL.length-1;
690 sc = arrayURL[tamanio];
691 links = $('.lfr-menu-list>li>a');
692 var prop;
693 links.each(function(){
694 prop = $(this).attr('href');
695 prop = prop+'&'+sc;
696 $(this).attr('href',prop);
697 });
698
699 botones = $('.lfr-pagination-buttons>li>a');
700 var prop1;
701 botones.each(function(){
702 prop1 = $(this).attr('href');
703 prop1 = prop1+'&'+sc;
704 $(this).attr('href',prop1);
705 });
706 }
707
708 if (url.indexOf('filter=')>=0){
709 arrayURL = url.split('&');
710 tamanio = arrayURL.length-1;
711 params = arrayURL[tamanio].split('?');
712 sc = params[params.length-1]
713 links = $('.lfr-menu-list>li>a');
714 var prop;
715 links.each(function(){
716 prop = $(this).attr('href');
717 prop = prop+'&'+sc;
718 $(this).attr('href',prop);
719 });
720
721 botones = $('.lfr-pagination-buttons>li>a');
722 var prop1;
723 botones.each(function(){
724 prop1 = $(this).attr('href');
725 prop1 = prop1+'&'+sc;
726 $(this).attr('href',prop1);
727 });
728 }
729 });
730
731</script>
732
733<script>
734 /*********************************************************** Paginacion ***********************************************************/
735 var pag_actual;
736 var first = 1;
737 var last = $('.elemento-pagination').length;
738 var first_visible = 1;
739 var last_visible = 10;
740 var elementos_menu = 10;
741 var pcontrol = 7;
742
743 inicia_paginacion();
744
745 function inicia_paginacion(){
746 markCurrentPage();
747 setMenuPaginacion();
748 controlDeMovimientos();
749 }
750
751 function paginationLeft(){
752 markCurrentPage();
753 if ((getCurrentURL().indexOf('categoryIds=')>0) || (getCurrentURL().indexOf('filter=')>0)){
754 window.location.href = getCurrentURL()+"&page="+(parseInt(pag_actual) - 1);
755 }else{
756 window.location.href = getCurrentURL()+"?page="+(parseInt(pag_actual) - 1);
757 }
758
759 }
760
761 function paginationRight(){
762 markCurrentPage();
763 if ((getCurrentURL().indexOf('categoryIds=')>0) || (getCurrentURL().indexOf('filter=')>0)){
764 window.location.href = getCurrentURL()+"&page="+(parseInt(pag_actual) + 1);
765 }else{
766 window.location.href = getCurrentURL()+"?page="+(parseInt(pag_actual) + 1);
767 }
768 }
769
770 /* Obtenemos el número de página en el que nos encontramos */
771 function markCurrentPage(){
772 pag_actual = getURLParameter('page');
773 if(pag_actual === undefined){
774 pag_actual = 1;
775 }
776 pag_actual = parseInt(pag_actual);
777 if(pag_actual > last){
778 pag_actual = last;
779 }
780 $("#page-num-"+pag_actual).addClass('cur-page');
781 }
782
783 /* Obtenemos la URL actual, sin el parametro de la paginación*/
784 function getCurrentURL(){
785 var currentURL = document.URL;
786 var arrayURL;
787 var url;
788
789 if (currentURL.indexOf('&page')>0){
790 arrayURL = currentURL.split('&page=');
791 url = arrayURL[0];
792 }else if(currentURL.indexOf('?page')>0){
793 arrayURL = currentURL.split('?page=');
794 url = arrayURL[0];
795 }else{
796 url = currentURL;
797 }
798 return url;
799 }
800
801 /* Controlamos la disponibilidad de los botones de avance y retroceso del menú. */
802 function controlDeMovimientos(){
803 if(last > elementos_menu){
804 if (pag_actual == first){
805 $('.pag-first,.pag-left').hide();
806 $('.pag-right,.pag-last').show();
807 }else if(pag_actual == last){
808 $('.pag-first,.pag-left').show();
809 $('.pag-right,.pag-last').hide();
810 } else{
811 $('.pag-first,.pag-left,.pag-right,.pag-last').show();
812 }
813 }else{
814 $('.pag-first,.pag-last').hide();
815 if (pag_actual == first){
816 $('.pag-left').hide();
817 $('.pag-right').show();
818 }else if(pag_actual == last){
819 $('.pag-left').show();
820 $('.pag-right').hide();
821 } else{
822 $('.pag-left,.pag-right').show();
823 }
824 if(first == last){
825 $('.pag-right,.pag-left').hide();
826 $('.elemento-pagination').hide();
827 }
828 }
829 }
830
831 /* En función de la página en la que nos encontremos establecemos las páginas visibles del menú. */
832 function setMenuPaginacion(){
833 if(pag_actual <= pcontrol){
834 first_visible = 1;
835 last_visible = 10;
836 }else{
837 first_visible = pag_actual - (pcontrol - 1);
838 last_visible = pag_actual + (elementos_menu - pcontrol);
839 if(last_visible > last){
840 last_visible = last;
841 first_visible = last - (elementos_menu -1);
842 if(first_visible < 1){
843 first_visible = first;
844 }
845 }
846 }
847
848 var i;
849 var x = $('.elemento-pagination');
850 x.each(function(){
851 $(this).hide();
852 });
853 for (i = first_visible; i <= last_visible; i++){
854 $('#page-num-'+i).css('display','inline-block');
855 }
856 }
857
858 /* Obtenemos el parametro de la URL que se corresponda con el nombre pasado por parametro. */
859 function getURLParameter(param){
860 var url = window.location.search.substring(1);
861 var urlVars = url.split('&');
862 for (var i = 0; i < urlVars.length; i++){
863 var paramName = urlVars[i].split('=');
864 if (paramName[0] == param){
865 return paramName[1];
866 }
867 }
868 }
869</script>
— 20 Resultados por página