Pārlūkot izejas kodu

Show food-type in front of Sodexo Linna.

Toni Fadjukoff 12 gadus atpakaļ
vecāks
revīzija
ccbf668ba5
1 mainītis faili ar 16 papildinājumiem un 1 dzēšanām
  1. 16 1
      sodexo.pl

+ 16 - 1
sodexo.pl Parādīt failu

37
     $parse_func = \&sodexo_parse_finish;
37
     $parse_func = \&sodexo_parse_finish;
38
   } elsif ($token->[0] eq 'S' && $token->[1] eq 'td') {
38
   } elsif ($token->[0] eq 'S' && $token->[1] eq 'td') {
39
     $parse_func = \&sodexo_parse_to_food;
39
     $parse_func = \&sodexo_parse_to_food;
40
+    sodexo_parse_to_food($token);
40
   } elsif ($token->[0] eq 'S' && $token->[1] eq 'th') {
41
   } elsif ($token->[0] eq 'S' && $token->[1] eq 'th') {
41
     sodexo_finish_day();
42
     sodexo_finish_day();
42
     $parse_func = \&sodexo_parse_to_food;
43
     $parse_func = \&sodexo_parse_to_food;
81
   my $token = shift;
82
   my $token = shift;
82
 
83
 
83
   if ($token->[0] eq 'T' && $token->[1] =~ /\S/) {
84
   if ($token->[0] eq 'T' && $token->[1] =~ /\S/) {
84
-     $cur_title = utf8_to_8859($token->[1]);
85
+     $cur_title .= utf8_to_8859($token->[1]);
85
      $parse_func = \&sodexo_parse_to_allergy;
86
      $parse_func = \&sodexo_parse_to_allergy;
86
   }
87
   }
87
 }
88
 }
88
 
89
 
90
+sub sodexo_parse_type {
91
+  my $token = shift;
92
+
93
+  if ($token->[0] eq 'T' && $token->[1] =~ /\S/) {
94
+    $cur_title = utf8_to_8859($token->[1]) . ": ";
95
+    $parse_func = \&sodexo_parse_food; 
96
+  }
97
+}
98
+
89
 sub sodexo_parse_to_food {
99
 sub sodexo_parse_to_food {
90
   my $token = shift;
100
   my $token = shift;
91
   if ($token->[0] eq 'S' && $token->[1] eq "td") {
101
   if ($token->[0] eq 'S' && $token->[1] eq "td") {
92
     my %attrs = %{$token->[2]};
102
     my %attrs = %{$token->[2]};
103
+    if ($attrs{'class'} eq "food-type") {
104
+      $cur_title = '';
105
+      $cur_text = '';
106
+      $parse_func = \&sodexo_parse_type;
107
+    }
93
     if ($attrs{'class'} eq "food-desc") {
108
     if ($attrs{'class'} eq "food-desc") {
94
       $cur_title = '';
109
       $cur_title = '';
95
       $cur_text = '';
110
       $cur_text = '';