Forum .LRN Q&A: Re: General Comments and ZEN

Collapse
Posted by Malte Sussdorff on
Be it as it may, I am dealing with the fact that the datastorage is different as are after submit action, the labeling of the AD Form is different and with forums you have the option to extend the entry fields per form, which is something not needed in general comments.

So what I will do is write a page with an ad_form which allows you to enter a Subject, a Text which is stored in general comments along with a file that is attached to it. I will *NOT* copy forums anymore

a) Because then I would have to explain why I did it 😊
b) It is probably more work to rip the forums specific code out of post.tcl then to create comment-add.tcl from scratch.

In an ideal world we would only have *one* include which can be included everywhere which we just give the object type and it will generate me the entry form based on acs-attributes. But this is something to get once we have a clarification on adding dynamic types and the like, not for single page with three entry items in general comments. Not to mention the fact that you might do some code after processing dependent on type before saving it in the database (though that could be handled with user exits / callbacks).

One question Dave: What is the logic behind file.vuh and image.vuh in acs-subsite, or, better asked, why do we mount acs-content-repository in the first place if the code is duplicated in acs-subsite?

And with regards to attach-file / attach-image, I think the goal for general comments is different. I am going to use the file-upload widget in case there does not exist Javascript enabled richtext, and then reuse content::item::new with the tmp_filename switch to attach the file to the comment and append the code for accessing this file (read f_href in attach-file) at the bottom of the code. No need for extensive sharing of the file and reuseability, as it is after all "just" an attachment.

What I do not like about the general comments package in contrib as an example: It does not allow you to preview the comment. So this is code which I will reuse from post.tcl as this is actually a place where I think it is decently solved. It also needs some serious cleaning up, so it might be quicker to write it from scratch (most of the files currently in there would go down the drain). I will reuse the commant-add-edit* code though and remove all the unnecessary pages.