[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}";
    window.onload = function() {
      if (result == "1") {
        myContent =  document.getElementById("result").innerhtml;
        window.open('', 'popuppage',
         popuppage.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
            '<html><head><title>My window</title></head><body>' + myContent
+ '</body></html>')       }

in the body:

<div id="result" style="display:none;">

this is untested but it may work ^^

Oliver Christen

>I would like that the results of the requests appear in a new page, style
>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