Switching to new wobject API.

This commit is contained in:
JT Smith 2003-03-08 19:26:01 +00:00
parent 4bed7d43db
commit 41cd27de26
22 changed files with 939 additions and 784 deletions

View file

@ -29,9 +29,6 @@ sub duplicate {
my ($w, $sth, $row);
$w = $_[0]->SUPER::duplicate($_[1]);
$w = WebGUI::Wobject::LinkList->new({wobjectId=>$w,namespace=>$_[0]->get("namespace")});
$w->set({
templateId=>$_[0]->get("templateId")
});
$sth = WebGUI::SQL->read("select * from LinkList_link where wobjectId=".$_[0]->get("wobjectId")
." order by sequenceNumber");
while ($row = $sth->hashRef) {
@ -51,8 +48,12 @@ sub new {
my $class = shift;
my $property = shift;
my $self = WebGUI::Wobject->new(
$property,
[qw(templateId)]
-properties=>$property,
-extendedProperties=>{
templateId=>{
defaultValue=>1
}
}
);
bless $self, $class;
}
@ -81,17 +82,11 @@ sub www_deleteLinkConfirm {
#-------------------------------------------------------------------
sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
my $bullet = $_[0]->get("bullet") || '·';
my $lineSpacing = $_[0]->get("lineSpacing") || 1;
my $indent = $_[0]->get("indent") || 5;
my $output = helpIcon(1,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(10,$_[0]->get("namespace")).'</h1>';
my $layout = WebGUI::HTMLForm->new;
my $properties = WebGUI::HTMLForm->new;
$layout->template(
-name=>"templateId",
-value=>$_[0]->get("templateId"),
-value=>$_[0]->getValue("templateId"),
-namespace=>$_[0]->get("namespace"),
-afterEdit=>'func=edit&wid='.$_[0]->get("wobjectId")
);
@ -104,19 +99,18 @@ sub www_edit {
-value=>"addLink"
);
}
$output .= $_[0]->SUPER::www_edit(
return $_[0]->SUPER::www_edit(
-properties=>$properties->printRowsOnly,
-layout=>$layout->printRowsOnly
-headingId=>10,
-helpId=>1
);
return $output;
}
#-------------------------------------------------------------------
sub www_editSave {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
$_[0]->SUPER::www_editSave({
templateId=>$session{form}{templateId}
});
$_[0]->SUPER::www_editSave();
if ($session{form}{proceed} eq "addLink") {
$session{form}{lid} = "new";
$_[0]->www_editLink();