[Cartoweb-users] About Query

oliver oliver.christen at camptocamp.com
Thu Jun 16 08:26:12 EDT 2005


One possibility i see, before trying to modify the php, would be to set a
javascript variable in the template via smarty and use a javascript function
to launch a popup depending of the value.
Leave the query result in your main page but in a hidden element, then copy
the content of that hidden element in the popup via javascript.

something like :
-------------------------
in your main page header:

<script language="JavaScript" type="text/javascript">
    <!--
  var result = "{if $tables_result|default:'0'}'1'{/if}";
  {literal}
    window.onload = function() {
      if (result == "1") {
        myContent =  document.getElementById("result").innerhtml;
        window.open('', 'popuppage',
'toolbar=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=yes,co
pyhistory=no,width=300,height=400');
         popuppage.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN""http://www.w3.org/TR/html4/strict.dtd">'+
            '<html><head><title>My window</title></head><body>' + myContent
+ '</body></html>')       }
    }
    {/literal}
    //-->
  </script>

-----------
in the body:

<div id="result" style="display:none;">
              {$tables_result}
 </div>

this is untested but it may work ^^

Regards
Oliver Christen

>Hello,
>
>I would like that the results of the requests appear in a new page, style
>popup.
>Should I modify a template?  Or is it necessary to modify the php code of
>one of the plugins query, Mapquery or Tables?
>
>Thanks for your answers !
>
>Fred B



More information about the Cartoweb-users mailing list