[Cartoweb-users] Newbie plugin question

Oliver Christen oliver.christen at camptocamp.com
Mon Jul 30 08:43:35 EDT 2007

> Hello list!
> I am new here. I am a Mapserver specialist currently involved with a
> mapserver/cartoweb3 implementation for a client. I picked up a project
> done on an internship.
> I have a question:
> Within myProject there is a plugin called views. It is called from a
> button bar within a cartoclient.php that is present in my project by the
> variable $viewForm.
> I want to copy the views plugin and fit it to my specific needs called
> "advisors". The "advisors" plugin will walk users through some sort of
> wizard (a sequence of screens) where they fill in variables that will
> later generate a query.

you dont need to copy it (and I wouldnt advice it either as it would most
certainly cause some conflict) but simply create a new plugin which will
extend it.
simply add the replacePlugin function and the methods you want to override
or add some new ones.

> Is this possible from within a popup that slides from the bottom of the
> screen or is it advised to use a floating form?

Both are possible option but I would suggest use ajax and div elements (that
can slides from the bottom as you said).
See http://www.cartoweb.org/cwiki/HowToAjaxablePlugin for implementing ajax
This way you can handle as many "steps" in your wizard as you need without
having side effect on the rest of the map stats.

> How can I call my plugin template from a button in a way that is like the
> way the {$viewForm) parameter acts?

You want to start the wizard when the user clic on that button ?
Simply add a button input in your plugin template and activate this template
element from the renderForm function of the plugin.

simple example:
{if $wizard}
<input type="button" ... />
in template

$template->assign('wizard', true);
in renderForm function

Have a look at other plugins to grasp the concept and how things works.
The schema http://www.cartoweb.org/doc/misc/plugins_diagram.pdf also helps a 


> Any help appreciated!
> Kind regards,
> -- 
> Milo van der Linden
> mlinden at zeelandnet.nl
> milovanderlinden at gmail.com
> milo at 3dsite.nl
> http://www.3dsite.nl
>  De informatie in dit bericht reflecteerd mijn persoonlijke mening en niet
> die van een bedrijf of instantie. Aan de informatie kunnen geen rechten
> worden ontleend. Indien dit bericht onderdeel is van een forum,
> mailing-list of community dan gelden automatisch de bijbehorende
> voorwaarden.
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users

More information about the Cartoweb-users mailing list