/[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.3 by wakaba, Mon Jul 21 05:24:32 2008 UTC revision 1.4 by wakaba, Mon Jul 21 05:48:55 2008 UTC
# Line 157  sub add_error ($%) { Line 157  sub add_error ($%) {
157    }    }
158    
159    $out->start_tag ('dd', class => $class);    $out->start_tag ('dd', class => $class);
160    
161      ## Error level
162      
163      if ($error_level eq 'm') {
164        $out->html (qq[<strong><a href="../error-description#level-m"><em class=rfc2119>MUST</em>-level
165            error</a></strong>: ]);
166      } elsif ($error_level eq 's') {
167        $out->html (qq[<strong><a href="../error-description#level-s"><em class=rfc2119>SHOULD</em>-level
168            error</a></strong>: ]);
169      } elsif ($error_level eq 'w') {
170        $out->html (qq[<strong><a href="../error-description#level-w">Warning</a></strong>: ]);
171      } elsif ($error_level eq 'u') {
172        $out->html (qq[<strong><a href="../error-description#level-u">Not
173            supported</a></strong>: ]);
174      } elsif ($error_level eq 'i') {
175        $out->html (qq[<strong><a href="../error-description#level-i">Information</a></strong>: ]);
176      }
177    
178      ## Error message
179    
180    $out->text ($error_type_text);    $out->text ($error_type_text);
181    
182      ## Additional error description
183    
184    if (defined $opt{text}) {    if (defined $opt{text}) {
185      $out->html (' (<q>');      $out->html (' (<q>');
186      $out->text ($opt{text});      $out->text ($opt{text});
187      $out->html ('</q>)');      $out->html ('</q>)');
188    }    }
189      
190      ## Link to a long description
191    
192    my $fragment = $opt{type};    my $fragment = $opt{type};
193    $fragment =~ tr/ /-/;    $fragment =~ tr/ /-/;
194    $fragment = $out->encode_url_component ($fragment);    $fragment = $out->encode_url_component ($fragment);
195    $out->text (' [');    $out->text (' [');
196    $out->link ('Description', url => '../error-description#' . $fragment);    $out->link ('Description', url => '../error-description#' . $fragment,
197                  rel => 'help');
198    $out->text (']');    $out->text (']');
199    
200    
# Line 293  is <em>under development</em>.  The resu Line 318  is <em>under development</em>.  The resu
318    $out->end_section;    $out->end_section;
319  } # generate_result_section  } # generate_result_section
320    
 sub get_error_level_label ($) {  
   my $self = shift;  
   my $err = shift;  
   
   my $r = '';  
   
   if (not defined $err->{level} or $err->{level} eq 'm') {  
     $r = qq[<strong><a href="../error-description#level-m"><em class=rfc2119>MUST</em>-level  
         error</a></strong>: ];  
   } elsif ($err->{level} eq 's') {  
     $r = qq[<strong><a href="../error-description#level-s"><em class=rfc2119>SHOULD</em>-level  
         error</a></strong>: ];  
   } elsif ($err->{level} eq 'w') {  
     $r = qq[<strong><a href="../error-description#level-w">Warning</a></strong>:  
         ];  
   } elsif ($err->{level} eq 'u' or $err->{level} eq 'unsupported') {  
     $r = qq[<strong><a href="../error-description#level-u">Not  
         supported</a></strong>: ];  
   } elsif ($err->{level} eq 'i') {  
     $r = qq[<strong><a href="../error-description#level-i">Information</a></strong>: ];  
   } else {  
     my $elevel = htescape ($err->{level});  
     $r = qq[<strong><a href="../error-description#level-$elevel">$elevel</a></strong>:  
         ];  
   }  
   
   return $r;  
 } # get_error_level_label  
   
321  1;  1;

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24