[flag type=write table=mv_metadata] [set table_perms]mv_metadata[/set] [tmp page_title] New view for table display: [cgi ui_table] [/tmp] [set ui_class]Tables[/set] @_UI_STD_HEAD_@ [tmpn bounce_url][/tmpn] [perl tables="mv_metadata"] my $db = $Db{mv_metadata}; my $tn = $CGI->{ui_table}; my $vn = $CGI->{ui_view}; my $kn = $tn; $kn = $vn . '::' . $tn if $vn; my $errs = $Tag->error( { all => 1 }); if($CGI->{do_view} and ! $errs and $vn) { if($CGI->{based_on}) { $db->clone_row($CGI->{based_on}, $kn); } my %o = ( href => 'admin/db_metaconfig', form => qq{ ui_view=$vn ui_table=$tn }, ); $Scratch->{bounce_url} = $Tag->area(\%o); return; } my $q = "select code, name from mv_metadata where code like '$tn'"; my $ary = $db->query( { table => 'mv_metadata', sql => $q } ); my @tabs = ("=none", "$tn=Base table view*"); for(@$ary) { my ($code, $desc) = @$_; next unless $code =~ /^\w+::$tn$/; if(! $desc) { $desc = "$code view"; } else { $desc = "$desc ($code)"; } $desc =~ s/,/)/g; push @tabs, "$code=$desc"; } $Scratch->{view_options} = join ",", @tabs; return; [/perl] [bounce href="[scratch bounce_url]" if="[scratch bounce_url]"] [table-editor wizard=1 ui_wizard_fields="ui_table ui_view based_on" table_width="50%" hidden.do_view=1 href="@@MV_PAGE@@" action=go ui_prevpage="" no_meta=1 no_top=1 check.ui_view=required widget=`{ based_on => 'select', ui_table => 'hidden_text', ui_view => 'text_20', }` override=`{ ui_table => $CGI->{ui_table}, }` options.based_on=`$Scratch->{view_options}` label=`{ ui_table => 'Base table', ui_view => 'View name', based_on => 'Based on view', }` help=`{ ui_view => 'Word characters only...[A-Za-z0-9_]', based_on => 'Copy this view as a starting point for new view', }` /] @_UI_STD_FOOTER_@