[tag flag write]__UI_META_TABLE__[/tag] [set page_title][L]Format field[/L][/set] [if-mm !super] [set error_message]Not authorized to format fields.[/set] [bounce page="__UI_BASE__/error"] [/if-mm] [if session arg] [seti arg][data session arg][/seti] [elsif value ui_edit_meta] [seti arg][value ui_edit_meta][/seti] [/elsif] [else] [set arg][/set] [/else] [/if] [perl tables="__UI_META_TABLE__"] my $table = q{__UI_META_TABLE__}; my $key = $Scratch->{arg}; if($key =~ /(\w+)::(.+)/) { $Scratch->{meta_table} = $1; $Scratch->{meta_column} = $2; } my $db = $Db{$table} or do{ Log("meta database $table not present."); return; }; if ($table ne $Values->{mv_data_table}) { $Values->{mv_data_table} = $table; } $Values->{ui_data_key_name} = $db->config('KEY'); my @fields = $db->columns(); $Values->{ui_data_fields} = join " ", @fields; if( $db->record_exists($key) ) { for(@fields) { $Values->{$_} = $db->field($key, $_); } } else { for(@fields) { delete $Values->{$_}; } } if($table eq delete $Values->{mv_auto_export}) { return "[seti export_ok][tag export $table][/tag][/seti]"; } else { return '[set export_ok][/set]'; } [/perl] [set process_meta] [tag flag write]__UI_META_TABLE__[/tag] [perl tables="__UI_META_TABLE__"] my $table = $Values->{mv_data_table}; my $db = $Db{$table}; my $key = $CGI->{$CGI->{mv_data_key}}; $Scratch->{mv_data_enable} = 0; $CGI->{mv_todo} = 'return'; if(! $key) { Log('Tried to write empty meta field'); return; } for($db->columns()) { next unless defined $CGI->{$_}; $CGI->{$_} =~ s/^[\s\0]+//; $CGI->{$_} =~ s/[\s\0]+$//; $CGI->{$_} =~ s/\0+/_/g; $CGI->{$_} =~ s/__+/_/g; $CGI->{$_} =~ s/_ / /g; #$db->set_field($key, $_, $CGI->{$_}); } if($CGI->{lookup} and $CGI->{type} =~ /combo/) { $CGI->{filter} = 'nullselect'; } $CGI->{mv_todo} = 'set'; $CGI->{mv_nextpage} = '__UI_BASE__/format_meta'; $Session->{arg} = $table; $Scratch->{mv_data_enable} = 1; return; [/perl] [/set] @_UI_STD_HEAD_@
[calc] my $out = ''; my $page; if($CGI->{ui_return_to}) { ($page, @env) = split /\0/, $CGI->{ui_return_to}; } else { $page = q{@@MV_PAGE}; } $out = < EOF for(@env) { my ($name, $val) = split /=/, $_; $val =~ s/"/"/g; $out .= < EOF } return $out; [/calc] [if-key-exists table="[value mv_data_table]" key="[scratch arg]"] [L]Update[/L] [L]Insert[/L] [L]Delete[/L] [L]Yes, delete[/L] [else] [L]Update[/L] [L]Insert[/L] [/else] [/if-key-exists]
[title-bar 200 2]Widget
Default is text box,
60 columns[/title-bar]
[title-bar 100 2]Window size
multiple select
only[/title-bar]
[title-bar __UI_LEFT_WIDTH__ 2]Box Height
Text area or
radio/check table[/title-bar]
[title-bar __UI_LEFT_WIDTH__ 2]Box Width
Text box, Text area,
or radio/check area[/title-bar]
[perl] delete $Scratch->{ui_type_height}; delete $Scratch->{ui_type_width}; $Values->{type} =~ m{(\d+)(?:_+(\d+))?} or return; $Scratch->{ui_type_height} = $1 || ''; $Scratch->{ui_type_width} = $2 || ''; $Scratch->{ui_type_width} = delete $Scratch->{ui_type_height} if ! $Scratch->{ui_type_width}; return; [/perl] or or
Field label
What should display as field title.
Fixed list
This is a comma-separated list of values to present. It takes the form
VALUE=Label text*

where VALUE is the value to go in the cell, Label text is the label for the selection, and the optional * selects this as a default.
List Lookup
Looks up unique values and places in select box.

Table Column (if not [scratch meta_column])
Filter
Allows you to filter against common errors. Select as many as wanted.

Help text
Displayed just like this.

[calc] my $check = $Values->{ui_data_fields} || $Tag->db_columns(); return if $check =~ /\b$Values->{ui_data_key_name}\b/; my $name = $Values->{ui_data_key_name}; my $val = $Scratch->{arg}; $val =~ s/"/"/g; [/calc]
    [if !value ui_too_large] [L]Auto-export[/L] [/if] [value name=ui_data_fields set=""] @_UI_STD_FOOTER_@