[interchange-cvs] interchange - heins modified 9 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Thu Sep 19 13:53:01 2002


User:      heins
Date:      2002-09-19 17:52:35 GMT
Modified:  .        MANIFEST
Modified:  code/UI_Tag display.coretag filters.coretag
Modified:           meta_record.coretag table_editor.coretag
Modified:  dist/foundation/products mv_metadata.asc
Modified:  dist/lib/UI ui.cfg
Modified:  lib/Vend/Table Editor.pm
Added:     code/UI_Tag tabbed_display.coretag
Log:
* Commit the new table editor. I have tested in quite a few situations
  and found no problems.

* Add [tabbed-display] tag.

        [tabbed-display OPTIONS]
            [tabbed-panel The title of one]
            The contents of one
            [/tabbed-panel]
            [tabbed-panel The titel of two]
            The contents of two
            [/tabbed-panel]
        [/tabbed-display]

  It is pretty much that simple. It is documented.

Revision  Changes    Path
2.63      +2 -0      interchange/MANIFEST


rev 2.63, prev_rev 2.62
Index: MANIFEST
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/MANIFEST,v
retrieving revision 2.62
retrieving revision 2.63
diff -u -r2.62 -r2.63
--- MANIFEST	16 Sep 2002 23:06:30 -0000	2.62
+++ MANIFEST	19 Sep 2002 17:52:34 -0000	2.63
@@ -164,6 +164,7 @@
 code/UI_Tag/run_profile.coretag
 code/UI_Tag/su.coretag
 code/UI_Tag/substitute_file.coretag
+code/UI_Tag/tabbed_display.coretag
 code/UI_Tag/table_editor.coretag
 code/UI_Tag/table_editor_tpl.coretag
 code/UI_Tag/uneval.coretag
@@ -1209,6 +1210,7 @@
 lib/Vend/Table/Common.pm
 lib/Vend/Table/DBI.pm
 lib/Vend/Table/DB_File.pm
+lib/Vend/Table/Editor.pm
 lib/Vend/Table/GDBM.pm
 lib/Vend/Table/InMemory.pm
 lib/Vend/Table/LDAP.pm



1.9       +2 -302    interchange/code/UI_Tag/display.coretag


rev 1.9, prev_rev 1.8
Index: display.coretag
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/code/UI_Tag/display.coretag,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- display.coretag	17 Sep 2002 19:03:06 -0000	1.8
+++ display.coretag	19 Sep 2002 17:52:34 -0000	1.9
@@ -3,305 +3,5 @@
 UserTag display addAttr 1
 UserTag display Interpolate 1
 UserTag display posNumber 3
