Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
  1.  # 1
    I'm thinking of extending DiscussionForm with all the Event related form elements.
    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.
    •  
      CommentAuthorWallPhone
    • CommentTimeOct 24th 2007
     # 2
    You can use the object factory to override the vanilla classes with your own. You have to set a new class reference but I've never seen a live example of this done. Also note the limitations listed in the section below that.
  2.  # 3
    Discussion overview actually does this. he (jazzman) references the DiscussionGrid class with his own class. he doesn't however, extend or overwrite the DiscussionGrid class.

    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();
    }
    • CommentAuthorMark
    • CommentTimeOct 25th 2007
     # 4
    Can't you just access the SaveDiscussion/Comment/Reply in the methods themselves? Use delegates within? If they don't exist, you can always ask for new delegates.
  3.  # 5
    One more thing what should be type of EventRolePermission field in the database. Should it be a comma separated field like 3,4 which means Moderators and admins, or is their a better way.
Add your comments
    Username Password
  • Format comments as