/[pxelator]/lib/PXElator/html.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/html.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 345 by dpavlin, Thu Aug 27 19:58:18 2009 UTC revision 346 by dpavlin, Sat Aug 29 16:51:07 2009 UTC
# Line 66  sub pre_dump { Line 66  sub pre_dump {
66          qq|<pre>$dump</pre>|;          qq|<pre>$dump</pre>|;
67  }  }
68    
69    sub conf {
70            my ($ip,$conf,$format) = @_;
71            my @editable = splice(@_,3);
72    
73            warn "# conf ",dump( $ip, $conf, $format, [ @editable ] );
74    
75            $format ||= 'inline';
76    
77            my @opts = map {
78                    my $name = $_;
79                    my $html = $conf->{$name};
80    
81                    if ( $format eq 'edit' && grep { m/^$name$/ } @editable ) {
82                            $size = length($html);
83                            ( $name, qq|<input name=$name value="$html" size=$size>| )
84                    } else {
85                            if ( $name eq 'amt' ) {
86                                    $html = qq|<a title="$html" href=http://$ip:16992/logon.htm>logon</a>|;
87                            }
88                            $html = qq|<pre style="display: inline">$html</pre>|
89                            unless
90                            $html =~ s{\b(\S+)\t(\S+)\t(\S+)\b}{<b title="$1/$2">$3</b> }gs;
91                    
92                            if ( $format =~ /edit|table/ ) {
93                                    ( $name, $html );
94                            } else {
95                                    qq|<em>$name</em> $html<br>|
96                            }
97                    }
98            } keys %$conf;
99    
100            $format eq 'inline' ? join("\n", @opts) : @opts;
101    }
102    
103  warn "loaded";  warn "loaded";
104    
105  1;  1;

Legend:
Removed from v.345  
changed lines
  Added in v.346

  ViewVC Help
Powered by ViewVC 1.1.26