%doc> Show Database Table or Column descriptions. This provides context help. %doc> % % % <%args> $table $col => undef; %args> % <%attr> title => 'Help' %attr> % <%init> my $DEBUG = 0; my @field_headers; my @cell_data; my $table_help = $ui->table_descr_link($table, $table); if ( $col ){ my $mcol = $table->meta_data->get_column($col); my $descr = $mcol->descr(); my $tag = $mcol->tag(); my $type = $mcol->sql_type(); @field_headers = ( 'Table:', 'Column Name:', 'Column Label:', 'Column Type', 'Description:' ); @cell_data = ( $table_help, $col, $tag, $type, $descr ); if ( my $ftname = $mcol->links_to ){ push @field_headers, "References:"; push @cell_data, $ui->table_descr_link($ftname, $ftname); } }else{ my $mtable = $table->meta_data; my $descr = $mtable->descr(); my @cols = grep !/^id/, $mtable->get_column_names; my @clinks = map { $ui->col_descr_link($table, $_, $_) } @cols; my $clinks = join ', ', @clinks; @field_headers = ( 'Table:', 'Description:', 'Columns:' ); @cell_data = ( $table, $descr, $clinks ); } $m->clear_buffer; %init>