summaryrefslogtreecommitdiff
path: root/httemplate/edit/elements
diff options
context:
space:
mode:
authorivan <ivan>2006-06-18 12:54:49 +0000
committerivan <ivan>2006-06-18 12:54:49 +0000
commitc738a3c4923774b64960aa87fa58bd0751487edb (patch)
treee037c5c2e1211dd16c8024f16c9ce4d1fe589efb /httemplate/edit/elements
parentaaad08cae3a0d46d012de5b78360101cda836c30 (diff)
ACLs: finish group edit (agents + rights) & browse
Diffstat (limited to 'httemplate/edit/elements')
-rw-r--r--httemplate/edit/elements/edit.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 120c03a..94bf6ee 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -16,6 +16,18 @@
#
# 'menubar' => '', #menubar arrayref
#
+ # #run when re-displaying with an error
+ # 'error_callback' => sub { my $cgi, $object = @_; },
+ #
+ # #run when editing
+ # 'edit_callback' => sub { my $cgi, $object = @_; },
+ #
+ # #run when adding
+ # 'new_callback' => sub { my $cgi, $object = @_; },
+ #
+ # #broken'html_table_bottom' => '', #string or listref of additinal HTML to
+ # #add before </TABLE>
+ #
# 'viewall_dir' => '', #'search' or 'browse', defaults to 'search'
#
# 'html_bottom' => '', #string
@@ -43,16 +55,25 @@
map { $_ => scalar($cgi->param($_)) } fields($table)
});
+ &{$opt{'error_callback'}}($cgi, $object)
+ if $opt{'error_callback'};
+
} elsif ( $cgi->keywords ) { #editing
my( $query ) = $cgi->keywords;
$query =~ /^(\d+)$/;
$object = qsearchs( $table, { $pkey => $1 } );
+ &{$opt{'edit_callback'}}($cgi, $object)
+ if $opt{'edit_callback'};
+
} else { #adding
$object = $class->new( {} );
+ &{$opt{'new_callback'}}($cgi, $object)
+ if $opt{'new_callback'};
+
}
my $action = $object->$pkey() ? 'Edit' : 'Add';