df21b2fac6f073e60fb41414aa7cd707f3eea3d2
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 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 18 years ago

8) 
Peter Palfrader We don't claim to do XML an...

Peter Palfrader authored 18 years ago

9) #<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
10) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
11) #<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
12) <html>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

13) <head>
14)   <title>Tor: $(TITLE)</title>
15)   <meta name="Author" content="Roger Dingledine" />
16)   <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

30) 	    my %navigation;
31) 	    my @keys;
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 18 years ago

45) 	                 $key, $navigation{$key};
46) 	        } else {
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 18 years ago

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

Peter Palfrader authored 18 years ago

54) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

66) 	        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

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

72) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

73)         </td>
74)     </tr>
75) </table>
76)