summaryrefslogtreecommitdiff
path: root/httemplate/edit/elements
diff options
context:
space:
mode:
authorivan <ivan>2006-05-14 16:47:31 +0000
committerivan <ivan>2006-05-14 16:47:31 +0000
commit2c757d7db4cb6a7b9655de13206fcc84fb7ce61f (patch)
treef01088bb60d49ee0dd3dd796d57abe219c321f7b /httemplate/edit/elements
parentc46235292c6bf929615ac28fc48c1d5609ce4590 (diff)
first part of ACL and re-skinning work and some other small stuff
Diffstat (limited to 'httemplate/edit/elements')
-rw-r--r--httemplate/edit/elements/edit.html36
1 files changed, 28 insertions, 8 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 5486b4b00..120c03a3c 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -17,6 +17,13 @@
# 'menubar' => '', #menubar arrayref
#
# 'viewall_dir' => '', #'search' or 'browse', defaults to 'search'
+ #
+ # 'html_bottom' => '', #string
+ # 'html_bottom' => sub {
+ # my $object = shift;
+ # # ...
+ # "html_string";
+ # },
my(%opt) = @_;
@@ -27,6 +34,7 @@
my $fields = $opt{'fields'}
#|| [ grep { $_ ne $pkey } dbdef->table($table)->columns ];
|| [ grep { $_ ne $pkey } fields($table) ];
+ #my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields;
my $object;
if ( $cgi->param('error') ) {
@@ -63,10 +71,7 @@
);
}
-%>
-
-
-<%= include("/elements/header.html", $title,
+%><%= include("/elements/header.html", $title,
include( '/elements/menubar.html', @menubar )
)
%>
@@ -86,7 +91,18 @@
<%= ntable("#cccccc",2) %>
-<% foreach my $field ( @$fields ) { %>
+<% foreach my $f ( @$fields ) {
+
+ my( $field, $type);
+ if ( ref($f) ) {
+ $field = $f->{'field'},
+ $type = $f->{'type'} || 'text',
+ } else {
+ $field = $f;
+ $type = 'text';
+ }
+
+%>
<TR>
@@ -98,12 +114,11 @@
</TD>
<%
- #just text in one size for now... eventually more options for
- # uneditable, hidden, <SELECT>, etc. fields
+ #eventually more options for <SELECT>, etc. fields
%>
<TD>
- <INPUT TYPE="text" NAME="<%= $field %>" VALUE="<%= $object->$field() %>">
+ <INPUT TYPE="<%= $type %>" NAME="<%= $field %>" VALUE="<%= $object->$field() %>">
<TD>
</TR>
@@ -112,6 +127,11 @@
</TABLE>
+<%= ref( $opt{'html_bottom'} )
+ ? &{ $opt{'html_bottom'} }( $object )
+ : $opt{'html_bottom'}
+%>
+
<BR>
<INPUT TYPE="submit" VALUE="<%= $object->$pkey() ? "Apply changes" : "Add $opt{'name'}" %>">