[Chameleon] how to customize a widget?

McGraw, Joanne mcgrawj at AGR.GC.CA
Wed Nov 30 15:29:50 EST 2005


There also looks to be something out of whack with respect to the two
backslashes ('\') in the alert statement. I'm guessing there's supposed
to be a single quote (') after the first one, as in:

...?'alert(\'.$this->mszReport.'\')':;

-----Original Message-----
From: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Paul Spencer
Sent: Wednesday, November 30, 2005 3:21 PM
To: Sears, Jeremy
Cc: 'chameleon at lists.maptools.org'
Subject: Re: [Chameleon] how to customize a widget?

Hi Jeremy,

the ternary syntax is

$var = $bool ? $ifTrue : $ifFalse;

this line of code is missing the $ifFalse part obviously.  I'm not  
entirely sure what should be there, probably just "" ...

Cheers

Paul

On 30-Nov-05, at 2:55 PM, Sears, Jeremy wrote:

> Hi All,
> Im working thru the "developing a new chameleon widget" tutorial
> (http://chameleon-tiki.maptools.org/tiki-index.php? 
> page=HowtoCustomizeAnyWid
> get). I am following the instructions step-by-step and have  
> encountered a
> problem.
>
> The line: 	
> 	$szShowReport = strlen( $this->mszReport ) >
> 0?'alert(\.$this->mszReport.'\')':;
> Causes the following errors:
>
> 	Warning: Unexpected character in input: '\' (ASCII=92) state=1
in
> D:\ms4w\apps\chameleon\htdocs\widgets\UUW\UUW.widget.php on line 342
>
> Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in
> D:\ms4w\apps\chameleon\htdocs\widgets\UUW\UUW.widget.php on line 342
>
>
> Apparently Im not the first to encounter this. . .
> http://lists.maptools.org/pipermail/chameleon/2005-September/ 
> 002915.html
>
> However I couldnt find a solution.
> Can anyone advise?
>
> Best Regards
> Jeremy Sears
>
>
>
>
>
> -----Original Message-----
> From: Roland Martin [mailto:roland.w.martin at gmail.com]
> Sent: November 30, 2005 4:27 AM
> To: Sears, Jeremy
> Cc: chameleon at lists.maptools.org
> Subject: Re: [Chameleon] how to customize a widget?
>
>
> Hi Jeremy,
>
> I'm also pretty new to it, but I've successfully done a couple!
> (Although interestingly PrintProduction is one of the ones I've not
> had any success with - maybe you should start with an easy one like
> the LinkWidget?)
>
> First, follow this advice here:
> http://chameleon-tiki.maptools.org/tiki-index.php? 
> page=HowtoCustomizeAnyWidg
> et
>
> They key bits are where it tells you to change the links half way
> down. There's also a typo - the bit in your custom app (i.e. the
> 'index.phtml' page) should read:
> $oApp->CWCExecute( array( dirname(__FILE__)."/widgets" );
>
> This then ensures it looks in your directory first.
>
> Then it's just a matter of copying widget folders across wholesale to
> yours, and tweaking them till they work.
>
> I found php.net pretty handy for PHP help.
>
> Roland.
>
>
>
> On 29/11/05, Sears, Jeremy <Jeremy.Sears at ccrs.nrcan.gc.ca> wrote:
>>
>> Hi List,
>> Im am trying to customize the printproduction widget. My goal is to
> simplify
>> the user interface. I would like avoid the whole dialog thing.  
>> When a user
>> clicks the 'print' button they should get a map that has already been
>> created with their current viewing extent as the extent of the  
>> output map.
> I
>> have searched the documentation and this list's archives but  
>> cannot find
> any
>> references to customizing the printproduction widget. I have spent  
>> some
> time
>> the widgets and printproduction folders and have determined that the
>> following files are relavent to my task:
>>
>>     preview.php
>>     preview.phtml
>>     PrintProduction.en.ca.doc.xml
>>     PrintProduction.widget.php
>>     production.inc.php
>>     production.phtml
>>     production_download.phtml
>>     production_draw_legend.php
>>     session.inc.php
>>
>> I am quite new to php and am hoping that someone can point me to some
>> documentation related to this, offer advice on where to begin or  
>> let me
> know
>> that it is impossible/possible.
>>
>> Best Regards
>> Jeremy Sears
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: chameleon-bounces at lists.maptools.org
>> [mailto:chameleon-bounces at lists.maptools.org]On Behalf Of
>> Massimiliano Cannata
>> Sent: November 29, 2005 12:48 PM
>> To: chameleon at lists.maptools.org
>> Subject: [Chameleon] folder structure description...
>>
>> Hi folks, i'm preparing some documentation of Chameleon in Italian  
>> and
> would
>> like
>> to have a short description of what the folder are for.
>> Here is what I have understood (or not).
>> Please help me in filling or correcting my knowledge...
>>
>>
>> <!--[if !supportLists]-->/ms4w/apps/chameleon : installation  
>> folder (main
>> folder)
>> <!--[if !supportLists]-->/ms4w/apps/chameleon/config : contains
>> configuration file
>> (or just the application showing it with the URL
> localhost/chameleon/config/
>> ?)
>> <!--[if !supportLists]-->/ms4w/apps/chameleon/admin : (?);
>> <!--[if !supportLists]-->/ms4w/apps/chameleon/docs/ : various
> documentation
>> of Chameleon;
>> <!--[if
>> !supportLists]--><!--[endif]-->/ms4w/apps/chameleon/htdocs_admin/
>> : (?);
>> <!--[if !supportLists]-->/ms4w/apps/chameleon/samples/ : application
> sample;
>> <!--[if !supportLists]-->/ms4w/apps/chameleon/cwc2/ : CWC2 service  
>> files;
>> /ms4w/apps/chameleon/htdocs/ : teh core of the chameleon template:
> widgets,
>> skins, icons, etc..;
>> /ms4w/apps/chameleon/etc/ : here are the fonts;
>> /ms4w/apps/chameleon/utils/ : (?) wich kind of utilities? now just  
>> an xml
>> folder Thanks a lot for the help...
>> Maxi
>>
>> _______________________________________________
>> Chameleon mailing list
>> Chameleon at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/chameleon
>>
>>
>>
>
>
> --
> Please note my new email address. Use other addresses at your peril.
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
>

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|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