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
|
|
@ -52,33 +52,26 @@ sub set {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
my ($output, $f, $messagesPerPage);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$messagesPerPage = $_[0]->get("messagesPerPage") || 50;
|
||||
$output = helpIcon(1,$namespace);
|
||||
$output .= '<h1>'.WebGUI::International::get(6,$namespace).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->integer("messagesPerPage",WebGUI::International::get(4,$namespace),$messagesPerPage);
|
||||
$f->raw($_[0]->SUPER::discussionProperties);
|
||||
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
$messagesPerPage = $_[0]->get("messagesPerPage") || 50;
|
||||
$output = helpIcon(1,$namespace);
|
||||
$output .= '<h1>'.WebGUI::International::get(6,$namespace).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->integer("messagesPerPage",WebGUI::International::get(4,$namespace),$messagesPerPage);
|
||||
$f->raw($_[0]->SUPER::discussionProperties);
|
||||
$output .= $_[0]->SUPER::www_edit($f->printRowsOnly);
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editSave {
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$_[0]->SUPER::www_editSave();
|
||||
$_[0]->set({
|
||||
messagesPerPage=>$session{form}{messagesPerPage}
|
||||
});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
$_[0]->SUPER::www_editSave();
|
||||
$_[0]->set({
|
||||
messagesPerPage=>$session{form}{messagesPerPage}
|
||||
});
|
||||
return "";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue