source: trunk/spip/esqueleto-redcta/plugins/enviar_email/baliza_enviar_email.php @ 30

Last change on this file since 30 was 30, checked in by sebas, 17 years ago

nueva importacion del codigo del esqueleto de redcta con los plugins

File size: 1.8 KB
Line 
1<?php
2
3function preparar_enlace_enviar($arg){
4
5// funcion para ventana pop-up centrada en la pantalla
6$javascript_centrar_enviar = "<script language=\"JavaScript1.2\">
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('sobre.gif');
25                $url = generer_url_public('',$arg);
26               
27// prepara el enlace completo
28                $enlace = $javascript_centrar_enviar."<a href=\"javascript:;\" onClick=\"centrarVentana('$url','Enviar_documento','scrollbars=yes,resizable=yes','440','460','true')\" title=\"Enviar la referencia de este documento por email\" border=\"0\"><img src=\"$logo\" border=\"0\" /> Enviar por email</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
35function balise_ENVIAR_EMAIL($p) {
36
37// numero y enlace al artículo o breve
38        $_id_article = champ_sql('id_article', $p);
39        $arg = "'page=enviar_email_articulo&amp;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=enviar_email_breve&amp;id_breve='.".$_id_breve;
44                $url = generer_url_public('',$arg);
45        }
46   $p->code ="preparar_enlace_enviar($arg)";
47   $p->statut = 'html';
48   return $p;
49}
50
51?>
Note: See TracBrowser for help on using the repository browser.