[Chameleon] Help on extending QueryResults in the Query Widget

William Bronsema wbronsema at dmsolutions.ca
Thu Aug 30 08:26:24 EDT 2007

Hi Nelson,

You need to add the following to the top of the test_query.phtml page:


// define the path to the chameleon root fold (include closing "/")
define( 'CHAMELEON_PATH', '/ms4w/apps/chameleon/htdocs/' );

// set the flag to setup the mapsession
if ( !defined("LOAD_MAPSESSION") )
    define("LOAD_MAPSESSION", 1);

include( CHAMELEON_PATH.'/widgets/session.inc.php' );
include_once( CHAMELEON_PATH."/widgets/CWC2ButtonCache.php" );


This will let you add the style line:

<link href="<?php echo $szCSSFile; ?>" rel="stylesheet" type="text/css">

Hope that helps.


William Bronsema
Senior Applications Specialist
DM Solutions Group Inc.


-----Original Message-----
From: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of LITTLE Nelson
Sent: Wednesday, August 29, 2007 9:23 PM
To: chameleon at lists.maptools.org
Subject: [Chameleon] Help on extending QueryResults in the Query Widget

Hi all,

Some background: 

I am trying to extend the Query widget by manipulating the formatValue()
function in QueryResults.phtml. Basically I search the $value for a
special value (eg "more_info://") and if that value is found I then
manipulate the $retVal to be something like:

<a ref="test_query.phtml?mac=blah" target="_new">link</a>

This allows for the above embedded link to appear in the Query Results
page which the user can now click to give more detailed results.

So far so good...


I wish the test_query.phtml to have the same look and feel as the
QueryResults.phtml page for consistency. How do I go about this? I
notice that in the construction of the QueryResults.phtml page it uses
things like:

1. <title><?php echo $oMLT->get( 'QueryResults', '3', 'Query Results' );

2. <link href="<?php echo $szCSSFile; ?>" rel="stylesheet"

3. <script language="JavaScript" src="<?php echo
$_SESSION['gszCoreWebPath']; ?>/widgets/js/cwc_dhtml.js"

4. $szHTML .= makeButton( 'closeWindow', '', 'Query',
"images/icon_close.png", $oMLT->get( 'common', 'Close', 'Close' ),
$oMLT->get( 'common', 'CloseTip', 'Close Dialog' ), array( 'width' => 75
) );

How do I incorporate those things in my "test_query.phtml" page? 

Any help most gratefully appreciated.


Disclaimer :
The contents of this e-mail including any attachments are intended only
for the person or entity to which this e-mail is addressed.  If you are not,
or believe you may not be, the intended recipient, please advise the sender
immediately by return e-mail, delete this e-mail and destroy any copies.
Tenix does not warrant nor guarantee that this email communication is free
from errors, virus, interception or interference.

Chameleon mailing list
Chameleon at lists.maptools.org

More information about the Chameleon mailing list