Advertisement
Guest User

Untitled

a guest
Feb 28th, 2012
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.88 KB | None | 0 0
  1. Ez a subrutine amit atadok
  2.  
  3. sub addSubSection {
  4.     @params = @_;
  5.     if ($params[1] eq 'info') {
  6.         $initStyle = "display:block";
  7.     } else{
  8.         $initStyle = "display:none";
  9.     }
  10.     seek LOGFILE, 0,0;
  11.     @section = grep {$_ =~ $params[2]} <LOGFILE>;  
  12.     if (@section) {
  13.         $id++;
  14.         print REPORT "<$params[0] id=\"$id\" class=\"$params[1]\" style=\"$initStyle\">\n";
  15.         for ($i =0;$i<$#section+1;$i++){   
  16.             @line = split('::',$section[$i]);
  17.             shift(@line);
  18.             chomp(@line);      
  19.             print REPORT  @line;
  20.             print REPORT "<br>\n";     
  21.         }
  22.         print REPORT "</$params[0]>\n";
  23.     }
  24. }
  25.  
  26. ennek a subrutinnak
  27.  
  28. sub addReportEntry {
  29.     @params = @_;
  30.     if (testForEntry($params[0])) {
  31.         $subFunction = $params[3];
  32.         seek LOGFILE, 0,0;
  33.         @entry = grep { $_ =~ $params[1] } <LOGFILE>;
  34.         $id++;
  35.         print REPORT "<span id=\"$id\" class=\"$reportEntryCssClass\">";
  36.         if (@entry) {  
  37.             @line = split('::',pop(@entry));
  38.             shift(@line);
  39.             print REPORT @line;
  40.             if ($params[4]){
  41.                 print REPORT "<input class=\"showButton\" type=\"button\" value=\"Show details\" onClick=\"showhide(this,".($id+1).");\"/>";
  42.             }      
  43.             print REPORT "</span><span id=\"ok\" class=\"$stausCssClass\">";
  44.             print REPORT "OK";
  45.             print REPORT "</span><br>\n";
  46.             if ($params[4]){
  47.                 $subFunction->("p","extendable",$params[4]);
  48.             }          
  49.         }
  50.         else {
  51.             print REPORT $_[2];
  52.             if ($params[4]){
  53.                 print REPORT "<input class=\"showButton\" type=\"button\" value=\"Show details\" onClick=\"showhide(this,".($id+1).");\"/>";
  54.             }      
  55.             print REPORT "</span><span id=\"failed\" class=\"$stausCssClass\">";
  56.             print REPORT "FAILED";
  57.             print REPORT "</span><br>\n";
  58.             if ($params[4]){
  59.                 $subFunction->("p","extendable",$params[4]);
  60.             }
  61.         }
  62.         print REPORT "<hr>\n";
  63.     }
  64. }
  65.  
  66.  
  67. igy hivom meg pl:
  68.  
  69. addReportEntry("LOG_START_LICENCE_UPDATE\:\:","LOG_LICENCE_UPDATE\:\:","Updating licence",\addSubSection,"LOG_LICENCE_UPDATE_EXT");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement