[Chameleon] MLT.php - bug or correct code?
McGraw, Joanne
mcgrawj at AGR.GC.CA
Thu Sep 29 09:53:56 EDT 2005
Hi Bill,
Thanks for the response. This isn't the problem, though. My columns are named EN_CA and FR_CA. This is proven by simply changing the array key to uppercase in the mlt object's loadresource(). That change alone results in that dBase file working as is.
Are you aware of any reasons why that particular array key isn't uppercase in that function? All the other ones around it that seem to be doing the same thing are.
Cheers,
jtm
-----Original Message-----
From: William Bronsema [mailto:wbronsema at dmsolutions.ca]
Sent: Thursday, September 29, 2005 9:16 AM
To: McGraw, Joanne; chameleon at lists.maptools.org
Subject: RE: [Chameleon] MLT.php - bug or correct code?
Hi Joanne,
Unfortunately you are encountering a few "quirks" in the MLTdBASE class and
how it interacts with Chameleon.
My guess is that it is the structure of your dbase file that might be the
problem. The columns should be called "EN_CA" and "FR_CA" etc. Note the
caps and underscore. This is part of the reason why the current development
version of Chameleon has moved to a better MLT system.
Let me know if that fixes the problem.
Cheers,
Bill
________________________________________________
William A. Bronsema, C.E.T.
Software & Applications Development,
DM Solutions Group Inc.
> -----Original Message-----
> From: chameleon-bounces at lists.maptools.org [mailto:chameleon-
> bounces at lists.maptools.org] On Behalf Of McGraw, Joanne
> Sent: Wednesday, September 28, 2005 4:58 PM
> To: chameleon at lists.maptools.org
> Subject: [Chameleon] MLT.php - bug or correct code?
>
>
> I instantiated and loaded a new MLTdBase object, but could never find the
> corresponding language for a key value in it until I made the following
> change to mlt.php. Is it possible that line 357 in mlt.php is supposed to
> be (notice the two 'strtoupper' functions, rather than just the one):
>
> $this->aszMLT[trim($aRec["KEY"])][strtoupper($mLang)] =
> $aRec[strtoupper($mLang)];
>
> What is currently there is:
> $this->aszMLT[trim($aRec["KEY"])][$mLang] = $aRec[strtoupper($mLang)];
>
> --OR--
>
> Perhaps there was something more I was supposed to be doing in my code for
> the code to work as it was written. I have the following:
>
> $szLang = $_SESSION["gszCurrentLanguage"] ; // "en-CA";
> $myMLT = new MLTdBase($szLang);
> $myMLT->loadresource($szLanguageResource, $szLang);
> echo $myMLT->get("0", "Blah");
>
> It should have been displaying "Help" (or "Aide", if $szLang was "fr-CA").
> It wasn't finding any corresponding record though, until I made the above
> change.
>
>
> Is this a bug or do I need to do something more in my code?
>
> Cheers,
> jtm
>
>
> Joanne T. McGraw
> Spatial Data Visualization Specialist / Spécialiste en visualisation des
> données spatiales
> Agriculture and Agri-Food Canada / Agriculture et Agroalimentaire Canada
> Telephone/Téléphone: (613) 759-6103
> Facsimile/Télécopieur: (613) 759-1937
> 960 Carling Ave, #1136
> Ottawa, Ontario
> K1A 0C6
>
> mcgrawj at agr.gc.ca
>
>
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
More information about the Chameleon
mailing list