source: spip-zone/_plugins_/imprimir_documento_2/baliza_imprimir_documento.php @ 52912

Last change on this file since 52912 was 27912, checked in by joseluis@…, 11 years ago

y también imprimir_documento para spip 2

  • Property svn:eol-style set to native
File size: 1.6 KB
Line 
1<?php
2
3function 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               
26                $url = generer_url_public('',$arg);
27
28// "'page=imprimir_articulo&amp;id_article='.".
29               
30// prepara el enlace completo
31                $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>";
32                return $enlace;
33
34}
35
36function balise_IMPRIMIR_DOCUMENTO($p) {
37
38        if ($GLOBALS['contexte']['id_breve'] == "") { 
39        $arg="'page=imprimir_articulo&amp;id_article='.".champ_sql('id_article', $p);
40        }
41        else {
42        $arg="'page=imprimir_breve&amp;id_breve='.".champ_sql('id_breve', $p);
43        }
44
45   $p->code ="preparar_enlace_imprimir($arg)";
46   $p->statut = 'html';
47
48   return $p;
49}
50
51?>
Note: See TracBrowser for help on using the repository browser.