[Chameleon] flaw in new MLT design?

Eijnden, B. van den (Bart) b.vdeijnden at agi.rws.minvenw.nl
Fri Mar 17 07:01:27 EST 2006


Hi list,

I think I have run into a flaw in the new MLT design.

If you make a widget which extends an existing widget, and the widget file
contains MLT code, it seems impossible to get the text internationalized.

For instance, I have a widget called GeoservicesClearWFSFilter, which
extends ClearWFSFilter. The right language file is read and put into the
array, but the keys in the array are called GeoservicesClearWFSFilter
ofcourse (the widget name).

My widget file is minimal:

include_once(CHAMELEON_PATH."/widgets/ClearWFSFilter/ClearWFSFilter.widget.p
hp");

/**
 * GeoservicesClearWFSFilter
 */
class GeoservicesClearWFSFilter extends ClearWFSFilter
{
}

But the ClearWFSFilter widget tries to read with a key named ClearWFSFilter,
and therefore finds nothing in the MLT array:

$szNoFilterMessage = $this->moMLT->get( 'ClearWFSFilter', '1', 'There is no
filter to clear.' );

The only solution I see for this is to use:

$szNoFilterMessage = $this->moMLT->get( $this->mszWidgetName, '1', 'There is
no filter to clear.' );

Otherwise the MLT system cannot deal with widget inheritance .....

This will require quite some changes though in the Chameleon code base :-(
.......

Thanks in advance.

Best regards,
Bart




Disclaimer
************************************************************************
Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te 
informeren. Wij adviseren u om bij twijfel over de juistheid of de 
volledigheid van de mail contact met afzender op te nemen.

This message shall not constitute any rights or obligations.
This message is intended solely for the addressee.
If you have received this message in error, please delete it and
notify the sender immediately. When in doubt whether this message
is correct or complete, please contact the sender.
************************************************************************



More information about the Chameleon mailing list