/[suikacvs]/test/html-webhacc/WebHACC/Result.pm
Suika

Diff of /test/html-webhacc/WebHACC/Result.pm

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

revision 1.4 by wakaba, Mon Jul 21 05:48:55 2008 UTC revision 1.6 by wakaba, Mon Jul 21 12:56:34 2008 UTC
# Line 53  sub add_error ($%) { Line 53  sub add_error ($%) {
53    
54    my $class = qq[level-$error_level layer-$error_layer];    my $class = qq[level-$error_level layer-$error_layer];
55    
56    $out->start_tag ('dt', class => $class);    ## Line & column numbers (prepare values)
   my $has_location;  
   
   ## URL  
     
   if (defined $opt{url}) {  
     $out->url ($opt{url});  
     $has_location = 1;  
   }  
   
   ## Line & column number  
57    
58    my $line;    my $line;
59    my $column;    my $column;
# Line 97  sub add_error ($%) { Line 87  sub add_error ($%) {
87        $column = $opt{column};        $column = $opt{column};
88      }      }
89    }    }
90      $line = $line - 1 || 1
91          if defined $line and not (defined $column and $column > 0);
92    
93      $out->start_tag ('dt', class => $class,
94                       'data-type' => $opt{type},
95                       'data-level' => $error_level,
96                       'data-layer' => $error_layer,
97                       ($line ? ('data-line' => $line) : ()),
98                       ($column ? ('data-column' => $column) : ()));
99      my $has_location;
100    
101      ## URL
102      
103      if (defined $opt{url}) {
104        $out->url ($opt{url});
105        $has_location = 1;
106      }
107    
108      ## Line & column numbers (real output)
109    
110    if (defined $line) {    if (defined $line) {
111      if (defined $column and $column > 0) {      if (defined $column and $column > 0) {
112        $out->xref ('Line ' . $line, target => 'line-' . $line);        $out->xref ('Line #', text => $line, target => 'line-' . $line);
113        $out->text (' column ' . $column);        $out->text (' ');
114          $out->nl_text ('column #', text => $column);
115      } else {      } else {
116        $line = $line - 1 || 1;        $out->xref ('Line #', text => $line, target => 'line-' . $line);
       $out->xref ('Line ' . $line, target => 'line-' . $line);  
117      }      }
118      $has_location = 1;      $has_location = 1;
119    }    }
# Line 120  sub add_error ($%) { Line 129  sub add_error ($%) {
129    if (defined $opt{index}) {    if (defined $opt{index}) {
130      if ($opt{index_has_link}) {      if ($opt{index_has_link}) {
131        $out->html (' ');        $out->html (' ');
132        $out->xref ('Index ' . (0+$opt{index}),        $out->xref ('Index #', text => (0+$opt{index}),
133                    target => 'index-' . (0+$opt{index}));                    target => 'index-' . (0+$opt{index}));
134      } else {      } else {
135        $out->text (' Index ' . (0+$opt{index}));        $out->html (' ');
136          $out->nl_text ('Index #', text => (0+$opt{index}));
137      }      }
138      $has_location = 1;      $has_location = 1;
139    }    }
# Line 152  sub add_error ($%) { Line 162  sub add_error ($%) {
162      }      }
163            
164      unless ($has_location) {      unless ($has_location) {
165        $out->text ('No location information available');        $out->text ('Unknown location');
166      }      }
167    }    }
168    
# Line 177  sub add_error ($%) { Line 187  sub add_error ($%) {
187    
188    ## Error message    ## Error message
189    
190    $out->text ($error_type_text);    $out->nl_text ($error_type_text, node => $opt{node}, text => $opt{text});
191    
192    ## Additional error description    ## Additional error description
193    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24