slitaz-base-files view rootfs/var/www/cgi-bin/index.cgi @ rev 179

add/fix i18n; make pot && make msgmerge; add ru.po
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon May 21 10:44:59 2012 +0300 (2012-05-21)
parents eb82a783ff60
children b2311939ad7e
line source
1 #!/bin/sh
3 # Internationalization.
4 . /usr/bin/gettext.sh
5 TEXTDOMAIN='slitaz-base'
6 . /etc/locale.conf
7 export TEXTDOMAIN LANG
9 [ ! -d ..$QUERY_STRING ] && echo "HTTP/1.1 404 Not Found" || cat <<EOT
10 Content-type: text/html
12 <!DOCTYPE html>
13 <html xmlns="http://www.w3.org/1999/xhtml">
14 <head>
15 <title>$(eval_gettext "Index of \$QUERY_STRING")</title>
16 <meta charset="utf-8" />
17 <link rel="stylesheet" type="text/css" href="/style.css" />
18 </head>
20 <!-- Header -->
21 <div id="header">
22 <h1>$(eval_gettext "Index of \$QUERY_STRING")</h1>
23 </div>
25 <!-- Content -->
26 <div id="content">
27 <body>
28 <ul>
29 $({ [ "$QUERY_STRING" != "/" ] && echo "../"; ls -p ..$QUERY_STRING; } | \
30 sed 's|.*| <li><a href="&">&</a></li>|')
31 </ul>
32 </div>
34 <!-- Footer -->
35 <div id="footer">
36 Copyright &copy; $(date +%Y) <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a>
37 </div>
39 </body>
40 </html>
41 EOT