Subject: Developers of Sympa
List archive
- From: Mark Valiukas <address@concealed>
- To: Olivier Salaun - CRU <address@concealed>
- Cc: address@concealed
- Subject: Re: categorisation / code design
- Date: Wed, 25 Feb 2004 12:55:27 +1100
Olivier Salaun wrote:
Then you'll have to extend the number of arguments for the DISTRIBUTE mail command.
That's what I was thinking.
This parameter would be defined as follows in the %List::pinfo hash (title_id entries are incorrect) :
Thank you for this, it's great. I'm really beginning to appreciate how
well sympa seems to have been designed for extensibility. I've set
'group' => 'categorisation' here, and have added links to it in
admin_menu.tpl and edit_list_request.tpl as I think this should be
accessed as an item under "Edit List Config" unless you can suggest a
better location.
I'm having a little problem though.
'keywords' =>{'format' => '[^,]+', # Everything BUT a ','
'occurrence' => '1-n',
Okay, this will save multiple 'keywords' items.
This is causing me a little grief - the multiple instances of 'keywords'.
edit_list_request.tpl doesn't handle 'keywords' occurring more than once
- when set to occur once, it displays and saves okay. When set to occur
one or more times, the keywords field shows as something like "
ARRAY(0x8ff816c)" (which is not that surprising as we're trying to view
an array as a scalar, I guess, and thus see where it is rather than what
it contains).
I think I need to modify edit_list_request.tpl to accomodate this,
around the section starting at "<!-- Scalar -->". I think I need to
modify this to check for multiple occurrances of any sub-part and allow
their display and entry as separate items. I can't quite get my head
around this, but I'm hoping a re-read of the parser code and the template
documentation will help with this.
However, I don't believe this is entirely satisfactory - the entry and
display of a comma-delimited list is what we were discussing, rather than
individual keyword items inside a category. I think a comma-delimited field
for entry and display would be appropriate, as it allows several items to
be entered at once and a whole lot to be replaced in one action. Correct me
if I'm wrong, but I don't think there's anything in sympa at present
that requires the handling or display of a comma delimited list.
As far as I can tell, this would require some extra code to determine
how the form fields being passed back are to be handled and take
appropriate action with them (feed them directly, or split then feed)
An alternative approach - which requires no recoding of
edit_list_request.tpl - is to just use a single keywords field
for each category. This would involve setting "'occurrence' => '1'"
for keywords, and splitting individual keywords off in whatever code uses them. I think it would be better to have the keyword items
as individual elements in the hash though.
I'll play with this a little more this afternoon; I'm sure there's something
I'm just not seeing.
Cheers,
Mark.
-
Re: categorisation / code design,
Mark Valiukas, 02/25/2004
- Re: [sympa-dev] Re: categorisation / code design, Olivier Salaun - CRU, 02/25/2004
Archive powered by MHonArc 2.6.19+.