%# A candidate is a person who gets money from the rich and votes from the
%# poor to protect them from each other.

<LABEL>
<&|/l&>TABLE</&>

<& /RG/Elements/Select,
    Name	=> 'FIELD-TABLE',
    Choices	=> [
	($curtable ? () : ('')),
	@tables,
    ],
    Loc		=> sub {
	$CF->{tables}{$_[0]}{description}
	|| $_[0]
	|| '(' . loc("Please choose") . ')'
    },
    Current	=> $curtable &>
</LABEL>

<& /RG/Elements/VerticalBar &>

% if ($curtable) {
<LABEL>
<&|/l&>Field</&>
<& /RG/Elements/Select,
    Name	=> 'FIELD-FNAME',
    Choices	=> [
	($curfield ? () : ('')),
	grep {
	    grep {
		$_->{$curtable}
	    } @{ $table->{FIELDNAME}{$_} }
	} sort keys %{$table->{FIELDNAME}}
    ],
    Loc		=> sub {
	$CF->{tables}{$curtable}{fields}{$_[0]}{description}
	|| $_[0]
	|| '(' . loc("Please choose") . ')'
    },
    Current	=> $curfield &>
</LABEL>

<& /RG/Elements/VerticalBar &>

<LABEL>
<&|/l&>Display Texts</&>
<input name="FIELD-DESCR" value="<% $Descr %>" style="vertical-align: middle; width: 30%">
</LABEL>

<& /RG/Elements/VerticalBar &>

% if (0) {
<LABEL>
<&|/l&>Condition</&>

<SELECT align="absmiddle" style="vertical-align: middle" onchange="this.form.submit()">
% foreach my $cond (qw(= != LIKE), "NOT LIKE", "IN", "NOT IN") {
<option><% $cond %></option>
% }
</select>
</LABEL>
<input name="cond" value="<% $Cond %>" style="vertical-align: middle; width: 10%">
% }

% }

<%ARGS>
$Id	=> ''
$FID	=> undef
$Field	=> undef
$Descr	=> undef
$Cond	=> undef
$CF
$obj
$dbh
$table
$field
$curfield
$curtable
@tables
</%ARGS>
