a7b78564d10a1cd1458b2dcf7b2866ab55fdde67
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

1) #! /usr/bin/wml
Peter Palfrader Make translation status mor...

Peter Palfrader authored 19 years ago

2) <: use strict; :>
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

3) <: use warnings; :>
4) #use "perl-globals.wmi"
5) #use "links.wmi"
6) #use "versions.wmi"
7) #use "navigation.wmi"
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

8) 
9) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
10) <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
11) <head>
12)   <title>Tor: $(TITLE)</title>
13)   <meta name="Author" content="Roger Dingledine" />
14)   <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

15)   <link rel="stylesheet" type="text/css" href="$(DOCROOT)/stylesheet.css" />
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

16)   <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

17)   <ifneq "$(REDIRECT)" "" "<meta http-equiv="refresh" content="0;url=$(DOCROOT)/$(REDIRECT).html" />">
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

18) </head>
19) 
20) <body>
21) 
22) <div class="center">
23) <table class="banner" border="0" cellpadding="0" cellspacing="0">
24)     <tr>
25)         <td class="banner-left"></td>
26)         <td class="banner-middle">
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

27) 	<:{
Peter Palfrader Make translation status mor...

Peter Palfrader authored 19 years ago

28) 	    my %navigation;
29) 	    my @keys;
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

30) 	    while (@navigation) {
Peter Palfrader Make translation status mor...

Peter Palfrader authored 19 years ago

31) 	      my $key = shift @navigation;
32) 	      my $val = shift @navigation;
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

33) 	      push @keys, $key;
34) 	      $navigation{$key} = $val;
35) 	    }
36) 
Peter Palfrader Make translation status mor...

Peter Palfrader authored 19 years ago

37) 	    for my $key (@keys) {
38) 	      my $page = $WML_SRC_FILENAME;
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

39) 	      $page =~ s/\.wml//;
40) 	      if ($page ne $key) {
Peter Palfrader Add gui and minor fixes

Peter Palfrader authored 18 years ago

41) 	        if (-e "$(DOCROOT)/$(LANG)/$key.wml") {
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

42) 	          printf '<a href="$(DOCROOT)/%s.html.$(LANG)">%s</a>'."\n",
Roger Dingledine bugfix on the website: the...

Roger Dingledine authored 18 years ago

43) 	                 $key, $navigation{$key};
44) 	        } else {
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

45) 	          printf '<a href="$(DOCROOT)/%s.html">%s</a>'."\n",
Roger Dingledine bugfix on the website: the...

Roger Dingledine authored 18 years ago

46) 	                 $key, $navigation{$key};
47) 	        }
48) 	      } else {
49) 	       printf '<a class="current">%s</a>'."\n", $navigation{$key};
50) 	      }
51) 	    }
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

52) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

53)         </td>
54)         <td class="banner-right">
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

55) 	<:{
Peter Palfrader Make translation status mor...

Peter Palfrader authored 19 years ago

56) 	  my $page = $WML_SRC_FILENAME;
Roger Dingledine this is a better hack. stil...

Roger Dingledine authored 18 years ago

57) 	  my $numlangs = 0;
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

58) 	  $page =~ s/\.wml//;
Peter Palfrader Add translation-status page

Peter Palfrader authored 19 years ago

59) 	  for my $dir (sort {$LANGUAGES{$a} cmp $LANGUAGES{$b}} @LANGUAGES) {
Roger Dingledine this is a better hack. stil...

Roger Dingledine authored 18 years ago

60) 	    if (-e "$dir/$WML_SRC_FILENAME") {
Peter Palfrader More languages in the top r...

Peter Palfrader authored 18 years ago

61) 	      if ($dir eq '$(LANG)') {
62) 	        printf('<img src="$(IMGROOT)/%s.png" alt="%s" /> ', $dir, $LANGUAGES{$dir});
63) 	      } else {
Peter Palfrader Add gui and minor fixes

Peter Palfrader authored 18 years ago

64) 	        printf('<a href="%s.html.%s"><img src="$(IMGROOT)/%s.png" alt="%s" /></a> ', $page, $dir, $dir, $LANGUAGES{$dir});
Peter Palfrader More languages in the top r...

Peter Palfrader authored 18 years ago

65) 	      };
66) 	    } else {
67) 	      printf('<img src="$(IMGROOT)/green-flagspace.png"/> ');
68) 	    };
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

69) 	  };
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

70) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

71)         </td>
72)     </tr>
73) </table>
74)