[TYPO3-dev] Using Commas in Constant Editor Dropdown

Steffen Kamper steffen at sk-typo3.de
Tue Jul 24 23:37:35 CEST 2007


"Elmar Hinz" <elmar07 at googlemail.com> schrieb im Newsbeitrag 
news:mailman.1.1185308318.29024.typo3-dev at lists.netfielders.de...
> Jeff Segars wrote:
>
>> Does anyone know if its possible to use use the comma character in a
>> Constant Editor dropdown list?
>>
>> In my extension, I'm defining several options with the following
>> Typoscript # cat=constants.wec//k; type=options[October 22 2007=%B %d
>> %Y, ...]; label = Date FormatdateFormat = %B %d %Y
>>
>> I'd like change this to October 22, 2007 instead (note the comma), but
>> thats where my problems come in :)
>>
>> In t3lib_tsparser_ext->ext_getTypeData(), its hardcoded to expect the
>> comma as a separator between options.  I tried using an HTML entity
>> for the comma instead, but semicolons are also used as separators so
>> that doesn't work.
>>
>> Any suggestions on how to get around either of these limitations or
>> should I give up on getting a comma into my Constant Editor
>> definitions?
>>
>> Thanks!
>> Jeff
>
> Hi Jeff,
>
> I don't have a solution for you. If commas and semicolon are used to
> separate the fields, I don't know a workaround.
>
> Let's ask for the clean way. Commas and semicolons point into the 
> direction
> of CSV data with escaping options for the separtors. I conclude that CSV
> like escaping would belong into the method
> t3lib_tsparser_ext->ext_getTypeData() to remove that limitations.
>
> Patching? XCLASS?
>
> Regards
>
> Elmar
>
>
Hi Jeff and Elmar,

i like the idea of excluding masked signs, so i found a solution as replace 
for the simple explode:

instead
explode(';',$string)
i use now:
preg_split('/(?<!\\\\);+/',$string);

which does the same excluding \;

vg  Steffen

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 






More information about the TYPO3-dev mailing list