Formatting and general code cleanup to reduce redundancy and increase readability.
This commit is contained in:
parent
d309be32f5
commit
65de90cbb5
17 changed files with 910 additions and 1103 deletions
|
|
@ -78,43 +78,37 @@ sub set {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
my ($output, $f, $indent, $bullet, $lineSpacing);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$indent = $_[0]->get("indent") || 5;
|
||||
$bullet = $_[0]->get("bullet") || '·';
|
||||
$lineSpacing = $_[0]->get("lineSpacing") || 1;
|
||||
$output = helpIcon(1,$_[0]->get("namespace"));
|
||||
$output .= '<h1>'.WebGUI::International::get(5,$namespace).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->yesNo("displaySynopsis",WebGUI::International::get(9,$namespace),$_[0]->get("displaySynopsis"));
|
||||
$f->yesNo("startAtThisLevel",WebGUI::International::get(3,$namespace),$_[0]->get("startAtThisLevel"));
|
||||
$f->integer("depth",WebGUI::International::get(4,$namespace),$_[0]->get("depth"));
|
||||
$f->integer("indent",WebGUI::International::get(6,$namespace),$indent);
|
||||
$f->text("bullet",WebGUI::International::get(7,$namespace),$bullet);
|
||||
$f->integer("lineSpacing",WebGUI::International::get(8,$namespace),$lineSpacing);
|
||||
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
$indent = $_[0]->get("indent") || 5;
|
||||
$bullet = $_[0]->get("bullet") || '·';
|
||||
$lineSpacing = $_[0]->get("lineSpacing") || 1;
|
||||
$output = helpIcon(1,$_[0]->get("namespace"));
|
||||
$output .= '<h1>'.WebGUI::International::get(5,$namespace).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->yesNo("displaySynopsis",WebGUI::International::get(9,$namespace),$_[0]->get("displaySynopsis"));
|
||||
$f->yesNo("startAtThisLevel",WebGUI::International::get(3,$namespace),$_[0]->get("startAtThisLevel"));
|
||||
$f->integer("depth",WebGUI::International::get(4,$namespace),$_[0]->get("depth"));
|
||||
$f->integer("indent",WebGUI::International::get(6,$namespace),$indent);
|
||||
$f->text("bullet",WebGUI::International::get(7,$namespace),$bullet);
|
||||
$f->integer("lineSpacing",WebGUI::International::get(8,$namespace),$lineSpacing);
|
||||
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editSave {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
my ($property);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$_[0]->SUPER::www_editSave();
|
||||
$property->{indent} = $session{form}{indent};
|
||||
$property->{displaySynopsis} = $session{form}{displaySynopsis};
|
||||
$property->{bullet} = $session{form}{bullet};
|
||||
$property->{startAtThisLevel} = $session{form}{startAtThisLevel};
|
||||
$property->{depth} = $session{form}{depth};
|
||||
$property->{lineSpacing} = $session{form}{lineSpacing};
|
||||
$_[0]->set($property);
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
$_[0]->SUPER::www_editSave();
|
||||
$property->{indent} = $session{form}{indent};
|
||||
$property->{displaySynopsis} = $session{form}{displaySynopsis};
|
||||
$property->{bullet} = $session{form}{bullet};
|
||||
$property->{startAtThisLevel} = $session{form}{startAtThisLevel};
|
||||
$property->{depth} = $session{form}{depth};
|
||||
$property->{lineSpacing} = $session{form}{lineSpacing};
|
||||
$_[0]->set($property);
|
||||
return "";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue