[Chameleon] Re: Tutorial Developing new chameleon Widget - Problem

Delfos, Jacob Jacob.Delfos at maunsell.com
Mon Oct 23 19:32:26 EDT 2006


Ines,

This error can happen if you have spaces after "<<<EOT" (which it seems like you do). Try to remove them.

Also, I see you have declarations like:
$aReturn$szJsFunctionName = $szFunction;

This should be:
$aReturn[$szJsFunctionName] = $szFunction;

Hope that fixes things.

Jacob



» -----Original Message-----
» From: chameleon-bounces at lists.maptools.org 
» [mailto:chameleon-bounces at lists.maptools.org] On Behalf Of 
» Paul Spencer
» Sent: 24 October 2006 06:49
» To: Ines
» Cc: chameleon at lists.maptools.org Users
» Subject: [Chameleon] Re: Tutorial Developing new chameleon 
» Widget - Problem
» 
» Ines,
» 
» please use the mailing list to ensure maximum chance of getting a  
» useful response.
» 
» I know that there were some bugs in that code, and it seems to me  
» that this was one of them but I don't recall the resolution.   
» Hopefully someone else does!
» 
» Cheers
» 
» Paul
» 
» On 23-Oct-06, at 11:20 AM, Ines wrote:
» 
» > Hello, Paul Spencer, I'm trying to make my own widget whit this  
» > tutorial:
» > http://chameleon-tiki.maptools.org/tiki-index.php?page=Developing+a 
» > +new+Chameleon+Widget
» >
» > But I have some problem, when I add this code in the  
» > GetJavascriptFunctions(): Can you help me please?
» >
» > // show the report
» > $szShowReport = strlen( $this->mszReport ) > 0?"alert('".$this- 
» > >mszReport."')":"";
» > $szJsFunctionName = "showReport";
» > $szFunction = <<<EOT   
» > --------------------------------------------------->ERROR 
» in this line
» > function {$szJsFunctionName}()
» > {
» > {$szShowReport};
» > return true;
» > }
» > EOT;
» > $aReturn$szJsFunctionName = $szFunction;
» >
» > The error says:
» > Parse error: parse error, unexpected T_SL in D:\ms4w\apps\wmsviewer 
» > \htdocs\widgets\UUW\UUW.widget.php on line 342
» >
» > This is my complete "GetJavascriptFunctions() " in UUUW.widget.php:
» >
» >
» > function GetJavascriptFunctions()
» >     {
» >         // init vars
» >         $aReturn = parent::GetJavascriptFunctions();
» >
» >         // show the report
» >                 $szShowReport = strlen( $this->mszReport ) >  
» > 0?"alert('".$this->mszReport."')":"";
» >                 $szJsFunctionName = "showReport";
» >                 $szFunction = <<<EOT
» >                 function {$szJsFunctionName}()
» >                 {
» >                    {$szShowReport};
» >                    return true;
» >                 }
» >                 EOT;
» >                 $aReturn$szJsFunctionName = $szFunction;
» >
» >
» >         // return
» >         return $aReturn;
» >
» >     // end GetJavascriptFunctions() function
» >     }
» >
» >
» > Can You help me width this? Thank You very much
» >
» > Ma. Inés Etchichury - Argentina
» >
» >
» 
» +-----------------------------------------------------------------+
» |Paul Spencer                          pspencer at dmsolutions.ca    |
» +-----------------------------------------------------------------+
» |Chief Technology Officer                                         |
» |DM Solutions Group Inc                http://www.dmsolutions.ca/ |
» +-----------------------------------------------------------------+
» 
» 
» 
» 
» 
» _______________________________________________
» Chameleon mailing list
» Chameleon at lists.maptools.org
» http://lists.maptools.org/mailman/listinfo/chameleon
» 



More information about the Chameleon mailing list