[Cartoweb-users] Problem ini file parsing and question aboutswitches

Oliver Christen oliver.christen at camptocamp.com
Mon Apr 16 08:51:44 EDT 2007


well, the problem come from the loadFromArray function (defined in 
Structhandler.php, called from ClientExportPdf.php)
this function try to convert a string like foo.1.bar into a object hierarchy 
like foo->1->bar and it doesnt like at all "->1" (in this exemple)

so I would suggest you simlpy modify the setPdfObjects function in 
ClientExportPdf.php to feed the function a modified $ini_array, where you 
would have removed the extra parameters you added with the syntax 
foo.numericvalue.bar

this way you can add as many extra parametesr you want with the 
foo.numericvalue.bar syntax without having side effect on the normal 
exportPdf code

by the way, it is perfectly normal your cExportPdf.ini is ignored, from 
cartoweb point of view, you are using the exportPdf plugin. You would have 
the same problem if you added, css, js or images, You would have to put them 
in the exportPdf folder.

I hope this help
regards
Oliver

> Hello Alexandre,
>
> that's my my plan. However, I can not figure out, how / where to add the 
> additional keys. If I add them to exportPdf.ini (as proposed in the 
> documentation), I get the error message. If I add them to cExportPdf.ini 
> (cExportPdf is my plugin, which extends / replaces exportPdf) the entries 
> are not available.
>
> I can not figure out, how the ini files are handled. For example, in 
> location.ini or locate.ini, entries like
>
> scales.0.label = 500
> scales.0.value = 500
> scales.0.visible = true
>
> work, but if I use similar entries with a number in exportPdf, they do not 
> work. How do I tell my plugin to read such kind of entries correctly 
> without changing the original exportPdf plugin too much?
>
>
> Regards,
> Dirk
>
>
>>> The simple problem that I can not solve is: How do I get my extended 
>>> plugin to read the additional configuration entries so I can use them 
>>> within the Client class?
>>
>> Have you tried to adapt the following code, available in 
>> ClientLocate.php:
>>
>>         $locate = ConfigParser::parseObjectArray($this->getConfig(), 
>> 'locate',
>>                         array('id', 'sql'));
>>
> _______________________________________________
> 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