Several enhancements to the wobject architecture.

This commit is contained in:
JT Smith 2002-05-14 01:15:10 +00:00
parent 62b2066a85
commit b491e0f922
3 changed files with 9 additions and 7 deletions

View file

@ -207,7 +207,10 @@ sub page {
$wobject = \%hash; $wobject = \%hash;
$cmd = "WebGUI::Wobject::".${$wobject}{namespace}; $cmd = "WebGUI::Wobject::".${$wobject}{namespace};
$w = $cmd->new($wobject); $w = $cmd->new($wobject);
$contentHash{${$wobject}{templatePosition}} .= '<a name="'.${$wobject}{wobjectId}.'"></a>'.$w->www_view."<p>\n\n"; if ($w->inDateRange) {
$contentHash{${$wobject}{templatePosition}} .= '<a name="'.${$wobject}{wobjectId}.'"></a>'
.$w->www_view."<p>\n\n";
}
} }
$sth->finish; $sth->finish;
$cmd = "use WebGUI::Template::".$session{page}{template}; $cmd = "use WebGUI::Template::".$session{page}{template};

View file

@ -145,7 +145,7 @@ sub get {
=cut =cut
sub inDateRange { sub inDateRange {
if ($_[0]->get("startDate") < time() && $_[0]->get("startDate") > time()) { if ($_[0]->get("startDate") < time() && $_[0]->get("endDate") > time()) {
return 1; return 1;
} else { } else {
return 0; return 0;

View file

@ -105,15 +105,14 @@ sub www_edit {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub www_editSave { sub www_editSave {
my ($attachment); my ($attachment, $property);
if (WebGUI::Privilege::canEditPage()) { if (WebGUI::Privilege::canEditPage()) {
$_[0]->SUPER::www_editSave(); $_[0]->SUPER::www_editSave();
$attachment = WebGUI::Attachment->new("",$_[0]->get("wobjectId")); $attachment = WebGUI::Attachment->new("",$_[0]->get("wobjectId"));
$attachment->save("attachment"); $attachment->save("attachment");
$_[0]->set({ $property->{linkURL} = $session{form}{linkURL};
linkURL=>$session{form}{linkURL}, $property->{attachment} = $attachment->getFilename if ($attachment->getFilename ne "");
attachment=>$attachment->getFilename $_[0]->set($property);
});
return ""; return "";
} else { } else {
return WebGUI::Privilege::insufficient(); return WebGUI::Privilege::insufficient();