--- /dev/null
+package NB::CGI;
+# NB 22.11.23: TODO
+use strict;
+use parent qw/CGI/;
+
+sub textOutput {{
+ no warnings 'redefine';
+ no warnings 'once';
+ #return unless $Opt{html};
+
+ *CGI::_tag_func = sub {
+ my $tagname = shift;
+ my ($q,$a,@rest) = CGI::self_or_default(@_);
+
+ #return "$a\t" if ref($a) eq '' and $a; # LABEL
+ #warn $tagname; return '';
+
+ my($attr) = '';
+ if (ref($a) && ref($a) eq 'HASH') {
+ my(@attr) = CGI::make_attributes($a,$q->{'escape'});
+ $attr = " @attr" if @attr;
+ } else {
+ unshift @rest,$a if defined $a;
+ }
+
+ $tagname = lc( $tagname );
+ my @result = (ref($rest[0]) eq 'ARRAY') ? @{$rest[0]} : "@rest";
+
+ if (0)
+ {
+ }
+ # H.
+ elsif ($tagname =~ /^h(\d+)$/)
+ {
+ @result = map {"$_\n";} @result;
+ }
+ # TH
+ elsif ($tagname eq 'th')
+ {
+ #@result = map { &str_center($_)."\n" } @result;
+ @result = map {$_ ? "$_\n" : '';} @result;
+ }
+ # TD
+ elsif ($tagname =~ /^(start_)?td$/)
+ {
+ #warn $tagname if ($tagname =~ /^(start_)?td$/);
+ @result = map {"|$_";} @result;
+ }
+
+ @result = grep {$_ ne ' '} @result;
+ return "@result";
+ };
+ *CGI::start_TR = sub { return "" };
+ *CGI::end_TR = sub { return "|\n" };
+ *CGI::button = sub { '' };
+ *CGI::checkbox = sub { '' };
+ *CGI::start_html = sub { '' };
+ *CGI::end_html = sub { '' };
+ *CGI::popup_menu = sub {
+ my($self,@p) = CGI::self_or_default(@_);
+ use Data::Dumper;
+ #die Dumper(\@p);
+ my(@values);
+ #for (@p)
+ while (@p)
+ {
+ $_ = shift @p;
+ #warn ">>>$_"; next;
+ next unless $_ eq '-labels';
+ #die 'zaza';
+ my $labels = shift @p;
+ @values = map {$labels->{$_}."\t".$_} keys %$labels;
+ last;
+ }
+ return map {"$_\n"} @values;
+
+ };
+}}
+1;