working on new discussion system

This commit is contained in:
JT Smith 2003-07-12 22:33:18 +00:00
parent cb55619457
commit b84c79ab96
6 changed files with 357 additions and 3 deletions

43
lib/WebGUI/Forum.pm Normal file
View file

@ -0,0 +1,43 @@
package WebGUI::Forum;
use WebGUI::Forum::Thread;
use WebGUI::Session;
use WebGUI::SQL;
sub create {
my ($self, $data) = @_;
$data->{forumId} = "new";
my $forumId = WebGUI::SQL->setRow("forum","forumId",$data);
return WebGUI::Forum->new($forumId);
}
sub get {
my ($self, $key) = @_;
if ($key eq "") {
return $self->{_properties};
}
return $self->{_properties}->{$key};
}
sub getThread {
my ($self, $threadId) = @_;
unless (exists $self->{_thread}{$threadId}) {
$self->{_thread}{$threadId} = WebGUI::Forum::Thread->new($threadId);
}
return $self->{_thread}{$threadId};
}
sub new {
my ($self, $forumId) = @_;
my $properties = WebGUI::SQL->getRow("forum","forumId",$forumId);
bless {_properties=>$properties}, $self;
}
sub set {
my ($self, $data) = @_;
WebGUI::SQL->setRow("forum","forumId",$data);
$self->{_properties} = $data;
}
1;