EventForm clone of DiscussionForm
I'm thinking of extending DiscussionForm with all the Event related form elements.
I can start by
and then write my own event_discussion_form.php file
However, how will i tell vanilla if an event is being added then it should use my version of discussion_form and not the default one.
Plus is this even a good idea, or should i resort to delegations.
I can start by
class EventForm extends DiscussionForm
and then write my own event_discussion_form.php file
However, how will i tell vanilla if an event is being added then it should use my version of discussion_form and not the default one.
Plus is this even a good idea, or should i resort to delegations.
0
This discussion has been closed.
Comments
Now if i extend the DiscussionForm, and don't overwrite its functions. this way i won't break any extensions that rely on DiscussionForm class.
any thoughts before i attempt to do this.
Btw DiscussionForm should have functions of SaveDiscussion, SaveComment, Reply, etc right now it does everything in the constructor. If I now want to extend SaveDiscussion part of the constructor, I cannot. Something like this would be better
if ($this->PostBackAction == 'SaveDiscussion') { $this->SaveDiscussion(); } else if ($this->PostBackAction == 'SaveComment') { $this->SaveComment(); } else if ($this->PostBackAction == 'Reply') { $this->Reply(); }