-UserTag display Routine <<EOR
-use UI::Primitive;
-use vars qw/$Tag/;
-my $base_entry_value;
-sub {
-	my ($table,$column,$key,$opt) =3D @_;
-
-	if( ref($opt) ne 'HASH' ) {
-		$opt =3D get_option_hash($opt);
-	}
-
-	my $template =3D $opt->{type} eq 'hidden' ? '' : $opt->{template};
-
-	if($opt->{override}) {
-		$opt->{value} =3D defined $opt->{default} ? $opt->{default} : '';
-	}
-
-	if(! defined $opt->{value} and $table and $column and length($key)) {
-		$opt->{value} =3D tag_data($table, $column, $key);
-	}
-
-	my $mtab;
-	my $record;
-
-	my $no_meta =3D $CGI::values{ui_no_meta_display};
-
-	METALOOK: {
-		## No meta display wanted
-		last METALOOK if $no_meta;
-		## No meta display possible
-		$table and $column or $opt->{meta}
-			or last METALOOK;
-
-		## We get a metarecord directly, though why it would be here
-		## and not in options I don't know
-		if($opt->{meta} and ref($opt->{meta}) eq 'HASH') {
-			$record =3D $opt->{meta};
-			last METALOOK;
-		}
-
-		$mtab =3D $opt->{meta_table} || $::Variable->{UI_META_TABLE} || 'mv_meta=
data'
-			or last METALOOK;
-		my $meta =3D Vend::Data::database_exists_ref($mtab)
-			or do {
-				::logError("non-existent meta table: %s", $mtab);
-				undef $mtab;
-				last METALOOK;
-			};
-
-		my $view =3D $opt->{view} || $opt->{arbitrary};
-
-		## This is intended to trigger on the first access
-		if($column eq $meta->config('KEY')) {
-			if($view and $opt->{value} !~ /::.+::/) {
-				$base_entry_value =3D ($opt->{value} =3D~ /^([^:]+)::(\w+)$/)
-									? $1
-									: $opt->{value};
-			}
-			else {
-				$base_entry_value =3D $opt->{value} =3D~ /::/
-									? $table
-									: $opt->{value};
-			}
-		}
-
-		my (@tries) =3D "${table}::$column";
-		unshift @tries, "${table}::${column}::$key"
-			if length($key)
-				and $CGI::values{ui_meta_specific} || $opt->{specific};
-
-		my $sess =3D $Vend::Session->{mv_metadata} || {};
-
-		push @tries, { type =3D> $opt->{type} }
-			if $opt->{type} || $opt->{label};
-
-		for my $metakey (@tries) {
-			## In case we were passed a meta record
-			last if $record =3D $sess->{$metakey} and ref $record;
-			$record =3D UI::Primitive::meta_record($metakey, $view, $meta)
-				and last;
-		}
-	}
-
-	my $w;
-
-	METAMAKE: {
-		last METAMAKE if $no_meta;
-		if( ! $record ) {
-			$record =3D { %$opt };
-		}
-		else {
-			## Here we allow override with the display tag, even with views and
-			## extended
-			my @override =3D qw/
-								append
-								attribute
-								db
-								extra
-								field
-								filter
-								height
-								help
-								help_url
-								label
-								lookup
-								lookup_exclude
-								lookup_query
-								name
-								options
-								outboard
-								passed
-								pre_filter
-								prepend
-								type
-								width
-								/;
-			for(@override) {
-				delete $record->{$_} if ! length($record->{$_});
-				next unless defined $opt->{$_};
-				$record->{$_} =3D $opt->{$_};
-			}
-		}
-
-		$record->{name} ||=3D $column;
-#::logDebug("record now=3D" . ::uneval($record));
-
-		if($record->{options} and $record->{options} =3D~ /^[\w:]+$/) {
-#::logDebug("checking options");
-			PASS: {
-				my $passed =3D $record->{options};
-
-				if($passed eq 'tables') {
-					my @tables =3D $Tag->list_databases();
-					$record->{passed} =3D join (',', "=3D--none--", @tables);
-				}
-				elsif($passed eq 'filters') {
-					$record->{passed} =3D $Tag->filters(1),
-				}
-				elsif($passed =3D~ /^columns(::(\w*))?\s*$/) {
-					my $total =3D $1;
-					my $tname =3D $2 || $record->{db} || $table;
-					if ($total eq '::' and $base_entry_value) {
-						$tname =3D $base_entry_value;
-					}
-					$record->{passed} =3D join ",",
-											"=3D--none--",
-											$Tag->db_columns($tname),
-										;
-				}
-				elsif($passed =3D~ /^keys(::(\w+))?\s*$/) {
-					my $tname =3D $2 || $record->{db} || $table;
-					$record->{passed} =3D join ",",
-											"=3D--none--",
-											$Tag->list_keys($tname),
-										;
-				}
-			}
-		}
-
-#::logDebug("checking for custom widget");
-		if ($record->{type} =3D~ s/^custom\s+//s) {
-			my $wid =3D lc $record->{type};
-			$wid =3D~ tr/-/_/;
-			my $w;
-			$record->{attribute} ||=3D $column;
-			$record->{table}     ||=3D $mtab;
-			$record->{rows}      ||=3D $record->{height};
-			$record->{cols}      ||=3D $record->{width};
-			$record->{field}     ||=3D 'options';
-			$record->{name}      ||=3D $column;
-			my $Tag =3D new Vend::Tags;
-			eval {
-				$w =3D $Tag->$wid($record->{name}, $opt->{value}, $record, $opt);
-			};
-			if($@) {
-				::logError("error using custom widget %s: %s", $wid, $@);
-			}
-			last METAMAKE;
-		}
-
-#::logDebug("formatting prepend/append");
-		for(qw/append prepend/) {
-			next unless $record->{$_};
-			$record->{$_} =3D Vend::Util::resolve_links($record->{$_});
-			$record->{$_} =3D~ s/_UI_VALUE_/$opt->{value}/g;
-			$record->{$_} =3D~ /_UI_URL_VALUE_/
-				and do {
-					my $tmp =3D $opt->{value};
-					$tmp =3D~ s/(\W)/sprintf '%%%02x', ord($1)/eg;
-					$record->{$_} =3D~ s/_UI_URL_VALUE_/$tmp/g;
-				};
-			$record->{$_} =3D~ s/_UI_TABLE_/$table/g;
-			$record->{$_} =3D~ s/_UI_COLUMN_/$column/g;
-			$record->{$_} =3D~ s/_UI_KEY_/$key/g;
-		}
-
-#::logDebug("overriding defaults");
-#::logDebug("passed=3D$record->{passed}") if $record->{debug};
-		my %things =3D (
-			attribute	=3D> $column,
-			cols	 	=3D> $opt->{cols}   || $record->{width},
-			column	 	=3D> $column,
-			passed	 	=3D> $record->{options},
-			rows 		=3D> $opt->{rows}	|| $record->{height},
-			table		=3D> $table,
-			value		=3D> $opt->{value},
-		);
-
-		while( my ($k, $v) =3D each %things) {
-			next if length $record->{$k};
-			next unless defined $v;
-			$record->{$k} =3D $v;
-		}
-
-#::logDebug("calling Vend::Form");
-		$w =3D Vend::Form::display($record);
-		if($record->{filter}) {
-			$w .=3D qq{<INPUT TYPE=3Dhidden NAME=3D"ui_filter:$record->{name}" VALU=
E=3D"};
-			$w .=3D $record->{filter};
-			$w .=3D '">';
-		}
-	}
-
-#::logDebug("widget=3D$w");
-	# don't output label if widget is hidden form variable only
-	return $w if $w =3D~ /^\s*<input\s[^>]*type\s*=3D\W*hidden\b[^>]*>\s*$/i;
-
-	if(! defined $w) {
-		my $text =3D $opt->{value};
-		my $iname =3D $opt->{name} || $column;
-
-		# Count lines for textarea
-		my $count;
-		$count =3D $text =3D~ s/(\r\n|\r|\n)/$1/g;
-
-		HTML::Entities::encode($text, $ESCAPE_CHARS::std);
-		my $size;
-		if ($count) {
-			$count++;
-			$count =3D 20 if $count > 20;
-			$w =3D <<EOF;
-	<TEXTAREA NAME=3D"$iname" COLS=3D60 ROWS=3D$count>$text</TEXTAREA>
-EOF
-		}
-		elsif ($text =3D~ /^\d+$/) {
-			my $cur =3D length($text);
-			$size =3D $cur > 8 ? $cur + 1 : 8;
-		}
-		else {
-			$size =3D 60;
-		}
-			$w =3D <<EOF;
-	<INPUT NAME=3D"$iname" SIZE=3D$size VALUE=3D"$text">
-EOF
-	}
-
-	my $array_return =3D wantarray;
-
-	return $w unless $template || $array_return;
-
-	if($template and $template !~ /\s/) {
-		$template =3D <<'EOF';
-<TR>
-<TD>
-	<B>$LABEL$</B>
-</TD>
-<TD VALIGN=3DTOP>
-	<TABLE CELLSPACING=3D0 CELLMARGIN=3D0><TR><TD>$WIDGET$</TD><TD><I>$HELP$<=
/I>{HELP_URL}<BR><A HREF=3D"$HELP_URL$">help</A>{/HELP_URL}</TD></TR></TABL=
E>
-</TD>
-</TR>
-EOF
-	}
-
-	$record->{label} ||=3D $column;
-
-	my %sub =3D (
-		WIDGET		=3D> $w,
-		HELP		=3D> $opt->{applylocale}
-						? errmsg($record->{help})
-						: $record->{help},
-              META_URL        =3D> $opt->{meta_url},
-		HELP_URL	=3D> $record->{help_url},
-		LABEL		=3D> $opt->{applylocale}
-						? errmsg($record->{label})
-						: $record->{label},
-	);
-
-      $sub{HELP_EITHER} =3D $sub{HELP} || $sub{HELP_URL};
-
-	if($array_return) {
-		return ($w, $sub{LABEL}, $sub{HELP}, $record->{help_url});
-	}
-	else {
-		# Strip the {TAG} {/TAG} pairs if nothing there
-		$template =3D~ s#{([A-Z_]+)}(.*?){/\1}#$sub{$1} ? $2: '' #ges;
-		# Insert the TAG
-              $sub{HELP_URL} ||=3D 'javascript:void(0)';
-		$template =3D~ s/\$([A-Z_]+)\$/$sub{$1}/g;
-		return $template;
-	}
-}
-EOR
+Require Module Vend::Table::Editor
+UserTag display MapRoutine Vend::Table::Editor::display



1.3       +2 -58     interchange/code/UI_Tag/filters.coretag


rev 1.3, prev_rev 1.2
Index: filters.coretag
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/code/UI_Tag/filters.coretag,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- filters.coretag	7 Feb 2002 02:43:21 -0000	1.2
+++ filters.coretag	19 Sep 2002 17:52:34 -0000	1.3
@@ -1,59 +1,3 @@
 UserTag filters Order exclude
-UserTag filters Routine <<EOR
-use vars '%Filter_desc';
-%Vend::Interpolate::Filter_desc =3D (
-	filesafe        =3D> 'Safe for filename',
-	currency        =3D> 'Currency',
-	mailto          =3D> 'mailto: link',
-	commify         =3D> 'Commify',
-	lookup          =3D> 'DB lookup',
-	uc              =3D> 'Upper case',
-	date_change     =3D> 'Date widget',
-	null_to_space   =3D> 'NULL to SPACE',
-	null_to_comma   =3D> 'NULL to COMMA',
-	null_to_colons  =3D> 'NULL to ::',
-	space_to_null   =3D> 'SPACE to NULL',
-	colons_to_null  =3D> ':: to NULL',
-	last_non_null   =3D> 'Reverse combo',
-	nullselect      =3D> 'Combo box',
-	tabbed          =3D> 'Newline to TAB',
-	lc              =3D> 'Lower case',
-	digits_dot      =3D> 'Digits-dots',
-	backslash       =3D> 'Strip backslash',
-	option_format   =3D> 'Option format',
-	crypt           =3D> 'Crypt',
-	namecase        =3D> 'Name case',
-	name            =3D> 'Last&#44;First to First Last',
-	digits          =3D> 'Digits only',
-	word            =3D> 'A-Za-z_0-9',
-	unix            =3D> 'DOS to UNIX newlines',
-	dos             =3D> 'UNIX to DOS newlines',
-	mac             =3D> 'UNIX/DOS to Mac OS newlines',
-	no_white        =3D> 'No whitespace',
-	strip           =3D> 'Trim whitespace',
-	sql             =3D> 'SQL quoting',
-	textarea_put    =3D> 'Textarea PUT',
-	textarea_get    =3D> 'Textarea GET',
-	text2html       =3D> 'Simple text2html',
-	urlencode       =3D> 'URL encode',
-	entities        =3D> 'HTML entities',
-);
-
-my $fdesc_sort =3D sub {
-	return 1 if $a and ! $b;
-	return -1 if ! $a and $b;
-	return lc($Filter_desc{$a}) cmp lc($Filter_desc{$b});
-};
-
-sub {
-	my ($exclude) =3D @_;
-	my @out =3D map
-			{ $_ . ($Filter_desc{$_} ? "=3D$Filter_desc{$_}" : '') }=20
-				sort $fdesc_sort keys %Vend::Interpolate::Filter;
-	if($exclude =3D=3D 1) {
-		@out =3D grep /=3D/, @out;
-	}
-	unshift @out, "=3D--add--";
-	return join ",\n", @out;
-}
-EOR
+UserTag filters addAttr
+UserTag filters MapRoutine Vend::Table::Editor::filters



1.2       +1 -1      interchange/code/UI_Tag/meta_record.coretag


rev 1.2, prev_rev 1.1
Index: meta_record.coretag
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/code/UI_Tag/meta_record.coretag,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- meta_record.coretag	29 Jan 2002 05:52:40 -0000	1.1
+++ meta_record.coretag	19 Sep 2002 17:52:34 -0000	1.2
@@ -1,3 +1,3 @@
 UserTag meta-record Order item view source
 UserTag meta-record attrAlias  table item
-UserTag meta-record MapRoutine UI::Primitive::meta_record
+UserTag meta-record MapRoutine Vend::Table::Editor::meta_record



1.14      +1 -1896   interchange/code/UI_Tag/table_editor.coretag


rev 1.14, prev_rev 1.13
Index: table_editor.coretag
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/code/UI_Tag/table_editor.coretag,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- table_editor.coretag	17 Sep 2002 19:03:06 -0000	1.13
+++ table_editor.coretag	19 Sep 2002 17:52:34 -0000	1.14
@@ -8,1900 +8,5 @@
 UserTag table-editor AttrAlias view  ui_meta_view
 UserTag table-editor AttrAlias profile ui_profile
 UserTag table-editor AttrAlias email_fields ui_display_only
-#UserTag table-editor Documentation <<EOD
-#=3Dhead1 NAME
-#
-#[table-editor]
-#
-#=3Dhead1 SYNOPSIS
-#
-#  [table-editor
-#  		table=3Dic_table
-#		cgi=3D1*
-#		item-id=3D"key"
-#		across=3Dn*
-#		noexport=3D1*
-#=20
-#		wizard=3D1*
-#		next_text=3D'Next -->'*
-#		cancel_text=3D'Cancel'*
-#		back_text=3D'<-- Back'*
-#=20
-#		hidden.formvarname=3D"value"
-#
-#		item_id_left=3D"keys remaining"
-#		mv_blob_field=3Dcolumn*
-#		mv_blob_nick=3Dname*
-#		mv_blob_pointer=3D"current name"*
-#		mv_blob_label=3D"Label text"
-#		mv_blob_title=3D"Title HTML"
-#
-#		ui_break_before=3D"field1 field2"
-#		ui_break_before_label=3D"field1=3DLabel 1, field2=3DLabel 2"
-#		ui_data_fields=3D"field1 field2 fieldn ..."*
-#		ui_data_fields_all=3D1*
-#		ui_display_only=3D"no_set_field"*
-#		ui_hide_key=3D1*
-#		ui_meta_specific=3D1*
-#		ui_meta_view=3D"viewname"
-#		ui_nextpage=3D"next_destination"
-#		ui_prevpage=3D"back_destination"
-#		ui_return_to=3D"cancel_destination"
-#		ui_new_item=3D1*
-#		ui_sequence_edit=3D1*
-#		ui_clone_id=3D"key"
-#		ui_clone_tables=3D"table1 table2 ..."
-#		ui_delete_box=3D1*
-#		mv_update_empty=3D0*
-#=20
-#		widget.field=3D"select|text|any ic widget"
-#		label.field=3D"Field Label"
-#		help.field=3D"Help text"
-#		help-url.field=3D"http://url/to/more/help"
-#		default.field=3D"preset value"*
-#		override.field=3D"forced value"*
-#		filter.field=3D"filter1 filter2"
-#		pre-filter.field=3D"filter1 filter2"
-#		error.field=3D1*
-#		height.field=3DN
-#		width.field=3DN
-#		passed.field=3D"val1=3DLabel 1, val2=3DLabel 2"
-#		lookup.field=3D"lookup_field"
-#		database.field=3D"table"
-#		field.field=3D"column"
-#		outboard.field=3D"key"
-#		append.field=3D"HTML"
-#		prepend.field=3D"HTML"
-#
-#	]
-#
-#=3Dhead1 DESCRIPTION
-#
-#The [table-editor] tag produces an HTML form that edits a database
-#table or collects values for a "wizard". It is extremely configurable
-#as to display and characteristics of the widgets used to collect the
-#input.
-#
-#The widget types are based on the Interchange C<[display ...]> UserTag,
-#which in turn is heavily based on the ITL core C<[accessories ...]> tag.
-#
-#The C<simplest> form of C<[table-editor]> is:
-#
-#	[table-editor table=3Dfoo]
-#
-#A page which contains only that tag will edit the table C<foo>, where
-#C<foo> is the name of an Interchange table to edit. If no C<foo> table
-#is C<defined>, then nothing will be displayed.
-#
-#If the C<mv_metadata> entry "foo" is present, it is used as the
-#definition for table display, including the fields to edit and labels
-#for sections of the form. If C<ui_data_fields> is defined, this
-#cancels fetch of the view and any breaks and labels must be
-#defined with C<ui_break_before> and C<ui_break_before_label>. More
-#on the view concept later.
-#
-#A simple "wizard" can be made with:
-#
-#	[table-editor
-#			wizard=3D1
-#			ui_wizard_fields=3D"foo bar"
-#			mv_nextpage=3Dwizard2
-#			mv_prevpage=3Dwizard_intro
-#			]
-#
-#The purpose of a "wizard" is to collect values from the user and
-#place them in the $Values array. A next page value (option mv_nextpage)
-#must be defined to give a destination; if mv_prevpage is defined then
-#a "Back" button is presented to allow paging backward in the wizard.
-#
-#EOD
-
 UserTag table-editor hasEndTag
-UserTag table-editor Routine <<EOR
-sub {
-	my ($table, $key, $opt, $template) =3D @_;
-show_times("begin table editor call item_id=3D$key") if $Global::ShowTimes;
-
-	package Vend::Interpolate;
-	use vars qw/$Values $Scratch $Db $Tag $Config $CGI $safe_safe $Session/;
-
-	if(ref($opt->{all_opts}) eq 'HASH') {
-		my $o =3D $opt->{all_opts};
-		for (keys %$o ) {
-			$opt->{$_} =3D $o->{$_};
-		}
-	}
-#Debug("options now=3D" . ::uneval($opt));
-
-	init_calc() if ! $Vend::Calc_initialized;
-
-	my @messages;
-	my @errors;
-
-	FORMATS: {
-		no strict 'refs';
-		my $ref;
-		for(qw/
-					default=20=20=20=20=20
-					error=20=20=20=20=20=20=20
-					extra=20=20=20=20=20=20=20
-					filter=20=20=20=20=20=20
-					height=20=20=20=20=20=20
-					help=20=20=20=20=20=20=20=20
-					label=20=20=20=20=20=20=20
-					override=20=20=20=20
-					passed=20=20=20=20=20=20
-					options=20=20=20=20=20=20
-					outboard
-					append
-					prepend
-					lookup
-					lookup_query
-					field
-					pre_filter=20=20
-					widget=20=20=20=20=20=20
-					width=20=20=20=20=20=20=20
-					meta=20=20=20=20=20=20=20
-				/ )
-		{
-			next if ref $opt->{$_};
-			($opt->{$_} =3D {}, next) if ! $opt->{$_};
-			my $ref =3D {};
-			my $string =3D $opt->{$_};
-			$string =3D~ s/^\s+//gm;
-			$string =3D~ s/\s+$//gm;
-			while($string =3D~ m/^(.+?)=3D\s*(.+)/mg) {
-				$ref->{$1} =3D $2;
-			}
-			$opt->{$_} =3D $ref;
-		}
-	}
-
-	my $rowcount =3D 0;
-	my $action =3D $opt->{action} || 'set';
-	my $wizard_next   =3D $opt->{wizard_next}   || 'return';
-	my $wizard_cancel =3D $opt->{wizard_cancel} || 'back';
-	my $rowdiv =3D $opt->{across} || 1;
-	my $span =3D $rowdiv * 2;
-	my $oddspan =3D $span - 1;
-	my $def =3D $opt->{default_ref} || $::Values;
-
-	$opt->{table_width} =3D '60%' if ! $opt->{table_width};
-	$opt->{left_width} =3D '30%' if ! $opt->{left_width};
-	if (! $opt->{inner_table_width}) {
-		if($opt->{table_width} =3D~ /%/) {
-			$opt->{inner_table_width} =3D '100%';
-		}
-		elsif ($opt->{table_width} =3D~ /^\d+$/) {
-			$opt->{inner_table_width} =3D $opt->{table_width} - 2;
-		}
-		else {
-			$opt->{inner_table_width} =3D $opt->{table_width};
-		}
-	}
-	my $check       =3D $opt->{check};
-	my $default     =3D $opt->{default};
-	my $error       =3D $opt->{error};
-	my $extra       =3D $opt->{extra};
-	my $filter      =3D $opt->{filter};
-	my $height      =3D $opt->{height};
-	my $help        =3D $opt->{help};
-	my $help_url    =3D $opt->{help_url};
-	my $label       =3D $opt->{label};
-	my $override    =3D $opt->{override};
-	my $pre_filter  =3D $opt->{pre_filter};
-	my $passed      =3D $opt->{passed};
-	my $options     =3D $opt->{options};
-	my $outboard    =3D $opt->{outboard};
-	my $prepend     =3D $opt->{prepend};
-	my $append      =3D $opt->{append};
-	my $lookup      =3D $opt->{lookup};
-	my $lookup_query =3D $opt->{lookup_query};
-	my $database    =3D $opt->{database};
-	my $field       =3D $opt->{field};
-	my $widget      =3D $opt->{widget};
-	my $width       =3D $opt->{width};
-	my $pmeta       =3D $opt->{meta};
-
-
-	#my $blabel      =3D $opt->{begin_label} || '<b>';
-	#my $elabel      =3D $opt->{end_label} || '</b>';
-	my $blabel      ;
-	my $elabel      ;
-	my $mlabel =3D '';
-
-	if($opt->{wizard}) {
-		$opt->{noexport} =3D 1;
-		$opt->{next_text} =3D 'Next -->' unless $opt->{next_text};
-		$opt->{cancel_text} =3D 'Cancel' unless $opt->{cancel_text};
-		$opt->{back_text} =3D '<-- Back' unless $opt->{back_text};
-	}
-	else {
-		$opt->{cancel_text} =3D 'Cancel' unless $opt->{cancel_text};
-		$opt->{next_text} =3D "Ok" unless $opt->{next_text};
-	}
-
-	for(qw/ next_text cancel_text back_text/ ) {
-		$opt->{$_} =3D errmsg($opt->{$_});
-	}
-
-	my $ntext;
-	my $btext;
-	my $ctext;
-	unless ($opt->{wizard} || $opt->{nosave}) {
-		$Scratch->{$opt->{next_text}} =3D $Tag->return_to('click', 1);
-	}
-	else {
-		if($opt->{action_click}) {
-			$ntext =3D <<EOF;
-mv_todo=3D$wizard_next
-ui_wizard_action=3DNext
-mv_click=3D$opt->{action_click}
-EOF
-		}
-		else {
-			$ntext =3D <<EOF;
-mv_todo=3D$wizard_next
-ui_wizard_action=3DNext
-mv_click=3Dui_override_next
-EOF
-		}
-		$Scratch->{$opt->{next_text}} =3D $ntext;
-
-		my $hidgo =3D $opt->{mv_cancelpage} || $opt->{hidden}{ui_return_to} || $=
CGI->{return_to};
-		$hidgo =3D~ s/\0.*//s;
-		$ctext =3D $Scratch->{$opt->{cancel_text}} =3D <<EOF;
-mv_form_profile=3D
-ui_wizard_action=3DCancel
-mv_nextpage=3D$hidgo
-mv_todo=3D$wizard_cancel
-EOF
-		if($opt->{mv_prevpage}) {
-			$btext =3D $Scratch->{$opt->{back_text}} =3D <<EOF;
-mv_form_profile=3D
-ui_wizard_action=3DBack
-mv_nextpage=3D$opt->{mv_prevpage}
-mv_todo=3D$wizard_next
-EOF
-		}
-		else {
-			delete $opt->{back_text};
-		}
-	}
-
-	for(qw/next_text back_text cancel_text/) {
-		$opt->{"orig_$_"} =3D $opt->{$_};
-	}
-
-	$Scratch->{$opt->{next_text}}   =3D $ntext if $ntext;
-	$Scratch->{$opt->{cancel_text}} =3D $ctext if $ctext;
-	$Scratch->{$opt->{back_text}}   =3D $btext if $btext;
-
-	$opt->{next_text} =3D HTML::Entities::encode($opt->{next_text}, $ESCAPE_C=
HARS::std);
-	$opt->{back_text} =3D HTML::Entities::encode($opt->{back_text}, $ESCAPE_C=
HARS::std);
-	$opt->{cancel_text} =3D HTML::Entities::encode($opt->{cancel_text});
-
-	$Scratch->{$opt->{next_text}}   =3D $ntext if $ntext;
-	$Scratch->{$opt->{cancel_text}} =3D $ctext if $ctext;
-	$Scratch->{$opt->{back_text}}   =3D $btext if $btext;
-
-	if($opt->{wizard} || $opt->{notable} and ! $table) {
-		$table =3D 'mv_null';
-		$Vend::Database{mv_null} =3D=20
-			bless [
-					{},
-					undef,
-					[ 'code', 'value' ],
-					[ 'code' =3D> 0, 'value' =3D> 1 ],
-					0,
-					{ },
-					], 'Vend::Table::InMemory';
-	}
-
-	my @mapdirect =3D qw/
-		mv_data_decode
-		mv_data_table
-		mv_blob_field
-		mv_blob_nick
-		mv_blob_pointer
-		mv_blob_label
-		mv_blob_title
-		left_width
-		table_width
-		ui_break_before
-		ui_break_before_label
-		ui_data_fields
-		ui_data_fields_all
-		ui_data_key_name
-		ui_display_only
-		ui_hide_key
-		ui_meta_specific
-		ui_meta_view
-		ui_nextpage
-		ui_new_item
-		ui_delete_box
-		mv_update_empty
-	/;
-
-	$table =3D $CGI->{mv_data_table} if  $CGI->{mv_data_table} and ! $table;
-
-	my $tmeta =3D UI::Primitive::meta_record($table, $opt->{ui_meta_view}) ||=
 {};
-
-	for(grep defined $tmeta->{$_}, @mapdirect) {
-		$opt->{$_} ||=3D $tmeta->{$_};
-	}
-
-	if($opt->{cgi}) {
-		unshift @mapdirect, qw/
-				item_id
-				item_id_left
-				ui_clone_id
-				ui_clone_tables
-				ui_sequence_edit
-		/;
-		for(@mapdirect) {
-			next if ! defined $CGI->{$_};
-			$opt->{$_} =3D $CGI->{$_};
-		}
-		my @hmap =3D (
-			[ qr/^ui_te_check:/, $check ],
-			[ qr/^ui_te_default:/, $default ],
-			[ qr/^ui_te_extra:/, $extra ],
-			[ qr/^ui_te_widget:/, $widget ],
-			[ qr/^ui_te_passed:/, $passed ],
-			[ qr/^ui_te_options:/, $options ],
-			[ qr/^ui_te_outboard:/, $outboard ],
-			[ qr/^ui_te_prepend:/, $prepend ],
-			[ qr/^ui_te_append:/, $append ],
-			[ qr/^ui_te_lookup:/, $lookup ],
-			[ qr/^ui_te_database:/, $database ],
-			[ qr/^ui_te_field:/, $field ],
-			[ qr/^ui_te_override:/, $override ],
-			[ qr/^ui_te_filter:/, $filter ],
-			[ qr/^ui_te_pre_filter:/, $pre_filter ],
-			[ qr/^ui_te_height:/, $height ],
-			[ qr/^ui_te_width:/, $width ],
-			[ qr/^ui_te_help:/, $help ],
-			[ qr/^ui_te_help_url:/, $help_url ],
-		);
-		my @cgi =3D keys %{$CGI};
-		foreach my $row (@hmap) {
-			my @keys =3D grep $_ =3D~ $row->[0], @cgi;
-			for(@keys) {
-				/^ui_\w+:(\S+)/
-					and $row->[1]->{$1} =3D $CGI->{$_};
-			}
-		}
-		$table =3D $opt->{mv_data_table};
-		$key =3D $opt->{item_id};
-	}
-
-	$opt->{color_success} =3D $::Variable->{UI_C_SUCCESS} || '#00FF00'
-		if ! $opt->{color_success};
-	$opt->{color_fail} =3D $::Variable->{UI_CONTRAST} || '#FF0000'
-		if ! $opt->{color_fail};
-	### Build the error checking
-	my $error_show_var =3D 1;
-	my $have_errors;
-	if($opt->{ui_profile} or $check) {
-		$Tag->error( { all =3D> 1 } )
-			unless $CGI->{mv_form_profile} or $opt->{keep_errors};
-		my $prof =3D $opt->{ui_profile} || '';
-		if ($prof =3D~ s/^\*//) {
-			# special notation ui_profile=3D"*whatever" means
-			# use automatic checklist-related profile
-			my $name =3D $prof;
-			$prof =3D $Scratch->{"profile_$name"} || '';
-			if ($prof) {
-				$prof =3D~ s/^\s*(\w+)[\s=3D]+required\b/$1=3Dmandatory/mg;
-				for (grep /\S/, split /\n/, $prof) {
-					if (/^\s*(\w+)\s*=3D(.+)$/) {
-						my $k =3D $1; my $v =3D $2;
-						$v =3D~ s/\s+$//;
-						$v =3D~ s/^\s+//;
-						$error->{$k} =3D 1;
-						$error_show_var =3D 0 if $v =3D~ /\S /;
-					}
-				}
-				$prof =3D '&calc delete $Values->{step_'
-					  . $name
-					  . "}; return 1\n"
-					  . $prof;
-				$opt->{ui_profile_success} =3D "&set=3Dstep_$name 1";
-			}
-		}
-		my $success =3D $opt->{ui_profile_success};
-		# make sure profile so far ends with a newline so we can add more
-		$prof .=3D "\n" unless $prof =3D~ /\n\s*\z/;
-		if(ref $check) {
-			while ( my($k, $v) =3D each %$check ) {
-				$error->{$k} =3D 1;
-				$v =3D~ s/\s+$//;
-				$v =3D~ s/^\s+//;
-				$v =3D~ s/\s+$//mg;
-				$v =3D~ s/^\s+//mg;
-				$v =3D~ s/^required\b/mandatory/mg;
-				unless ($v =3D~ /^\&/m) {
-					$error_show_var =3D 0 if $v =3D~ /\S /;
-					$v =3D~ s/^/$k=3D/mg;
-					$v =3D~ s/\n/\n&and\n/g;
-				}
-				$prof .=3D "$v\n";
-			}
-		}
-		elsif ($check) {
-			for (@_ =3D grep /\S/, split /[\s,]+/, $check) {
-				$error->{$_} =3D 1;
-				$prof .=3D "$_=3Dmandatory\n";
-			}
-		}
-		$opt->{hidden} =3D {} if ! $opt->{hidden};
-		$opt->{hidden}{mv_form_profile} =3D 'ui_profile';
-		my $fail =3D $opt->{mv_failpage} || $Global::Variable->{MV_PAGE};
-
-		# watch out for early interpolation here!
-		$Scratch->{ui_profile} =3D <<EOF;
-[perl]
-#Debug("cancel=3D'$opt->{orig_cancel_text}' back=3D'$opt->{orig_back_text}=
' click=3D\$CGI->{mv_click}");
-	my \@clicks =3D split /\\0/, \$CGI->{mv_click};
-=09
-	for( qq{$opt->{orig_cancel_text}}, qq{$opt->{orig_back_text}}) {
-#Debug("compare is '\$_'");
-		next unless \$_;
-		my \$cancel =3D \$_;
-		for(\@clicks) {
-#Debug("click is '\$_'");
-			return if \$_ eq \$cancel;=20
-		}
-	}
-	# the following should already be interpolated by the table-editor tag
-	# before going into scratch ui_profile
-	return <<'EOP';
-$prof
-&fail=3D$fail
-&fatal=3D1
-$success
-mv_form_profile=3Dmandatory
-&set=3Dmv_todo $action
-EOP
-[/perl]
-EOF
-		$blabel =3D '<span style=3D"font-weight: normal">';
-		$elabel =3D '</span>';
-		$mlabel =3D ($opt->{message_label} || '&nbsp;&nbsp;&nbsp;<B>Bold</B> fie=
lds are required');
-		$have_errors =3D $Tag->error( {
-									all =3D> 1,
-									show_var =3D> $error_show_var,
-									show_error =3D> 1,
-									joiner =3D> '<BR>',
-									keep =3D> 1}
-									);
-		if($opt->{all_errors}) {
-			if($have_errors) {
-				$mlabel .=3D '<P>Errors:';
-				$mlabel .=3D qq{<FONT COLOR=3D"$opt->{color_fail}">};
-				$mlabel .=3D "<BLOCKQUOTE>$have_errors</BLOCKQUOTE></FONT>";
-			}
-		}
-	}
-	### end build of error checking
-
-	$opt->{clear_image} =3D "bg.gif" if ! $opt->{clear_image};
-
-	my $die =3D sub {
-		::logError(@_);
-		$Scratch->{ui_error} .=3D "<BR>\n" if $Scratch->{ui_error};
-		$Scratch->{ui_error} .=3D ::errmsg(@_);
-		return undef;
-	};
-
-	my $db;
-	unless($opt->{notable}) {
-		$db =3D Vend::Data::database_exists_ref($table)
-		or return $die->('table-editor: bad table %s', $table);
-	}
-
-	if($opt->{ui_wizard_fields}) {
-		$opt->{ui_data_fields} =3D $opt->{ui_display_only} =3D $opt->{ui_wizard_=
fields};
-	}
-
-	my $keycol;
-	if($opt->{notable}) {
-		$keycol =3D $opt->{ui_data_key_name};
-	}
-	else {
-		$keycol =3D $opt->{ui_data_key_name} || $db->config('KEY');
-	}
-
-	$opt->{form_extra} =3D~ s/^\s*/ /
-		if $opt->{form_extra};
-
-	$opt->{form_name} =3D qq{ NAME=3D"$opt->{form_name}"}
-		if $opt->{form_name};
-
-	###############################################################
-	# Get the field display information including breaks and labels
-	###############################################################
-	if( ! $opt->{ui_data_fields} and ! $opt->{ui_data_fields_all}) {
-		$opt->{ui_data_fields} =3D $tmeta->{ui_data_fields} || $tmeta->{options};
-	}
-
-	$opt->{ui_data_fields} =3D~ s/\r\n/\n/g;
-	$opt->{ui_data_fields} =3D~ s/\r/\n/g;
-
-	if($opt->{ui_data_fields} =3D~ /\n\n/) {
-		my @breaks;
-		my @break_labels;
-		while ($opt->{ui_data_fields} =3D~ s/\n+(?:\n[ \t]*=3D(.*))?\n+[ \t]*(\w=
[:.\w]+)/\n$2/) {
-			push @breaks, $2;
-			push @break_labels, "$2=3D$1" if $1;
-		}
-		$opt->{ui_break_before} =3D join(" ", @breaks)
-			if ! $opt->{ui_break_before};
-		$opt->{ui_break_before_label} =3D join(",", @break_labels)
-			if ! $opt->{ui_break_before_label};
-	}
-
-	$opt->{ui_data_fields} ||=3D $opt->{mv_data_fields};
-
-	if(! $opt->{ui_data_fields}) {
-		if( $opt->{notable}) {
-			::logError("table_editor: no place to get fields!");
-			return '';
-		}
-		else {
-			$opt->{ui_data_fields} =3D join " ", $db->columns();
-		}
-	}
-
-	$opt->{ui_data_fields} =3D~ s/[,\0\s]+/ /g;
-	###############################################################
-
-	my $linecount;
-
-	CANONCOLS: {
-		my @cols =3D split /[,\0\s]/, $opt->{ui_data_fields};
-		#@cols =3D grep /:/ || $db->column_exists($_), @cols;
-
-		$opt->{ui_data_fields} =3D join " ", @cols;
-
-		$linecount =3D scalar @cols;
-	}
-
-	my $url =3D $Tag->area('ui');
-
-	my $key_message;
-	if($opt->{ui_new_item} and ! $opt->{notable}) {
-		if( ! $db->config('_Auto_number') ) {
-			$db->config('AUTO_NUMBER', '000001');
-			$key =3D $db->autonumber($key);
-		}
-		else {
-			$key =3D '';
-			$opt->{mv_data_auto_number} =3D 1;
-			$key_message =3D errmsg('(new key will be assigned if left blank)');
-		}
-	}
-
-	my $data;
-	my $exists;
-
-	if($opt->{notable}) {
-		$data =3D {};
-	}
-	elsif($opt->{ui_clone_id} and $db->record_exists($opt->{ui_clone_id})) {
-		$data =3D $db->row_hash($opt->{ui_clone_id})
-			or
-			return $die->('table-editor: row_hash function failed for %s.', $key);
-		$data->{$keycol} =3D $key;
-	}
-	elsif ($db->record_exists($key)) {
-		$data =3D $db->row_hash($key);
-		$exists =3D 1;
-	}
-
-	if ($opt->{reload} and $have_errors) {
-		if($data) {
-			for(keys %$data) {
-				$data->{$_} =3D $CGI->{$_}
-					if defined $CGI->{$_};
-			}
-		}
-		else {
-			$data =3D { %$CGI };
-		}
-	}
-
-
-	my $blob_data;
-	my $blob_widget;
-	if($opt->{mailto} and $opt->{mv_blob_field}) {
-		$opt->{hidden}{mv_blob_only} =3D 1;
-		$opt->{hidden}{mv_blob_nick}
-			=3D $opt->{mv_blob_nick}
-			|| POSIX::strftime("%Y%m%d%H%M%S", localtime());
-	}
-	elsif($opt->{mv_blob_field}) {
-#::logDebug("checking blob");
-
-		my $blob_pointer;
-		$blob_pointer =3D $data->{$opt->{mv_blob_pointer}}
-			if $opt->{mv_blob_pointer};
-		$blob_pointer ||=3D $opt->{mv_blob_nick};
-=09=09=09
-
-		DOBLOB: {
-
-			unless ( $db->column_exists($opt->{mv_blob_field}) ) {
-				push @errors, ::errmsg(
-									"blob field %s not in database.",
-									$opt->{mv_blob_field},
-								);
-				last DOBLOB;
-			}
-
-			my $bstring =3D $data->{$opt->{mv_blob_field}};
-
-#::logDebug("blob: bstring=3D$bstring");
-
-			my $blob;
-
-			if(length $bstring) {
-				$blob =3D $safe_safe->reval($bstring);
-				if($@) {
-					push @errors, ::errmsg("error reading blob data: %s", $@);
-					last DOBLOB;
-				}
-#::logDebug("blob evals to " . ::uneval_it($blob));
-
-				if(ref($blob) !~ /HASH/) {
-					push @errors, ::errmsg("blob data not a storage book.");
-					undef $blob;
-				}
-			}
-			else {
-				$blob =3D {};
-			}
-			my %wid_data;
-			my %url_data;
-			my @labels =3D keys %$blob;
-			for my $key (@labels) {
-				my $ref =3D $blob->{$_};
-				my $lab =3D $ref->{$opt->{mv_blob_label} || 'name'};
-				if($lab) {
-					$lab =3D~ s/,/&#44/g;
-					$wid_data{$lab} =3D "$key=3D$key - $lab";
-					$url_data{$lab} =3D $Tag->page( {
-											href =3D> $Global::Variable->{MV_PAGE},
-											form =3D> "
-												item_id=3D$opt->{item_id}
-												mv_blob_nick=3D$key
-											",
-										});
-					$url_data{$lab} .=3D "$key - $lab</A>";
-				}
-				else {
-					$wid_data{$key} =3D $key;
-					$url_data{$key} =3D $Tag->page( {
-											href =3D> $Global::Variable->{MV_PAGE},
-											form =3D> "
-												item_id=3D$opt->{item_id}
-												mv_blob_nick=3D$key
-											",
-										});
-					$url_data{$key} .=3D "$key</A>";
-				}
-			}
-#::logDebug("wid_data is " . ::uneval_it(\%wid_data));
-			$opt->{mv_blob_title} =3D "Stored settings"
-				if ! $opt->{mv_blob_title};
-			$opt->{mv_blob_title} =3D errmsg($opt->{mv_blob_title});
-
-			$Scratch->{Load} =3D <<EOF;
-[return-to type=3Dclick stack=3D1 page=3D"$Global::Variable->{MV_PAGE}"]
-ui_nextpage=3D
-[perl]Log("tried to go to $Global::Variable->{MV_PAGE}"); return[/perl]
-mv_todo=3Dback
-EOF
-#::logDebug("blob_pointer=3D$blob_pointer blob_nick=3D$opt->{mv_blob_nick}=
");
-
-			my $loaded_from;
-			my $lfrom_msg;
-			if( $opt->{mv_blob_nick} ) {
-				$lfrom_msg =3D $opt->{mv_blob_nick};
-			}
-			else {
-				$lfrom_msg =3D errmsg("current values");
-			}
-			$lfrom_msg =3D errmsg("loaded from %s", $lfrom_msg);
-			$loaded_from =3D <<EOF;
-<I>($lfrom_msg)</I><BR>
-EOF
-			if(@labels) {
-				$loaded_from .=3D errmsg("Load from") . ":<BLOCKQUOTE>";
-				$loaded_from .=3D  join (" ", @url_data{ sort keys %url_data });
-				$loaded_from .=3D "</BLOCKQUOTE>";
-			}
-
-			my $checked;
-			my $set;
-			if( $opt->{mv_blob_only} and $opt->{mv_blob_nick}) {
-				$checked =3D ' CHECKED';
-				$set 	 =3D $opt->{mv_blob_nick};
-			}
-
-			unless ($opt->{nosave}) {
-				$blob_widget =3D $Tag->widget({
-									name =3D> 'mv_blob_nick',
-									type =3D> $opt->{ui_blob_widget} || 'combo',
-									filter =3D> 'nullselect',
-									override =3D> 1,
-									set =3D> "$set",
-									passed =3D> join (",", @wid_data{ sort keys %wid_data }) || 'defa=
ult',
-									});
-				my $msg1 =3D errmsg('Save to');
-				my $msg2 =3D errmsg('Save here only');
-				for (\$msg1, \$msg2) {
-					$$_ =3D~ s/ /&nbsp;/g;
-				}
-				$blob_widget =3D <<EOF unless $opt->{ui_blob_hidden};
-<B>$msg1:</B> $blob_widget&nbsp;
-<INPUT TYPE=3Dcheckbox NAME=3Dmv_blob_only VALUE=3D1$checked>&nbsp;$msg2</=
SMALL>
-EOF
-			}
-
-			$blob_widget =3D <<EOF unless $opt->{ui_blob_hidden};
-<TR class=3Drnorm>
-	 <td class=3Dclabel width=3D"$opt->{left_width}">
-	   <SMALL>$opt->{mv_blob_title}<BR>
-		$loaded_from
-	 </td>
-	 <td class=3Dcwidget>
-	 	$blob_widget&nbsp;
-	 </td>
-</TR>
-
-<tr class=3Drtitle>
-<td colspan=3D$span><img src=3D"$opt->{clear_image}" width=3D1 height=3D3 =
alt=3Dx></td>
-</tr>
-EOF
-
-		if($opt->{mv_blob_nick}) {
-			my @keys =3D split /::/, $opt->{mv_blob_nick};
-			my $ref =3D $blob->{shift @keys};
-			for(@keys) {
-				my $prior =3D $ref;
-				undef $ref;
-				eval {
-					$ref =3D $prior->{$_};
-				};
-				last DOBLOB unless ref $ref;
-			}
-			for(keys %$ref) {
-				$data->{$_} =3D $ref->{$_};
-			}
-		}
-
-		}
-	}
-
-#::logDebug("data is: " . ::uneval($data));
-	$data =3D { $keycol =3D> $key }
-		if ! $data;
-
-	if(! $opt->{mv_data_function}) {
-		$opt->{mv_data_function} =3D $exists ? 'update' : 'insert';
-	}
-
-	$opt->{mv_nextpage} =3D $Global::Variable->{MV_PAGE} if ! $opt->{mv_nextp=
age};
-	$opt->{mv_update_empty} =3D 1 unless defined $opt->{mv_update_empty};
-
-	my $url_base =3D $opt->{secure} ? $Config->{SecureURL} : $Config->{VendUR=
L};
-
-	$opt->{href} =3D "$url_base/ui" if ! $opt->{href};
-	$opt->{href} =3D "$url_base/$opt->{href}"
-		if $opt->{href} !~ m{^(https?:|)/};
-
-	my $sidstr;
-	if ($opt->{get}) {
-		$opt->{method} =3D 'GET';
-		$sidstr =3D '';
-	} else {
-		$opt->{method} =3D 'POST';
-		$sidstr =3D qq{<INPUT TYPE=3Dhidden NAME=3Dmv_session_id VALUE=3D"$Sessi=
on->{id}">
-};
-	}
-	$opt->{enctype} =3D $opt->{file_upload} ? ' ENCTYPE=3D"multipart/form-dat=
a"' : '';
-
-	my $wo =3D $opt->{widgets_only};
-	my @out;
-	push @out, '[restrict]' if $opt->{reparse};
-	push @out, <<EOF unless $wo;
-<FORM METHOD=3D$opt->{method} ACTION=3D"$opt->{href}"$opt->{form_name}$opt=
->{enctype}$opt->{form_extra}>
-$sidstr<INPUT TYPE=3Dhidden NAME=3Dmv_todo VALUE=3D"$action">
-<INPUT TYPE=3Dhidden NAME=3Dmv_click VALUE=3D"process_filter">
-<INPUT TYPE=3Dhidden NAME=3Dmv_nextpage VALUE=3D"$opt->{mv_nextpage}">
-<INPUT TYPE=3Dhidden NAME=3Dmv_data_table VALUE=3D"$table">
-<INPUT TYPE=3Dhidden NAME=3Dmv_data_key VALUE=3D"$keycol">
-EOF
-
-	my @opt_set =3D (qw/
-						ui_meta_specific
-						ui_hide_key
-						ui_meta_view
-						ui_data_decode
-						mv_blob_field
-						mv_blob_label
-						mv_blob_title
-						mv_blob_pointer
-						mv_update_empty
-						mv_data_auto_number
-						mv_data_function
-				/ );
-
-	my @cgi_set =3D ( qw/
-						item_id_left
-						ui_sequence_edit
-					/ );
-
-	push(@opt_set, splice(@cgi_set, 0)) if $opt->{cgi};
-	for(@opt_set) {
-		next unless length $opt->{$_};
-		my $val =3D $opt->{$_};
-		$val =3D~ s/"/&quot;/g;
-		push @out, qq{<INPUT TYPE=3Dhidden NAME=3D$_ VALUE=3D"$val">\n} unless $=
wo;
-	}
-
-	for (@cgi_set) {
-		next unless length $CGI->{$_};
-		my $val =3D $CGI->{$_};
-		$val =3D~ s/"/&quot;/g;
-		push @out, qq{<INPUT TYPE=3Dhidden NAME=3D$_ VALUE=3D"$val">\n} unless $=
wo;
-	}
-
-	if($opt->{mailto}) {
-		$opt->{mailto} =3D~ s/\s+/ /g;
-		$Scratch->{mv_email_enable} =3D $opt->{mailto};
-		$opt->{hidden}{mv_data_email} =3D 1;
-	}
-
-	$Vend::Session->{ui_return_stack} ||=3D [];
-
-	if($opt->{cgi}) {
-		my $r_ary =3D $Vend::Session->{ui_return_stack};
-
-#::logDebug("ready to maybe push/pop return-to from stack, stack =3D " . :=
:uneval($r_ary));
-		if($CGI::values{ui_return_stack}++) {
-			push @$r_ary, $CGI::values{ui_return_to};
-			$CGI::values{ui_return_to} =3D $r_ary->[0];
-		}
-		elsif ($CGI::values{ui_return_to}) {
-			@$r_ary =3D ( $CGI::values{ui_return_to} );=20
-		}
-		push @out, $Tag->return_to() unless $wo;
-#::logDebug("return-to stack =3D " . ::uneval($r_ary));
-	}
-
-	if(ref $opt->{hidden}) {
-		my ($hk, $hv);
-		while ( ($hk, $hv) =3D each %{$opt->{hidden}} ) {
-			push @out, qq{<INPUT TYPE=3Dhidden NAME=3D"$hk" VALUE=3D"$hv">\n} unles=
s $wo;
-		}
-	}
-
-	push @out, <<EOF unless $wo;
-<table class=3Dtouter border=3D"0" cellspacing=3D"0" cellpadding=3D"0" wid=
th=3D"$opt->{table_width}">
-<tr>
-  <td>
-
-<table class=3Dtinner  width=3D"$opt->{inner_table_width}" cellspacing=3D0=
 cellmargin=3D0 width=3D"100%" cellpadding=3D"2" align=3D"center" border=3D=
"0">
-EOF
-	push @out, <<EOF unless $opt->{no_top} or $wo;
-<tr class=3Drtitle>=20
-<td align=3Dright colspan=3D$span><img src=3D"$opt->{clear_image}" width=
=3D1 height=3D3 alt=3Dx></td>
-</tr>
-EOF
-
-	  #### Extra buttons
-      my $extra_ok =3D	$blob_widget
-	  					|| $linecount > 4
-						|| defined $opt->{include_form}
-						|| $mlabel;
-	if ($extra_ok and ! $wo and ! $opt->{no_top} and ! $opt->{nosave}) {
-	  	if($opt->{back_text}) {
-		  push @out, <<EOF unless $wo;
-<TR class=3Drnorm>
-<td>&nbsp;</td>
-<td align=3Dleft colspan=3D$oddspan class=3Dcdata>
-EOF
-			push @out, <<EOF if ! $opt->{bottom_buttons};
-<INPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{back_text}">&nbsp;<IN=
PUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{cancel_text}">&nbsp;<B><I=
NPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{next_text}"></B>
-<BR>
-EOF
-			push @out, <<EOF;
-$mlabel
-</TD>
-</TR>
-
-<tr class=3Drspacer>
-<td colspan=3D$span><img src=3D"$opt->{clear_image}" width=3D1 height=3D3 =
alt=3Dx></td>
-</tr>
-EOF
-		}
-		elsif ($opt->{wizard}) {
-		  push @out, <<EOF;
-<TR class=3Drnorm>
-<td>&nbsp;</td>
-<td align=3Dleft colspan=3D$oddspan class=3Dcdata>
-EOF
-			push @out, <<EOF if ! $opt->{bottom_buttons};
-<INPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{cancel_text}">&nbsp;<=
B><INPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{next_text}"></B>
-<BR>
-EOF
-			push @out, <<EOF;
-$mlabel
-</TD>
-</TR>
-
-<tr class=3Drspacer>
-<td colspan=3D$span><img src=3D"$opt->{clear_image}" width=3D1 height=3D3 =
alt=3Dx></td>
-</tr>
-EOF
-		}
-		else {
-		  push @out, <<EOF;
-<TR class=3Drnorm>
-<td>&nbsp;</td>
-<td align=3Dleft colspan=3D$oddspan class=3Dcdata>
-<B><INPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{next_text}">
-</B>
-EOF
-			push @out, <<EOF unless $opt->{nocancel};
-&nbsp;
-<INPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{cancel_text}">
-EOF
-
-			push @out, <<EOF if $opt->{show_reset};
-&nbsp;
-<INPUT TYPE=3Dreset>
-EOF
-
-			push @out, <<EOF;
-$mlabel
-</TD>
-</TR>
-
-<tr class=3Drspacer>
-<td colspan=3D$span><img src=3D"$opt->{clear_image}" width=3D1 height=3D3 =
alt=3Dx></td>
-</tr>
-EOF
-		}
-	}
-
-	push @out, $blob_widget unless $wo;
-
-	  #### Extra buttons
-
-	if($opt->{ui_new_item} and $opt->{ui_clone_tables}) {
-		my @sets;
-		my %seen;
-		my @tables =3D split /[\s\0,]+/, $opt->{ui_clone_tables};
-		for(@tables) {
-			if(/:/) {
-				push @sets, $_;
-			}
-			s/:.*//;
-		}
-
-		my %tab_checked;
-		for(@tables, @sets) {
-			$tab_checked{$_} =3D 1 if s/\*$//;
-		}
-
-		@tables =3D grep ! $seen{$_}++ && defined $Config->{Database}{$_}, @tabl=
es;
-
-		my $tab =3D '';
-		my $set .=3D <<'EOF';
-[flag type=3Dwrite table=3D"_TABLES_"]
-[perl tables=3D"_TABLES_"]
-	delete $Scratch->{clone_tables};
-	return if ! $CGI->{ui_clone_id};
-	return if ! $CGI->{ui_clone_tables};
-	my $id =3D $CGI->{ui_clone_id};
-
-	my $out =3D "Cloning id=3D$id...";
-
-	my $new =3D  $CGI->{$CGI->{mv_data_key}}
-		or do {
-				$out .=3D ("clone $id: no mv_data_key '$CGI->{mv_data_key}'");
-				$Scratch->{ui_message} =3D $out;
-				return;
-		};
-
-	if($new =3D~ /\0/) {
-		$new =3D~ s/\0/,/g;
-		Log("cannot clone multiple keys '$new'.");
-		return;
-	}
-
-	my %possible;
-	my @possible =3D qw/_TABLES_/;
-	@possible{@possible} =3D @possible;
-	my @tables =3D grep /\S/, split /[\s,\0]+/, $CGI->{ui_clone_tables};
-	my @sets =3D grep /:/, @tables;
-	@tables =3D grep $_ !~ /:/, @tables;
-	for(@tables) {
-		next unless $possible{$_};
-		my $db =3D $Db{$_};
-		next unless $db;
-		my $new =3D=20
-		my $res =3D $db->clone_row($id, $new);
-		if($res) {
-			$out .=3D "cloned $id to to $new in table $_<BR>\n";
-		}
-		else {
-			$out .=3D "FAILED clone of $id to to $new in table $_<BR>\n";
-		}
-	}
-	for(@sets) {
-		my ($t, $col) =3D split /:/, $_;
-		my $db =3D $Db{$t} or next;
-		my $res =3D $db->clone_set($col, $id, $new);
-		if($res) {
-			$out .=3D "cloned $col=3D$id to to $col=3D$new in table $t<BR>\n";
-		}
-		else {
-			$out .=3D "FAILED clone of $col=3D$id to to $col=3D$new in table $t<BR>=
\n";
-		}
-	}
-	$Scratch->{ui_message} =3D $out;
-	return;
-[/perl]
-EOF
-		my $tabform =3D '';
-		@tables =3D grep $Tag->if_mm( { table =3D> "$_=3Di" } ), @tables;
-
-		for(@tables) {
-			my $db =3D Vend::Data::database_exists_ref($_)
-				or next;
-			next unless $db->record_exists($opt->{ui_clone_id});
-			my $checked =3D $tab_checked{$_} ? ' CHECKED' : '';
-			$tabform .=3D <<EOF;
-<INPUT TYPE=3DCHECKBOX NAME=3Dui_clone_tables VALUE=3D"$_"$checked> clone =
to <b>$_</B><BR>
-EOF
-		}
-		for(@sets) {
-			my ($t, $col) =3D split /:/, $_;
-			my $checked =3D $tab_checked{$_} ? ' CHECKED' : '';
-			$tabform .=3D <<EOF;
-<INPUT TYPE=3DCHECKBOX NAME=3Dui_clone_tables VALUE=3D"$_"$checked> clone =
entries of <b>$t</B> matching on <B>$col</B><BR>
-EOF
-		}
-
-		my $tabs =3D join " ", @tables;
-		$set =3D~ s/_TABLES_/$tabs/g;
-		$Scratch->{clone_tables} =3D $set;
-		push @out, <<EOF unless $wo;
-<tr class=3Drtitle>
-<td colspan=3D$span>
-$tabform<INPUT TYPE=3Dhidden NAME=3Dmv_check VALUE=3D"clone_tables">
-<INPUT TYPE=3Dhidden NAME=3Dui_clone_id VALUE=3D"$opt->{ui_clone_id}">
-</td>
-</tr>
-EOF
-	}
-
-	my %break;
-	my %break_label;
-	if($opt->{ui_break_before}) {
-		my @tmp =3D grep /\S/, split /[\s,\0]+/, $opt->{ui_break_before};
-		@break{@tmp} =3D @tmp;
-		if($opt->{ui_break_before_label}) {
-			@tmp =3D grep /\S/, split /\s*[,\0]\s*/, $opt->{ui_break_before_label};
-			for(@tmp) {
-				my ($br, $lab) =3D split /\s*=3D\s*/, $_;
-				$break_label{$br} =3D $lab;
-			}
-		}
-	}
-	if(!$db and ! $opt->{notable}) {
-		return "<TR><TD>Broken table '$table'</TD></TR>";
-	}
-
-	my $passed_fields =3D $opt->{ui_data_fields};
-
-	my @extra_cols;
-	my %email_cols;
-	my %ok_col;
-	my @cols;
-	my @dbcols;
-	my %display_only;
-
-	if($opt->{notable}) {
-		@cols =3D split /[\s,\0]+/, $passed_fields;
-	}
-	else {
-
-	while($passed_fields =3D~ s/(\w+[.:]+\S+)//) {
-		push @extra_cols, $1;
-	}
-
-	my @do =3D grep /\S/, split /[\0,\s]+/, $opt->{ui_display_only};
-	for(@do) {
-		$email_cols{$_} =3D 1 if $opt->{mailto};
-		$display_only{$_} =3D 1;
-		push @extra_cols, $_;
-	}
-
-		@dbcols  =3D split /\s+/, $Tag->db_columns( {
-										name	=3D> $table,
-										columns	=3D> $passed_fields,
-										passed_order =3D> 1,
-									});
-
-	if($opt->{ui_data_fields}) {
-		for(@dbcols, @extra_cols) {
-			unless (/^(\w+)([.:]+)(\S+)/) {
-				$ok_col{$_} =3D 1;
-				next;
-			}
-			my $t =3D $1;
-			my $s =3D $2;
-			my $c =3D $3;
-			if($s eq '.') {
-				$c =3D $t;
-				$t =3D $table;
-			}
-			else {
-				$c =3D~ s/\..*//;
-			}
-			next unless $Tag->db_columns( { name	=3D> $t, columns	=3D> $c, });
-			$ok_col{$_} =3D 1;
-		}
-	}
-	@cols =3D grep $ok_col{$_}, split /\s+/, $opt->{ui_data_fields};
-	}
-
-	$keycol =3D $cols[0] if ! $keycol;
-
-	if($opt->{defaults}) {
-			if($opt->{force_defaults}) {
-			$default->{$_} =3D $def->{$_} for @cols;
-			}
-			elsif($opt->{wizard}) {
-			for(@cols) {
-				$default->{$_} =3D $def->{$_} if defined $def->{$_};
-			}
-		}
-			else {
-			for(@cols) {
-				next if defined $default->{$_};
-				next unless defined $def->{$_};
-				$default->{$_} =3D $def->{$_};
-			}
-		}
-	}
-
-	my $super =3D $Tag->if_mm('super');
-
-	my $refkey =3D $key;
-
-	my @data_enable =3D ($opt->{mv_blob_pointer}, $opt->{mv_blob_field});
-	my @ext_enable;
-=20
-    # Init the cell stuff
-    my %td_extra;
-    my %td_default =3D (
-                    widget_cell_class	=3D> 'cwidget',
-                    label_cell_class	=3D> 'clabel',
-                    data_cell_class		=3D> 'cdata',
-                    help_cell_class		=3D> 'chelp',
-    );
-=20
-	 for my $ctype (qw/label data widget help/) {
-		 $td_extra{$ctype} =3D '';
-		 for my $ptype (qw/class style align valign width/) {
-			 my $parm =3D $ctype . '_cell_' . $ptype;
-			 if(defined $opt->{$parm}) {
-				 $td_extra{$ctype} .=3D qq{ $ptype=3D"$opt->{$parm}"};
-			 }
-			 elsif ($td_default{$parm}) {
-				 $td_extra{$ctype} .=3D qq{ $ptype=3D"$td_default{$parm}"};
-			 }
-		 }
-		 if(my $thing =3D $opt->{$ctype . "_cell_extra"}) {
-				 $td_extra{$ctype} .=3D " $thing";
-		 }
-	 }
-=20
-	 if($opt->{left_width} and ! $opt->{label_cell_width}) {
-			 $td_extra{label} .=3D qq{ width=3D"$opt->{left_width}"};
-	 }
-=20
-	 my $row_template =3D $opt->{row_template};
-	 $opt->{meta_anchor} ||=3D errmsg('meta');
-	 $opt->{meta_anchor_specific} ||=3D errmsg('item-specific meta');
-=20=20=20=20=20=20=20
-	 if(! $row_template) {
-			 if($opt->{simple_row}) {
-					 $opt->{help_anchor} ||=3D 'help';
-					 $row_template =3D <<EOF;
-  <td$td_extra{label}>=20
-	\$LABEL\$
-  </td>
-  <td$td_extra{widget}>\$WIDGET\${HELP_EITHER}&nbsp;<a href=3D"\$HELP_URL\=
$" title=3D"\$HELP\$">$opt->{help_anchor}</a>{/HELP_EITHER}&nbsp;{META_URL}=
<a href=3D"\$META_URL\$">$opt->{meta_anchor}</A>{/META_URL}
-  </td>
-EOF
-			 }
-			 else {
-					 $row_template =3D <<EOF;
- <td$td_extra{label}>=20
-   $blabel\$LABEL\$$elabel~META~
- </td>
- <td$td_extra{data}>
-   <table cellspacing=3D0 cellmargin=3D0 width=3D"100%">
-	 <tr>=20
-	   <td$td_extra{widget}>
-		 \$WIDGET\$
-	   </td>
-	   <td$td_extra{help}>~TKEY~<i>\$HELP\$</i>{HELP_URL}<BR><A HREF=3D"\$HEL=
P_URL\$">help</A>{/HELP_URL}</FONT></td>
-	 </tr>
-   </table>
- </td>
-EOF
-			}
-	}
-
-	$row_template =3D~ s/~OPT:(\w+)~/$opt->{$1}/g;
-	$row_template =3D~ s/~BLABEL~/$blabel/g;
-	$row_template =3D~ s/~ELABEL~/$elabel/g;
-    $row_template =3D~ s/~([A-Z]+)_EXTRA~/$td_extra{lc $1}/g;
-
-	my %serialize;
-	my %serial_data;
-
-	my @controls;
-
-	if(my $jsc =3D $opt->{js_changed}) {
-		$jsc =3D~ /^\w+$/
-			and $jsc =3D qq{onChange=3D"$jsc} . q{('$$KEY$$','$$COL$$');"};
-		foreach my $c (@cols) {
-			next if $extra->{$c} =3D~ /\bonchange\s*=3D/i;
-			my $tpl =3D $jsc;
-			$tpl .=3D $extra->{$c} if length $extra->{$c};
-			$tpl =3D~ s/\$\$KEY\$\$/$key/g;
-			$tpl =3D~ s/\$\$COL\$\$/$c/g;
-			if ($extra->{$c} and $extra->{$c} =3D~ /\bonchange\s*=3D/i) {
-				$tpl =3D~ s/onChange=3D"//;
-				$tpl =3D~ s/"\s*$/;/;
-				$extra->{$c} =3D~ s/\b(onchange\s*=3D\s*["'])/$1$tpl/i;
-			}
-			else {
-				$extra->{$c} =3D $tpl;
-			}
-		}
-	}
-
-	my $show_meta;
-	if($super and ! $opt->{no_meta}) {
-		$show_meta =3D defined $def->{ui_meta_force}
-					?  $def->{ui_meta_force}
-					: $::Variable->{UI_META_LINK};
-	}
-
-	my %link_row;
-	my %link_before;
-	if($opt->{link_table} and $key) {
-		my @ltable;
-		my @lfields;
-		my @lkey;
-		my @lview;
-		my @llab;
-		my @ltpl;
-		my @lbefore;
-		my @lsort;
-		my $tcount =3D 1;
-		if(ref($opt->{link_table}) eq 'ARRAY') {
-			@ltable  =3D @{$opt->{link_table}};
-			@lfields =3D @{$opt->{link_fields}};
-			@lview   =3D @{$opt->{link_view}};
-			@lkey    =3D @{$opt->{link_key}};
-			@llab    =3D @{$opt->{link_label}};
-			@ltpl    =3D @{$opt->{link_template}};
-			@lbefore =3D @{$opt->{link_before}};
-			@lsort   =3D @{$opt->{link_sort}};
-		}
-		else {
-			@ltable  =3D $opt->{link_table};
-			@lfields =3D $opt->{link_fields};
-			@lview   =3D $opt->{link_view};
-			@lkey    =3D $opt->{link_key};
-			@llab    =3D $opt->{link_label};
-			@ltpl    =3D $opt->{link_template};
-			@lbefore =3D $opt->{link_before};
-			@lsort   =3D $opt->{link_sort};
-		}
-		while(my $lt =3D shift @ltable) {
-			my $lf =3D shift @lfields;
-			my $lv =3D shift @lview;
-			my $lk =3D shift @lkey;
-			my $ll =3D shift @lkey;
-			my $lb =3D shift @lbefore;
-			my $ls =3D shift @lsort;
-
-			my $rcount =3D 0;
-
-			$ll ||=3D errmsg("Settings in table %s linked by %s", $lt, $lk);
-
-			my $tpl =3D $row_template;
-			my $ldb =3D database_exists_ref($lt)
-				or do {
-					logError("Bad table editor link table: %s", $lt);
-					next;
-				};
-
-			my $lmeta =3D Vend::Tags->meta_record($lt, $lv);
-			$lf ||=3D $lmeta->{spread_fields};
-
-			my $l_pkey =3D $ldb->config('KEY');
-
-			my @cf =3D grep /\S/, split /[\s,\0]+/, $lf;
-			@cf =3D grep $_ ne $l_pkey, @cf;
-			$lf =3D join " ", @cf;
-			my $lextra =3D $opt->{link_extra} || '';
-			$lextra =3D " $lextra" if $lextra;
-			my $labside =3D <<EOF;
-<input type=3Dhidden name=3D"mv_data_table__$tcount" value=3D"$lt">
-<input type=3Dhidden name=3D"mv_data_fields__$tcount" value=3D"$lf">
-<input type=3Dhidden name=3D"mv_data_multiple__$tcount" value=3D"1">
-<input type=3Dhidden name=3D"mv_data_key__$tcount" value=3D"$l_pkey">
-$ll
-EOF
-
-			my @lout =3D q{<table cellspacing=3D0 cellpadding=3D1>};
-			push @lout, qq{<tr><td$lextra>$l_pkey</td>};
-			push @lout, Vend::Tags->row_edit({ table =3D> $lt, columns =3D> $lf });
-			push @lout, '</tr>';
-
-			my $tname =3D $ldb->name();
-			my $lfor =3D $key;
-			$lfor =3D $ldb->quote($key, $lk);
-			my $q =3D "SELECT $l_pkey FROM $tname WHERE $lk =3D $lfor";
-			$q .=3D " ORDER BY $ls" if $ls;
-			my $ary =3D $ldb->query($q);
-			for(@$ary) {
-				my $rk =3D $_->[0];
-				my $pp =3D $rcount ? "${rcount}_" : '';
-				my $hid =3D qq{<input type=3Dhidden name=3D"$pp${l_pkey}__$tcount" val=
ue=3D"};
-				$hid .=3D HTML::Entities::encode($rk);
-				$hid .=3D qq{">};
-				push @lout, qq{<tr><td$lextra>$rk$hid</td>};
-				my %o =3D (
-					table =3D> $lt,
-					key =3D> $_->[0],
-					extra =3D> $opt->{link_extra},
-					pointer =3D> $rcount,
-					stacker =3D> $tcount,
-					columns =3D> $lf,
-					extra =3D> $opt->{link_extra},
-				);
-				$rcount++;
-				push @lout, Vend::Tags->row_edit(\%o);
-				push @lout, "</tr>";
-			}
-			my %o =3D (
-				table =3D> $lt,
-				blank =3D> 1,
-				extra =3D> $opt->{link_extra},
-				pointer =3D> 999999,
-				stacker =3D> $tcount,
-				columns =3D> $lf,
-				extra =3D> $opt->{link_extra},
-			);
-			push @lout, qq{<tr><td$lextra>};
-			push @lout, qq{<input size=3D8 name=3D"999999_${l_pkey}__$tcount" value=
=3D"">};
-			push @lout, '</td>';
-			push @lout, Vend::Tags->row_edit(\%o);
-			push @lout, '</tr>';
-			push @lout, "</table>";
-			$tpl =3D~ s{\$LABEL\$}{$labside}g;
-			$tpl =3D~ s{\$WIDGET\$}{join "", @lout}ge;
-			my $murl =3D '';
-			if($show_meta) {
-				$murl =3D $Tag->page({
-							href =3D> 'admin/db_metaconfig_spread',
-							form =3D> qq(
-									ui_table=3D$lt
-									ui_view=3D$lv
-								),
-							});
-				$murl .=3D errmsg('meta');
-				$murl .=3D '</a>';
-			}
-			$tpl =3D~ s{\~META\~}{$murl}g;
-			$tpl =3D~ s{\$HELP\$}{}g;
-			$tpl =3D~ s{\~TKEY\~}{}g;
-			$tpl =3D~ s!{HELP_URL}.*?{/HELP_URL}!!gs;
-			$link_row{$lt} =3D $tpl;
-			if($lb) {
-				$link_before{$lb} =3D $lt;
-			}
-			my $mde_key =3D "mv_data_enable__$tcount";
-			$Scratch->{$mde_key} =3D "$lt:" . join(",", $l_pkey, @cf) . ':';
-			$tcount++;
-		}
-	}
-
-	foreach my $col (@cols) {
-		if($link_before{$col}) {
-			push @controls, delete $link_row{$link_before{$col}};
-		}
-		my $t;
-		my $c;
-		my $k;
-		my $tkey_message;
-		if($col eq $keycol) {
-			if($opt->{ui_hide_key}) {
-				my $kval =3D $key || $override->{$col} || $default->{$col};
-				push @controls, <<EOF;
-	<INPUT TYPE=3Dhidden NAME=3D"$col" VALUE=3D"$kval">
-EOF
-				next;
-			}
-			elsif ($opt->{ui_new_item}) {
-				$tkey_message =3D $key_message;
-			}
-		}
-
-		my $w =3D '';
-		my $do =3D $display_only{$col};
-=09=09
-		my $currval;
-		my $serialize;
-
-		if($col =3D~ /(\w+):+([^:]+)(?::+(\S+))?/) {
-			$t =3D $1;
-			$c =3D $2;
-			$c =3D~ /(.+?)\.\w.*/
-				and $col =3D "$t:$1"
-					and $serialize =3D $c;
-			$k =3D $3 || undef;
-			push @ext_enable, ("$t:$c" . $k ? ":$k" : '')
-				unless $do;
-		}
-		else {
-			$t =3D $table;
-			$c =3D $col;
-			$c =3D~ /(.+?)\.\w.*/
-				and $col =3D $1
-					and $serialize =3D $c;
-			push @data_enable, $col
-				unless $do and ! $opt->{mailto};
-		}
-
-		my $type;
-		my $overridden;
-
-		$currval =3D $data->{$col} if defined $data->{$col};
-		if ($opt->{force_defaults} or defined $override->{$c} ) {
-			$currval =3D $override->{$c};
-			$overridden =3D 1;
-#::logDebug("hit override for $col,currval=3D$currval");
-		}
-		elsif (defined $CGI->{"ui_preload:$t:$c"} ) {
-			$currval =3D delete $CGI->{"ui_preload:$t:$c"};
-			$overridden =3D 1;
-#::logDebug("hit preload for $col,currval=3D$currval");
-		}
-		elsif( ($do && ! $currval) or $col =3D~ /:/) {
-			if(defined $k) {
-				my $check =3D $k;
-				undef $k;
-				for( $override, $data, $default) {
-					next unless defined $_->{$check};
-					$k =3D $_->{$check};
-					last;
-				}
-			}
-			else {
-				$k =3D defined $key ? $key : $refkey;
-			}
-			$currval =3D tag_data($t, $c, $k) if defined $k;
-#::logDebug("hit display_only for $col, t=3D$t, c=3D$c, k=3D$k, currval=3D=
$currval");
-		}
-		elsif (defined $default->{$c} and ! length($data->{$c}) ) {
-			$currval =3D $default->{$c};
-#::logDebug("hit preload for $col,currval=3D$currval");
-		}
-		else {
-#::logDebug("hit data->col for $col, t=3D$t, c=3D$c, k=3D$k, currval=3D$cu=
rrval");
-			$currval =3D length($data->{$col}) ? $data->{$col} : '';
-			$overridden =3D 1;
-		}
-
-		my $namecol;
-		if($serialize) {
-#Debug("serialize=3D$serialize");
-			if($serialize{$col}) {
-				push @{$serialize{$col}}, $serialize;
-			}
-			else {
-				my $sd;
-				if($col =3D~ /:/) {
-					my ($tt, $tc) =3D split /:+/, $col;
-					$sd =3D tag_data($tt, $tc, $k);
-				}
-				else {
-					$sd =3D $data->{$col} || $def->{$col};
-				}
-#Debug("serial_data=3D$sd");
-				$serial_data{$col} =3D $sd;
-				$opt->{hidden}{$col} =3D $data->{$col};
-				$serialize{$col} =3D [$serialize];
-			}
-			$c =3D~ /\.(.*)/;
-			my $hk =3D $1;
-#Debug("fetching serial_data for $col hk=3D$hk data=3D$serial_data{$col}");
-			$currval =3D dotted_hash($serial_data{$col}, $hk);
-#Debug("fetched hk=3D$hk value=3D$currval");
-			$overridden =3D 1;
-			$namecol =3D $c =3D $serialize;
-		}
-
-		$namecol =3D $col unless $namecol;
-
-		$type =3D 'value' if $do and ! ($opt->{wizard} || ! $opt->{mailto});
-
-		if (! length $currval and defined $default->{$c}) {
-			$currval =3D $default->{$c};
-		}
-
-		my $meta =3D '';
-              my $meta_url;
-              my $meta_url_specific;
-		my $template =3D $row_template;
-		if($error->{$c}) {
-			my $parm =3D {
-					name =3D> $c,
-					std_label =3D> '$LABEL$',
-					required =3D> 1,
-					};
-			if($opt->{all_errors}) {
-				$parm->{keep} =3D 1;
-				$parm->{text} =3D <<EOF;
-<FONT COLOR=3D"$opt->{color_fail}">\$LABEL\$</FONT><!--%s-->
-[else]{REQUIRED <B>}{LABEL}{REQUIRED </B>}[/else]
-EOF
-			}
-			$template =3D~ s/\$LABEL\$/$Tag->error($parm)/eg;
-		}
-
-		if($show_meta) {
-			$opt->{meta_prepend} =3D '<br><font size=3D1>'
-					unless defined $opt->{meta_prepend};
-
-			$opt->{meta_anchor} ||=3D errmsg('meta');
-			$opt->{meta_extra} =3D " $opt->{meta_extra}"
-					if $opt->{meta_extra};
-			$opt->{meta_extra} ||=3D "";
-			$opt->{meta_extra} .=3D qq{ class=3D"$opt->{meta_class}"}
-					if $opt->{meta_class};
-			# Get global variables
-			my $base =3D $Tag->var('UI_BASE', 1) || 'admin';
-			my $page =3D $Tag->var('MV_PAGE', 1);
-			my $id =3D $t . "::$c";
-			$id =3D $opt->{ui_meta_view} . "::$id"
-					if $opt->{ui_meta_view} and $opt->{ui_meta_view} ne 'metaconfig';
-
-			my $return =3D <<EOF;
-ui_return_to=3D$page
-ui_return_to=3Ditem_id=3D$opt->{item_id}
-ui_return_to=3Dui_meta_view=3D$opt->{ui_meta_view}
-ui_return_to=3Dmv_return_table=3D$t
-mv_return_table=3D$table
-ui_return_stack=3D$CGI->{ui_return_stack}
-EOF
-
-			$meta_url =3D $Tag->area({
-									href =3D> "$base/meta_editor",
-									form =3D> qq(
-												item_id=3D$id
-												$return
-											  ),
-								  });
-			my $meta_specific =3D '';
-			if($opt->{ui_meta_specific}) {
-				  my $meta_specific_url =3D $Tag->area({
-											  href =3D> "$base/meta_editor",
-											  form =3D> qq(
-												  item_id=3D${t}::${c}::$key
-												  $return
-												  ),
-											  });
-				  $opt->{meta_anchor_specific} ||=3D errmsg('item-specific meta');
-				  $meta_specific =3D <<EOF;
-<br><a href=3D"$meta_specific_url"$opt->{meta_extra}>$opt->{meta_anchor_sp=
ecific}</A>
-EOF
-			}
-=09=09=09=09=09=09=09=09=09=09=09=09=09
-			$opt->{meta_apppend} =3D '</FONT>'
-				  unless defined $opt->{meta_append};
-
-			$meta =3D <<EOF;
-$opt->{meta_prepend}<a href=3D"$meta_url"$opt->{meta_extra}>$opt->{meta_an=
chor}</A>
-$meta_specific$opt->{meta_append}
-EOF
-
-		}
-
-		$template =3D~ s/~TKEY~/$tkey_message || ''/eg;
-#::logDebug("col=3D$c currval=3D$currval widget=3D$widget->{$c} label=3D$l=
abel->{$c} (type=3D$type)");
-		my $display =3D $Tag->display({
-										applylocale =3D> 1,
-										arbitrary =3D> $opt->{ui_meta_view},
-										column =3D> $c,
-										default =3D> $currval,
-										extra =3D> $extra->{$c},
-										fallback =3D> 1,
-										field =3D> $field->{$c},
-										filter =3D> $filter->{$c},
-										height =3D> $height->{$c},
-										help =3D> $help->{$c},
-										help_url =3D> $help_url->{$c},
-										label =3D> $label->{$c},
-										key =3D> $key,
-										meta =3D> $pmeta->{$c},
-                                                                          =
    meta_url =3D> $meta_url,
-										name =3D> $namecol,
-										override =3D> $overridden,
-										passed =3D> $passed->{$c},
-										options =3D> $options->{$c},
-										outboard =3D> $outboard->{$c},
-										append =3D> $append->{$c},
-										prepend =3D> $prepend->{$c},
-										lookup =3D> $lookup->{$c},
-										lookup_query =3D> $lookup_query->{$c},
-										db =3D> $database->{$c},
-										pre_filter =3D> $pre_filter->{$c},
-										table =3D> $t,
-										type =3D> $widget->{$c} || $type,
-										width =3D> $width->{$c},
-										template =3D> $template,
-									});
-#::logDebug("finished display of col=3D$c");
-
-		# don't use template if we have only a hidden HTML form variable
-		if ($display =3D~ /^\s*<input\s[^>]*type\s*=3D\W*hidden\b[^>]*>\s*$/i) {
-			push @controls, $display . "\n";
-			next;
-		}
-
-		$display =3D~ s/\~META\~/$meta/g;
-		$display =3D~ s/\~ERROR\~/$Tag->error({ name =3D> $c, keep =3D> 1 })/eg;
-=20=20=20=20=20=20=20=20
-		if (! $wo and $break{$namecol}) {
-			while($rowcount % $rowdiv) {
-				$w .=3D '<TD>&nbsp;</td><TD>&nbsp;</td>';
-				$rowcount++;
-			}
-			$w .=3D "</TR>\n";
-			$w .=3D <<EOF if $break{$namecol};
-<TR class=3Drbreak>
-	<TD COLSPAN=3D$span class=3Dcbreak>$break_label{$namecol}<IMG SRC=3D"$opt=
->{clear_image}" WIDTH=3D1 HEIGHT=3D1 alt=3Dx></TD>
-</TR>
-EOF
-			$rowcount =3D 0;
-		}
-		$w .=3D "<tr class=3Drnorm>\n" unless $rowcount++ % $rowdiv;
-		$w .=3D $display;
-		$w .=3D "</TR>\n" unless $rowcount % $rowdiv;
-		push @controls, $w;
-	}
-
-	for(sort keys %link_row) {
-		push @controls, delete $link_row{$_};
-	}
-
-	my @firstout =3D splice @out, 0;
-
-	while($rowcount % $rowdiv) {
-		push @out, '<TD>&nbsp;</td><TD>&nbsp;</td>' unless $wo;
-		$rowcount++;
-	}
-
-	$Scratch->{mv_data_enable} =3D '';
-	if($opt->{auto_secure}) {
-		$Scratch->{mv_data_enable} .=3D "$table:" . join(",", @data_enable) . ':=
';
-		$Scratch->{mv_data_enable_key} =3D $opt->{item_id};
-	}
-	if(@ext_enable) {
-		$Scratch->{mv_data_enable} .=3D " " . join(" ", @ext_enable) . " ";
-	}
-#Debug("setting mv_data_enable to $Scratch->{mv_data_enable}");
-	my @serial =3D keys %serialize;
-	my @serial_fields;
-	for (@serial) {
-#Debug("$_ serial_data=3D$serial_data{$_}");
-		$serial_data{$_} =3D uneval($serial_data{$_})
-			if is_hash($serial_data{$_});
-		$serial_data{$_} =3D~ s/\&/&amp;/g;
-		$serial_data{$_} =3D~ s/"/&quot;/g;
-		push @out, qq{<INPUT TYPE=3Dhidden NAME=3D"$_" VALUE=3D"$serial_data{$_}=
">}
-			unless $wo;
-		push @serial_fields, @{$serialize{$_}};
-	}
-
-	if(! $wo and @serial_fields) {
-		push @out, qq{<INPUT TYPE=3Dhidden NAME=3D"ui_serial_fields" VALUE=3D"};
-		push @out, join " ", @serial_fields;
-		push @out, qq{">};
-	}
-
-	###
-	### Here the user can include some extra stuff in the form....
-	###
-	push @out, <<EOF if ! $wo and $opt->{include_form};
-<tr class=3Drnorm>
-<td colspan=3D$span>$opt->{include_form}</td>
-</tr>
-EOF
-	### END USER INCLUDE
-
-	unless ($opt->{mailto} and $opt->{mv_blob_only}) {
-		@cols =3D grep ! $display_only{$_}, @cols;
-	}
-	$passed_fields =3D join " ", @cols;
-
-	push @out, <<EOF unless $wo;
-<INPUT TYPE=3Dhidden NAME=3Dmv_data_fields VALUE=3D"$passed_fields">
-<tr class=3Drspacer>
-<td colspan=3D$span ><img src=3D"$opt->{clear_image}" height=3D3 alt=3Dx><=
/td>
-</tr>
-EOF
-
-  SAVEWIDGETS: {
-  	last SAVEWIDGETS if $wo || $opt->{nosave};=20
-	  	if($opt->{back_text}) {
-		  push @out, <<EOF;
-<TR class=3Drnorm>
-<td>&nbsp;</td>
-<td align=3Dleft colspan=3D$oddspan class=3Dcdata>
-<INPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{back_text}">&nbsp;<IN=
PUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{cancel_text}">&nbsp;<B><I=
NPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{next_text}"></B>
-EOF
-		}
-		elsif($opt->{wizard}) {
-		  push @out, <<EOF;
-<TR class=3Drnorm>
-<td>&nbsp;</td>
-<td align=3Dleft colspan=3D$oddspan class=3Dcdata>
-<INPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{cancel_text}">&nbsp;<=
B><INPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{next_text}"></B>
-EOF
-		}
-		else {
-			push @out, qq{<TR class=3Drnorm>
-<td>&nbsp;</td>
-<td align=3Dleft colspan=3D$oddspan class=3Dcdata>
-<B><INPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{next_text}"></B>};
-			push @out,
-				qq{&nbsp;<INPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"$opt->{cancel_t=
ext}">}
-				unless $opt->{nocancel};
-			push @out, qq{&nbsp;<INPUT TYPE=3Dreset>}
-				if $opt->{show_reset};
-		}
-
-	if(! $opt->{notable} and $Tag->if_mm('tables', "$table=3Dx") and ! $db->c=
onfig('LARGE') ) {
-		my $checked =3D ' CHECKED';
-		$checked =3D ''
-			if defined $opt->{mv_auto_export} and ! $opt->{mv_auto_export};
-		my $autoexpstr =3D errmsg('Auto-export');=09=09
-		push @out, <<EOF unless $opt->{noexport} or $opt->{nosave};
-<small>
-&nbsp;
-&nbsp;
-&nbsp;
-&nbsp;
-&nbsp;
-	<INPUT TYPE=3Dcheckbox NAME=3Dmv_auto_export VALUE=3D"$table"$checked>&nb=
sp;$autoexpstr
-EOF
-
-	}
-
-	if($exists and ! $opt->{nodelete} and $Tag->if_mm('tables', "$table=3Dd")=
) {
-		my $extra =3D $Tag->return_to( { type =3D> 'click', tablehack =3D> 1 });
-		my $page =3D $CGI->{ui_return_to};
-		$page =3D~ s/\0.*//s;
-		my $url =3D $Tag->area( {
-					href =3D> $page,
-					form =3D> qq!
-						deleterecords=3D1
-						ui_delete_id=3D$key
-						mv_data_table=3D$table
-						mv_click=3Ddb_maintenance
-						mv_action=3Dback
-						$extra
-					!,
-					});
-		my $delstr =3D errmsg('Delete');
-		my $delmsg =3D errmsg('Are you sure you want to delete %s?',$key);
-		push @out, <<EOF if ! $opt->{nosave};
-<BR><BR><A
-onClick=3D"return confirm('$delmsg')"
-HREF=3D"$url"><IMG SRC=3D"delete.gif" ALT=3D"Delete $key" BORDER=3D0></A> =
$delstr
-EOF
-	}
-	push @out, <<EOF;
-</small>
-</td>
-</tr>
-EOF
-  } # end SAVEWIDGETS
-
-	my $message =3D '';
-
-#	if($opt->{bottom_errors}) {
-#		my $err =3D $Tag->error( {
-#									show_var =3D> $error_show_var,
-#									show_error =3D> 1,
-#									joiner =3D> '<BR>',
-#								}
-#								);
-#		push @errors, $err if $err;
-#	}
-
-	if(@errors) {
-		$message .=3D '<P>Errors:';
-		$message .=3D qq{<FONT COLOR=3D"$opt->{color_fail}">};
-		$message .=3D '<BLOCKQUOTE>';
-		$message .=3D join "<BR>", @errors;
-		$message .=3D '</BLOCKQUOTE></FONT>';
-	}
-	if(@messages) {
-		$message .=3D '<P>Messages:';
-		$message .=3D qq{<FONT COLOR=3D"$opt->{color_success}">};
-		$message .=3D '<BLOCKQUOTE>';
-		$message .=3D join "<BR>", @messages;
-		$message .=3D '</BLOCKQUOTE></FONT>';
-	}
-	$Tag->error( { all =3D> 1 } );
-
-	push @out, <<EOF unless $wo or ($opt->{no_bottom} and ! $message);
-<tr class=3Drtitle>
-<td colspan=3D$span><!-- $Scratch->{$opt->{next_text}} -->$message<img src=
=3D"$opt->{clear_image}" height=3D3 alt=3Dx></td>
-</tr>
-EOF
-	push @out, <<EOF unless $wo;
-</table>
-</td></tr></table>
-
-</form>
-EOF
-	push @out, '[/restrict]' if $opt->{reparse};
-
-	if($wo) {
-		return @controls if wantarray;
-		return join "", @controls;
-	}
-show_times("end table editor call item_id=3D$key") if $Global::ShowTimes;
-	return join "", @firstout, @controls, @out;
-}
-EOR
+UserTag table-editor MapRoutine Vend::Table::Editor::editor



1.1                  interchange/code/UI_Tag/tabbed_display.coretag


rev 1.1, prev_rev 1.0
Index: tabbed_display.coretag
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
UserTag tabbed-display PosNumber 0
UserTag tabbed-display addAttr=20
UserTag tabbed-display hasEndTag=20
UserTag tabbed-display Interpolate=20
UserTag tabbed-display NoReparse=20
UserTag tabbed-display Documentation <<EOD
=3Dhead1 NAME

tabbed-display -- DHTML tabbed display

=3Dhead1 SYNOPSIS

    [tabbed-display OPTIONS]
        [tabbed-panel The title of one]
        The contents of one
        [/tabbed-panel]
        [tabbed-panel The contents of two]
        The contents of two
        [/tabbed-panel]
    [/tabbed-display]

=3Dhead1 DESCRIPTION

The [tabbed-display] ITL tag breaks text into a tabbed DHTML display.
There are many options which can change the size of the display,
colors, and styles.

NOTE: All sizes are in pixels to allow size calculation.

=3Dhead2 OPTIONS

=3Dover 4

=3Ditem tab_bgcolor_template}

Default #xxxxxx. A template where each "x" will be broken into
descending-brightness colors. The default value will cause
the selected tab to have a color of #eeeeee, the first unselected
tab will have #dddddd, the next #cccccc, etc. To create a yellow
series, use #ffffxx.

=3Ditem tab_height

Sets the height of the title tab. Default 30.

=3Ditem tab_width

Sets the width of the title tab. Default is 100.

=3Ditem panel_height

Sets the height of the panel display. Default 600.

=3Ditem panel_width

Sets the width of the panel display. Default is 800.

=3Ditem panel_id

To account for multiple tabbed displays in a page, the second
one should have a unique ID assigned to it. Default is "mvpan".

=3Ditem tab_horiz_offset

The amount that the tab will be offset from tabs in multi-row
displays to allow view of all tabs.  Default 10.

=3Ditem tab_vert_offset

The amount that the tab will be offset from tabs in multi-row
displays to allow view of all tabs.  Default 8.

=3Ditem tab_style

The style items which will be set for the title tab portion.
Default:

    text-align:center;
    font-family: sans-serif;
    line-height:150%;
    border:2px;
    border-color:#999999;
    border-style:outset;
    border-bottom-style:none;


=3Ditem panel_style

The style items which will be set for the panel portion.  Default:

    font-family: sans-serif;
    font-size: smaller;
    border: 2px;
    border-color:#999999;
    border-style:outset;

=3Ditem panel_prepend

A string which will be prepended to every panel content.
A typical value might be "<table>", which allows table rows to
be sent as content. This is the value used in Interchange's
table editor.


=3Ditem panel_append

A string which will be appended to every panel content.
A typical value might be "</table>", which allows table rows to
be sent as content. This is the value used in Interchange's
table editor.

=3Dback

=3Ditem contents

If you have an array set with the value of each panel's content,
you can send it as an array reference in the contents option.
This option will also accept a null-separated string as might
be found in a form input.

If there are contents in an array, the body text of the tag
is ignored.

=3Ditem titles

If you have an array set with the value of each tab's title,
you can send it as an array reference in the C<titles> option.
This option will also accept a null-separated string as might
be found in a form input.

If the title for a panel is set in the array, the title found in the
body text of the tag is ignored.

=3Dhead2 Use in embedded Perl

The tabbed_display tag can be used in embedded Perl as well.

    my @titles =3D ( 'Title 1', 'Title 2' );
    my @contents =3D ( 'Content of panel 1: foo', 'Content of 2' );
    my %options =3D (
        panel_width =3D> 600,
        panel_height =3D> 400,
        tab_bgcolor_template =3D> '#ffffxx',
    );
    return $Tag->tabbed_display(\@titles, \@contents, \%options);

=3Dcut

EOD

UserTag tabbed-display Routine <<EOR
sub {
	my $opt =3D shift;
	my $body =3D shift;
#::logDebug("opt is $opt, body is $body");
	my $tit; my $cont;

	if($opt->{titles}) {
		if(ref($opt->{titles}) eq 'ARRAY') {
			$tit =3D delete $opt->{titles};
		}
		elsif($opt->{titles} =3D~ /\0/) {
			$tit =3D [ split /\0/, delete $opt->{titles} ];
		}
		elsif($opt->{titles} =3D~ /\n/) {
			$tit =3D [ split /\n/, delete $opt->{titles} ];
		}
		else {
			$tit =3D [ map { $::Scratch->{$_} } split /[\s,]+/, delete $opt->{titles=
}];
		}
	}

	if($opt->{contents}) {
		if(ref($opt->{contents}) eq 'ARRAY') {
			$cont =3D delete $opt->{contents};
		}
		elsif($opt->{contents} =3D~ /\0/) {
			$cont =3D [ split /\0/, delete $opt->{contents} ];
		}
	}

	$tit ||=3D [];
	if(! $cont) {
		$cont =3D [];
		while($body =3D~ s{
							\[tabbed[-_]panel (.*?) \]
									(.*?)
							\[/tabbed[-_]panel\]}
						{}xis
					)
		{
			push @$cont, $2;
			my $t =3D $1;
			if($t and $t =3D~ /\S/) {
				$tit->[$#$cont] ||=3D $t;
			}
		}
	}
	return Vend::Table::Editor::tabbed_display($tit, $cont, $opt);
}
EOR




2.12      +1 -1      interchange/dist/foundation/products/mv_metadata.asc


rev 2.12, prev_rev 2.11
Index: mv_metadata.asc
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/dist/foundation/products/mv_metadata.asc,v
retrieving revision 2.11
retrieving revision 2.12
diff -u -r2.11 -r2.12
--- mv_metadata.asc	8 Sep 2002 00:19:06 -0000	2.11
+++ mv_metadata.asc	19 Sep 2002 17:52:34 -0000	2.12
@@ -219,7 +219,7 @@
 ui_component::mv_metadata::ui_body	textarea	80	30							Component Body			d=
igits=09=09=09=09=09=09=09=09
 ui_component::mv_metadata::ui_body_text	textarea	80	30							Component Bod=
y=09=09=09=09=09=09=09=09=09=09=09
 ui_component::mv_metadata::width	text	4								Width	SIZE for TEXT<BR>=0DC=
OLS for TEXTAREA<BR>=0DLabel limit for SELECT		digits=09=09=09=09=09=09=09=
=09
-userdb	text			username,company,lname,fname		Users=09
+userdb	text			username,company,lname,fname		Users															{'tab_hori=
z_offset' =3D> "",'tab_vert_offset' =3D> "",'panel_height' =3D> "400",'file=
_upload' =3D> "",'tabbed' =3D> "1",'left_width' =3D> "",'table_width' =3D> =
"800",'tab_height' =3D> "",'panel_width' =3D> "800",'tab_width' =3D> "",'ui=
_data_fields' =3D> "=3DName and Contact Info=0D=0Dphone_day=0Dphone_night=
=0Demail=0Dfax=0Dfax_order=0Dusername=0Dpassword=0Demail_copy=0Dmail_list=
=0Dmod_time=0Dinactive=0D=0D=3DShipping Info=0D=0Dcompany=0Dfname=0Dlname=
=0Daddress1=0Daddress2=0Daddress3=0Dcity=0Dstate=0Dzip=0Dcountry=0Dmv_shipm=
ode=0D=0D=3DBilling Info=0D=0D=0Db_company=0Db_fname=0Db_lname=0Db_address1=
=0Db_address2=0Db_address3=0Db_city=0Db_state=0Db_zip=0Db_country=0Db_phone=
=0D=0D=3DOrder Info=0D=0Dproject_id=0Daccount_id=0Dcredit_limit=0Ddealer=0D=
price_level=0Dorder_dest=0Dmv_credit_card_type=0Dmv_credit_card_exp_month=
=0Dmv_credit_card_exp_year=0Dorder_numbers=0D=0D=3DRepositories=0D=0Ds_nick=
name=0Daddress_book=0Db_nickname=0Daccounts=0Dp_nickname=0Dpreferences=0Dca=
rts=0D=0D=3DPermissions=0D=0Downer=0Dfile_acl=0Ddb_acl=0Dacl=0D",}
 userdb::address1	text	40								Address=09
 userdb::address2	text	40								&nbsp;=09
 userdb::b_address1	text	40								Billing Address=09



2.8       +1 -0      interchange/dist/lib/UI/ui.cfg


rev 2.8, prev_rev 2.7
Index: ui.cfg
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/dist/lib/UI/ui.cfg,v
retrieving revision 2.7
retrieving revision 2.8
diff -u -r2.7 -r2.8
--- ui.cfg	13 Sep 2002 20:46:20 -0000	2.7
+++ ui.cfg	19 Sep 2002 17:52:34 -0000	2.8
@@ -28,6 +28,7 @@
 UserTag reconfigure Order table file
 UserTag reconfigure Routine <<EOR
 use UI::Primitive;
+use Vend::Table::Editor;
 *ui_check_acl =3D \&UI::Primitive::ui_check_acl;
 *ui_acl_enabled =3D \&UI::Primitive::ui_acl_enabled;
 *get_ui_table_acl =3D \&UI::Primitive::get_ui_table_acl;



1.2       +84 -36    interchange/lib/Vend/Table/Editor.pm


rev 1.2, prev_rev 1.1
Index: Editor.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Table/Editor.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Editor.pm	19 Sep 2002 03:25:47 -0000	1.1
+++ Editor.pm	19 Sep 2002 17:52:34 -0000	1.2
@@ -1,6 +1,6 @@
 # Vend::Table::Editor - Swiss-army-knife table editor for Interchange
 #
-# $Id: Editor.pm,v 1.1 2002/09/19 03:25:47 mheins Exp $
+# $Id: Editor.pm,v 1.2 2002/09/19 17:52:34 mheins Exp $
 #
 # Copyright (C) 2002 ICDEVGROUP <interchange@icdevgroup.org>
 # Copyright (C) 2002 Mike Heins <mike@perusion.net>
@@ -26,7 +26,7 @@
 package Vend::Table::Editor;
=20
 use vars qw($VERSION);
-$VERSION =3D substr(q$Revision: 1.1 $, 10);
+$VERSION =3D substr(q$Revision: 1.2 $, 10);
=20
 use Vend::Util;
 use Vend::Interpolate;
@@ -513,16 +513,32 @@
=20=09
 	$opt ||=3D {};
=20
-	$opt->{tab_bgcolor_template} ||=3D 'eeeeee';
+	my @chars =3D reverse(0 .. 9, 'a' .. 'e');
+	my @colors;
+	$opt->{tab_bgcolor_template} ||=3D '#xxxxxx';
 	$opt->{tab_height} ||=3D '30';
 	$opt->{tab_width} ||=3D '120';
-	$opt->{tab_cellspacing} ||=3D 0;
-	$opt->{tab_cellpadding} ||=3D 2;
 	$opt->{panel_height} ||=3D '600';
 	$opt->{panel_width} ||=3D '800';
 	$opt->{panel_id} ||=3D 'mvpan';
 	$opt->{tab_horiz_offset} ||=3D '10';
 	$opt->{tab_vert_offset} ||=3D '8';
+	$opt->{tab_style} ||=3D q{
+								text-align:center;
+								font-family: sans-serif;
+								line-height:150%;
+								border:2px;
+								border-color:#999999;
+								border-style:outset;
+								border-bottom-style:none;
+							};
+	$opt->{panel_style} ||=3D q{=20
+									font-family: sans-serif;
+									font-size: smaller;
+									border: 2px;
+									border-color:#999999;
+									border-style:outset;
+								};
 	$opt->{layer_tab_style} ||=3D q{
 									font-weight:bold;
 									text-align:center;
@@ -545,7 +561,13 @@
 		+ $opt->{tab_vert_offset};
 	my $int1 =3D $panel_y - 2;
 	my $int2 =3D $opt->{tab_height} * $num_rows;
-::logDebug("num rows=3D$num_rows");
+	for(my $i =3D 0; $i < $num_panels; $i++) {
+		my $c =3D $opt->{tab_bgcolor_template} || '#xxxxxx';
+		$c =3D~ s/x/$chars[$i] || 'e'/eg;
+		$colors[$i] =3D $c;
+	}
+	my $cArray =3D qq{var colors =3D ['} . join("','", @colors) . qq{'];};
+#::logDebug("num rows=3D$num_rows");
 	my $out =3D <<EOF;
 <SCRIPT language=3D"JavaScript">
 <!--
@@ -558,6 +580,7 @@
 var tabHeight =3D $opt->{tab_height}
 var vOffset =3D $opt->{tab_vert_offset};
 var hOffset =3D $opt->{tab_horiz_offset};
+$cArray
=20
 var divLocation =3D new Array(numLocations)
 var newLocation =3D new Array(numLocations)
@@ -588,9 +611,9 @@
 	if (document.layers) {
 		div.style=3Ddiv;
 		div.clip.bottom=3DnewClip; // clip off bottom
-		} else {
+	} else {
 		div.style.clip=3D"rect(0 auto "+newClip+" 0)"
-		}
+	}
 	div.style.top =3D (numRows-(Math.floor(newPos/tabsPerRow) + 1)) * (tabHei=
ght-vOffset)
 	div.style.left =3D (newPos % tabsPerRow) * tabWidth +	(hOffset * (Math.fl=
oor(newPos / tabsPerRow)))
 }
@@ -610,16 +633,27 @@
 	}
 	// Set tab positions & zIndex
 	// Update location
+	var j =3D 1;
 	for(var i=3D0; i<numDiv; ++i) {
 		var loc =3D newLocation[i]
 		var div =3D getDiv("panel",i)
-		if(i =3D=3D n) setZIndex(div, numLocations +1)
-		else setZIndex(div, numLocations - loc)
+		var tdiv =3D getDiv("tab",i)
+		if(i =3D=3D n) {
+			setZIndex(div, numLocations +1);
+			div.style.display =3D 'block';
+			tdiv.style.backgroundColor =3D colors[0];
+			div.style.backgroundColor =3D colors[0];
+		}
+		else {
+			setZIndex(div, numLocations - loc)
+			div.style.display =3D 'none';
+			tdiv.style.backgroundColor =3D colors[j];
+			div.style.backgroundColor =3D colors[j++];
+		}
 		divLocation[i] =3D loc
-		div =3D getDiv("tab",i)
-		updatePosition(div, loc)
-		if(i =3D=3D n) setZIndex(div, numLocations +1)
-		else setZIndex(div,numLocations - loc)
+		updatePosition(tdiv, loc)
+		if(i =3D=3D n) setZIndex(tdiv, numLocations +1)
+		else setZIndex(tdiv,numLocations - loc)
 	}
 }
=20
@@ -634,31 +668,31 @@
 </SCRIPT>
 <STYLE type=3D"text/css">
 <!--
-.tab {
-	font-family: sans-serif; line-height:150%; font-weight: bold; position:ab=
solute; text-align:center; border:2px; border-color:#999999; border-style:o=
utset; border-bottom-style:none; width:$opt->{tab_width}px; margin:0px; hei=
ght: ${int2}px;
-}
+.${id}tab {
+	font-weight: bold;
+	width:$opt->{tab_width}px;
+	margin:0px;
+	height: ${int2}px;
+	position:absolute;
+	$opt->{tab_style}
+	}
=20
-.panel {
-	font-family: sans-serif;
-	font-size: smaller;
+.${id}panel {
 	position:absolute;
-	border: 2px;
-	border-color:#999999;
-	border-style:outset;
 	width: $opt->{panel_width}px;
 	height: $opt->{panel_height}px;
 	left:0px;
 	top:${int1}px;
 	margin:0px;
 	padding:6px;
-}
+	$opt->{panel_style}
+	}
 -->
 </STYLE>
 EOF
 	my $s1 =3D '';
 	my $s2 =3D '';
 	for(my $i =3D 0; $i < $num_panels; $i++) {
-		my $c =3D '#eeeeee';
 		my $zi =3D $num_panels - $i;
 		my $pnum =3D $i + 1;
 		my $left =3D (($i % $tabs_per_row)
@@ -669,18 +703,23 @@
 					- ($opt->{tab_height} - $opt->{tab_vert_offset});
 		my $cliprect =3D $opt->{tab_height} * (int($i / $tabs_per_row) + 1);
 		$s1 .=3D <<EOF;
-<DIV id=3D"${id}panel$i" class=3D"panel" style=3D"background-color: $c;=20
- z-index:$zi">
-<table>
+<DIV id=3D"${id}panel$i"
+		class=3D"${id}panel"
+		style=3D"
+			background-color: $c;=20
+			z-index:$zi
+		">
+$opt->{panel_prepend}
 $cont->[$i]
-</table>
+$opt->{panel_append}
 </DIV>
 <DIV
 	onclick=3D"selectTab($i)"
 	id=3D"${id}tab$i"
-	class=3D"tab"
+	class=3D"${id}tab"
 	style=3D"
-		background-color:$c;=20
+		background-color: $c;=20
+		cursor: pointer;
 		left: ${left}px;
 		top: ${top}px;
 		z-index:$zi;
@@ -813,7 +852,7 @@
 sub resolve_exclude {
 	my $exc =3D shift;
 	while(my ($k, $v) =3D each %exclude) {
-::logDebug("examining $k for $v");
+#::logDebug("examining $k for $v");
 		while ($v =3D~ m{(\S+)}g) {
 			my $thing =3D $1;
 			if($thing =3D~ s/^[^A-Z]//) {
@@ -2248,9 +2287,16 @@
 		}
 	}
=20
-	if($opt->{tabbed}) {
-		chunk ttag(), qq{<tr><td colspan=3D$span>\n};
-	}
+    if($opt->{tabbed}) {
+        my $ph =3D $opt->{panel_height} || '600';
+        my $pw =3D $opt->{panel_width} || '800';
+        my $th =3D $opt->{tab_height} || '30';
+        my $oh =3D $ph + $th;
+        my $extra =3D $Vend::Session->{browser} =3D~ /Gecko/
+                  ? ''
+                  : " width=3D$pw height=3D$oh";
+        chunk ttag(), qq{<tr><td colspan=3D$span$extra>\n};
+    }
=20
 	foreach my $col (@cols) {
 		if($link_before{$col}) {
@@ -2758,11 +2804,13 @@
 	}
=20
 	if($opt->{tabbed}) {
-::logDebug("In tabbed display...controls=3D" . scalar(@controls) . ", titl=
es=3D" . scalar(@titles));
+#::logDebug("In tabbed display...controls=3D" . scalar(@controls) . ", tit=
les=3D" . scalar(@titles));
 		my @tabcont;
 		for(@controls) {
 			push @tabcont, join "", map { $outhash{$_} } @$_;
 		}
+		$opt->{panel_prepend} ||=3D '<table>';
+		$opt->{panel_append} ||=3D '</table>';
 		push @put, tabbed_display(\@titles,\@tabcont,$opt);
 	}
 	else {