[TYPO3-dev] Filter and mapping for Array

Dr. Ronald P. Steiner Ronald.Steiner at googlemail.com
Fri Feb 29 07:35:55 CET 2008


Hi group,

this question is not about programming or coding but about logic, ideas 
and brainstorming.

Situation:
I'm programming an extension that covers most functionality of tt_news 
but includes more flexibility for displaying various database tables. 
The first start was the purpose to create an DAM-Gallery. Now various 
data can be displayed.

Anyway, here my question:
I read an database table into an 2D-array:
0 {
    title = test title
    description = a test description
    image_file = file.jpg
}
1 {
    title = test title 2
    description = a test description
    image_file = file2.jpg
}
...

Now:
1)
I want to give some possibility to filter this array. How would a 
BE-User want to input filter rules? I played around with:
filter = exclude
filter {
    field = image_file
    method = regex or lte for lower then, gte, lt, gt
    rule = /some regular expression/i or some number if lte, gte, ...
}
But I think this is a ugly way to select how to filter data. Has anybody 
done something similar in a more elegant way? Is there any extension 
that does something similar in a more elegant way?

2)
Same way I want to give the BE-user possibility to ad data. The way I'm 
doing it now is to allow him to create an TS-ARRAY in each element there 
is again a filter to define where the information should be added.
0 {
    filter = include
    filter {
       method = regex
       field = image_file
       rule = /some regex defining where this information should be added/i
    }
    additional_title = some example title
}
1 {
    filter = include
    filter {
       method = regex
       field = image_file
       rule = /some other regex defining where this information should 
be added/i
    }
    additional_description = some example description
}
Again this works but is indeed not elegant at all. Has someone 
spontaneously a good Idea or an hint?

Would be great if you could just share some ideas / brainstorming.

greetings

Ron




More information about the TYPO3-dev mailing list