1 | <?php |
---|
2 | |
---|
3 | function preparar_enlace_imprimir($arg){ |
---|
4 | |
---|
5 | // funcion para ventana pop-up centrada en la pantalla |
---|
6 | $javascript_centrar_imprimir = "<script type=\"text/javascript\"> |
---|
7 | /* |
---|
8 | Open Centered Popup Window Script- |
---|
9 | DHTMLShock (www.dhtmlshock.com) |
---|
10 | To add more shock to your site, visit www.DHTMLShock.com |
---|
11 | */ |
---|
12 | function centrarVentana(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0 |
---|
13 | if(window.screen)if(isCenter)if(isCenter==\"true\"){ |
---|
14 | var myLeft = (screen.width-myWidth)/2; |
---|
15 | var myTop = (screen.height-myHeight)/2; |
---|
16 | features+=(features!='')?',':''; |
---|
17 | features+=',left='+myLeft+',top='+myTop; |
---|
18 | } |
---|
19 | window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight); |
---|
20 | } |
---|
21 | </script>"; |
---|
22 | |
---|
23 | // prepara logo |
---|
24 | $logo = find_in_path('impresora.gif'); |
---|
25 | $url = generer_url_public('',$arg); |
---|
26 | |
---|
27 | // prepara el enlace completo |
---|
28 | $enlace = $javascript_centrar_imprimir."<a href=\"javascript:;\" onclick=\"centrarVentana('$url','Imprimir_documento','scrollbars=yes,resizable=yes','700','470','true')\" title=\""._T('imprimirdocumento:version_doc_imprimir')."\" style=\"border:none\"><img src=\"$logo\" style=\"border:none\" alt=\""._T('imprimirdocumento:version_doc_imprimir')."\" /> "._T('imprimirdocumento:version_imprimir')."</a>"; |
---|
29 | return $enlace; |
---|
30 | |
---|
31 | } |
---|
32 | |
---|
33 | // la baliza a llamar como #ENVIAR_EMAIL** (importante los dos asteriscos para que funcione el javascript anterior de centrar la ventan por-up) |
---|
34 | |
---|
35 | function balise_IMPRIMIR_DOCUMENTO($p) { |
---|
36 | |
---|
37 | // numero y enlace al artï¿œulo o breve |
---|
38 | $_id_article = champ_sql('id_article', $p); |
---|
39 | $arg = "'page=imprimir_articulo&id_article='.".$_id_article; |
---|
40 | $url = generer_url_public('',$arg); |
---|
41 | if (!$_id_article){ |
---|
42 | $_id_breve = champ_sql('id_breve', $p); |
---|
43 | $arg = "'page=imprimir_breve&id_breve='.".$_id_breve; |
---|
44 | $url = generer_url_public('',$arg); |
---|
45 | } |
---|
46 | $p->code ="preparar_enlace_imprimir($arg)"; |
---|
47 | $p->statut = 'html'; |
---|
48 | return $p; |
---|
49 | } |
---|
50 | |
---|
51 | ?> |
---|