mirror of
https://github.com/torproject/webwml.git
synced 2025-01-10 20:01:37 +00:00
oh look, right-to-left is working
This commit is contained in:
parent
c51bf8593b
commit
969889618a
116
include/ar/foot.wmi
Normal file
116
include/ar/foot.wmi
Normal file
@ -0,0 +1,116 @@
|
||||
#!/usr/bin/env wml
|
||||
<div id="footer">
|
||||
<div class="onion"><img src="$(IMGROOT)/onion.jpg" alt="Tor"></div>
|
||||
<div class="about">
|
||||
<p>"تور" و"شعار البصلة" علامتان تجاريتان مسجلتان ل<a href="<page
|
||||
docs/trademark-faq>">The Tor Project, Inc.</a> محتويات الموقع
|
||||
تخضع لرخصة <a
|
||||
href="http://creativecommons.org/licenses/by/3.0/us/">المشاع
|
||||
الإبداعي: النسبة 3.0 الولايات المحدة</a> ما لم يُشر إلى خلاف
|
||||
ذلك.</p>
|
||||
<!--
|
||||
# This will grab the date from svn info but formatting is tedious
|
||||
# REQUIRES svn for this to work
|
||||
<:{
|
||||
my $svninfo = `svn info`;
|
||||
if ($svninfo =~ m/Last Changed Date: (\d{4}-\d{2}-\d{2})\s(\d{2}:\d{2}:\d{2})\s(.*)\s\((.*)\)/) {
|
||||
my $modifydate = "$4 $2 $3";
|
||||
# remove commas from date
|
||||
$modifydate =~ s/,//;
|
||||
print 'Last modified: '.$modifydate."\n";
|
||||
}
|
||||
}:>
|
||||
<:{
|
||||
#my $compiledate = `date`;
|
||||
my $compiledate = `date +"%a %b %d %Y %k:%M:%S %z"`;
|
||||
print 'Last compiled: '.$compiledate."\n";
|
||||
}:>
|
||||
-->
|
||||
</div>
|
||||
<!-- END ABOUT -->
|
||||
<!-- WE HAVE NO NEWSLETTER SO REMOVE THIS
|
||||
<div class="newsletter">
|
||||
<form action="">
|
||||
<input class="textfield" type="text" name="email" value="اشترك بنشرتنا! أدخل بريدك." onClick="clearDefault(this);">
|
||||
<input class="signup" type="submit" name="submit" value="اشترك">
|
||||
</form>
|
||||
</div>
|
||||
END NEWSLETTER -->
|
||||
<div class="col first">
|
||||
<h4>عن تور</h4>
|
||||
<ul>
|
||||
<li><a href="<page about/overview>">مهمة تور</a></li>
|
||||
<li><a href="<page about/torusers>">مستخدمو تور</a></li>
|
||||
<li><a href="<page about/corepeople>">أهم شخصيات تور</a></li>
|
||||
<li><a href="<page about/sponsors>">الممولون</a></li>
|
||||
<li><a href="<page about/contact>">اتصل بنا</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- END COL -->
|
||||
<div class="col">
|
||||
<h4>انضم</h4>
|
||||
<ul>
|
||||
<li><a href="<page donate/donate>">تبرع</a></li>
|
||||
<li><a href="<page docs/documentation>#MailingLists">القائمة البريدية</a></li>
|
||||
<li><a href="<page getinvolved/mirrors>">مرايا</a></li>
|
||||
<li><a href="<page docs/hidden-services>">الخدمات المخفية</a></li>
|
||||
<li><a href="<page getinvolved/translation>">ترجمات</a></li>
|
||||
<li><a href="<page getinvolved/open-positions>">وظائف</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- END COL -->
|
||||
<div class="col">
|
||||
<h4>التوثيق</h4>
|
||||
<ul>
|
||||
<li><a href="<page docs/tor-manual>">الأدلة</a></li>
|
||||
<li><a href="<page docs/documentation>">أدلة التثبيت</a></li>
|
||||
<li><a href="<wiki>">ويكي تور</a></li>
|
||||
<li><a href="<page docs/faq>">الأسئلة الشائعة عن تور</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- END COL -->
|
||||
<!-- LANGUAGE SWITCH CGI
|
||||
<div class="col wider">
|
||||
<h4>لغات</h4>
|
||||
# this is a cgi trampoline to bounce us to the right page
|
||||
# alternately, if the client supports javascript we can redirect that way
|
||||
# noscript does not block onclick but clients may have disabled javascript completely
|
||||
#
|
||||
# for this to work we need to know the relative path from the document root
|
||||
# to the current directory that wml is in.
|
||||
<form action="$(DOCROOT)/cgi-bin/languageswitch.cgi">
|
||||
<select name="Language" id="lang">
|
||||
<:{
|
||||
#import "perl-globals.wmi";
|
||||
use Cwd;
|
||||
use Cwd 'abs_path';
|
||||
use File::Spec;
|
||||
my $urlbase = File::Spec->abs2rel(getcwd(),abs_path("$(DOCROOT)"));
|
||||
my $LANGUAGES;
|
||||
my $page = $WML_SRC_FILENAME;
|
||||
opendir(DIR, getcwd()) or die $!;
|
||||
# take a look and see what language support we have
|
||||
while (my $file = readdir(DIR)) {
|
||||
if (-d $file) {
|
||||
if (-e "$file/$page") {
|
||||
my $url = $urlbase.'/'.$WML_SRC_BASENAME.'.html.'.$file;
|
||||
my $url2js = $WML_SRC_BASENAME.'.html.'.$file;
|
||||
print '<option value="'.$url.'" onclick="window.location=\''.$url2js.'\'">'.$LANGUAGES{$file}.'</option>'."\n" unless not defined $LANGUAGES{$file};
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir(DIR);
|
||||
}:>
|
||||
</select>
|
||||
<input class="go" type="submit" name="submit" value="اذهب">
|
||||
</form>
|
||||
<p>ألديك أسئلة عن هذا؟ زُر <a href="http://www.debian.org/intro/cn#howtoset">كيفية ضبط لغة المستندات المبدئية</a>.</p>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<!-- END FOOTER -->
|
||||
|
||||
</div>
|
||||
<!-- END WRAP -->
|
||||
</body>
|
||||
</html>
|
142
include/ar/head.wmi
Normal file
142
include/ar/head.wmi
Normal file
@ -0,0 +1,142 @@
|
||||
#! /usr/bin/wml
|
||||
<: use strict; :>
|
||||
<: use warnings; :>
|
||||
#use "perl-globals.wmi"
|
||||
#use "links.wmi"
|
||||
#use "versions.wmi"
|
||||
#use "navigation.wmi"
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>$(TITLE)</title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="$(IMGROOT)/favicon.ico">
|
||||
<ifneq "$(REDIRECT)" "" "<meta http-equiv="refresh" content="0;url=$(DOCROOT)/$(REDIRECT)">">
|
||||
<ifneq "$(REDIRECT_GLOBAL)" "" "<meta http-equiv="refresh" content="0;url=$(REDIRECT_GLOBAL)">">
|
||||
<ifeq "$(ANNOUNCE_RSS)" "yes" "<link rel="alternate" title="Tor Project OR-announce" href="http://rss.gmane.org/gmane.network.onion-routing.announce"
|
||||
type="application/rss+xml">">
|
||||
|
||||
# begin WML to generate css/js paths
|
||||
<ifneq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/$(STYLESHEET)">">
|
||||
<ifeq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/master.css">">
|
||||
|
||||
#<link href="css/master.css" rel="stylesheet" type="text/css">
|
||||
<!--[if lte IE 7]>
|
||||
<link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie7-and-down.css">
|
||||
<![endif]-->
|
||||
<!--[if IE 6]>
|
||||
<link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie6.css">
|
||||
<![endif]-->
|
||||
# <script language="javascript" type="text/javascript" src="$(DOCROOT)/global.js"></script>
|
||||
# end WML to generate css/js paths
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="author" content="The Tor Project, Inc.">
|
||||
<meta name="keywords" content="anonymity online, tor, tor project, censorship circumvention, traffic analysis, anonymous communications research">
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<div id="header">
|
||||
<h1 id="logo"><a href="<page index>">Tor</a></h1>
|
||||
# navigation menu generation
|
||||
<div id="nav">
|
||||
<ul>
|
||||
<:{
|
||||
# create a hash and maintain order of keys
|
||||
my %navigation;
|
||||
my @keys;
|
||||
while (@navigation) {
|
||||
my $key = shift @navigation;
|
||||
my $val = shift @navigation;
|
||||
push @keys, $key;
|
||||
$navigation{$key} = $val;
|
||||
}
|
||||
|
||||
my $page = $WML_SRC_BASENAME;
|
||||
my $lang = "$(LANG)";
|
||||
|
||||
for my $key (@keys) {
|
||||
my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,;
|
||||
|
||||
# in directory of active link, set class active
|
||||
my $class;
|
||||
if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) {
|
||||
$class = 'class="active"';
|
||||
} else {
|
||||
$class = '';
|
||||
}
|
||||
|
||||
$dir = '.' unless defined $dir;
|
||||
|
||||
# translated version
|
||||
if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
|
||||
printf '<li><a '.$class.' href="%s">%s</a></li>'."\n",
|
||||
stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$navigation{$key};
|
||||
}
|
||||
# english version
|
||||
elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
|
||||
printf '<li><a '.$class.' href="%s">%s</a></li>'."\n",
|
||||
stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $navigation{$key};
|
||||
}
|
||||
# full url
|
||||
elsif ($key =~/^http/) {
|
||||
printf '<li><a href="%s">%s</a></li>'."\n", $key, $navigation{$key};
|
||||
} else {
|
||||
warn "$WML_SRC_FILENAME has a [page $key] (parses to
|
||||
docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist.";
|
||||
}
|
||||
}
|
||||
}:>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- END NAV -->
|
||||
# end navigation generation
|
||||
<div id="calltoaction">
|
||||
<ul>
|
||||
<:{
|
||||
my %calltoaction;
|
||||
my @keys;
|
||||
while (@calltoaction) {
|
||||
my $key = shift @calltoaction;
|
||||
my $val = shift @calltoaction;
|
||||
push @keys, $key;
|
||||
$calltoaction{$key} = $val;
|
||||
}
|
||||
|
||||
my $page = $WML_SRC_BASENAME;
|
||||
my $lang = "$(LANG)";
|
||||
for my $key (@keys) {
|
||||
my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,;
|
||||
|
||||
# in directory, set active
|
||||
my $class;
|
||||
if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) {
|
||||
#if ($WML_SRC_BASENAME eq $base) {
|
||||
$class = 'class="active"';
|
||||
} else {
|
||||
$class = '';
|
||||
}
|
||||
|
||||
$dir = '.' unless defined $dir;
|
||||
# try to use a translated version
|
||||
if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
|
||||
printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n",
|
||||
stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$calltoaction{$key};
|
||||
}
|
||||
# default to english version
|
||||
elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
|
||||
printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n",
|
||||
stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $calltoaction{$key};
|
||||
} else {
|
||||
warn "$WML_SRC_FILENAME has a [page $key] (parses to docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist.";
|
||||
}
|
||||
}
|
||||
}:>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- END CALLTOACTION -->
|
||||
</div>
|
||||
<!-- END HEADER -->
|
||||
|
||||
#<ifneq "$(REDIRECT)" "" "Redirecting to <a href="$(DOCROOT)/$(REDIRECT)">$(DOCROOT)/$(REDIRECT)</a>.">
|
||||
#<ifneq "$(REDIRECT_GLOBAL)" "" "Redirecting to <a href="$(REDIRECT_GLOBAL)">$(REDIRECT_GLOBAL)</a>.">
|
11
include/ar/info.wmi
Normal file
11
include/ar/info.wmi
Normal file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env wml
|
||||
<div class="img-shadow">
|
||||
<div class="infoblock">
|
||||
<h2 class="bulb">تلميحة عن تور</h2>
|
||||
<p>يكتب تور ويدعمه أناس مثلك. <a href="<page
|
||||
donate/donate>">تبرع الآن</a>!</p>
|
||||
|
||||
</div>
|
||||
<!-- END INFOBLOCK -->
|
||||
</div>
|
||||
<!-- END IMG-SHADOW -->
|
24
include/ar/navigation.wmi
Normal file
24
include/ar/navigation.wmi
Normal file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/wml
|
||||
|
||||
## translation metadata
|
||||
# Revision: $Revision: 22069 $
|
||||
# Translation-Priority: 1-high
|
||||
|
||||
<:
|
||||
# path link text
|
||||
my @navigation = (
|
||||
'index' , 'الرئيسية',
|
||||
'about/overview' , 'عن تور',
|
||||
'docs/documentation' , 'التوثيق',
|
||||
'projects/projects' , 'المشاريع',
|
||||
'press/press' , 'صحافة',
|
||||
'<blog>' , 'المدونة',
|
||||
'http://printfection.com/torprojectstore' , 'المتجر',
|
||||
);
|
||||
my @calltoaction = (
|
||||
'download/download' , 'نزّل',
|
||||
'donate/donate' , 'تبرّع',
|
||||
'getinvolved/volunteer' , 'انضم',
|
||||
);
|
||||
|
||||
:>
|
91
include/ar/side.wmi
Normal file
91
include/ar/side.wmi
Normal file
@ -0,0 +1,91 @@
|
||||
#! /usr/bin/wml
|
||||
<: use strict; :>
|
||||
<: use warnings; :>
|
||||
#use "perl-globals.wmi"
|
||||
#use "links.wmi"
|
||||
#use "versions.wmi"
|
||||
#use "sidenav.wmi"
|
||||
<div class="img-shadow">
|
||||
<div id="sidenav">
|
||||
<:
|
||||
# recursively search menu structure to see if it contains a given page
|
||||
sub containsSub($$);
|
||||
sub containsSub($$) {
|
||||
my ($elements, $page) = @_;
|
||||
for my $ele (@{$elements}) {
|
||||
if (containsSub($ele->{'subelements'},$page)){
|
||||
return 1;
|
||||
} elsif ($page eq $ele->{'url'}) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
# generate navigation menu
|
||||
sub printNavMenu($$$);
|
||||
sub printNavMenu($$$) {
|
||||
my ($navmenu, $page, $lang) = @_;
|
||||
print '<ul>'."\n";
|
||||
for my $navmenu (@{$navmenu}) {
|
||||
# this menu entry is the current (active) page
|
||||
if ($navmenu->{'url'} eq $page) {
|
||||
|
||||
# the current page has nested menu elements
|
||||
if ($navmenu->{'subelements'}) { # menu has dropdown
|
||||
printf '<li class="dropdown active"><a class="active" href="%s">%s</a></li>'."\n",
|
||||
pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
|
||||
|
||||
print '<li>'."\n";
|
||||
printNavMenu($navmenu->{'subelements'},$page,$lang);
|
||||
print '</li>'."\n";
|
||||
|
||||
# the current (active) page does not have sub elements
|
||||
} else {
|
||||
printf '<li class="active"><a class="active" href="%s">%s</a></li>'."\n",
|
||||
pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
|
||||
}
|
||||
|
||||
# a subelement of this menu item is the current (active) page
|
||||
} elsif (containsSub($navmenu->{'subelements'}, $page)) {
|
||||
printf '<li class="dropdown"><a class="active" href="%s">%s</a></li>'."\n",
|
||||
pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
|
||||
|
||||
print '<li>'."\n"; #encapsulate subelements
|
||||
# recurse to generate the expanded menu
|
||||
printNavMenu($navmenu->{'subelements'},$page,$lang);
|
||||
print '</li>'."\n"; #encapsulate subelements
|
||||
|
||||
# the menu entry is not active and does not enclose the active page
|
||||
} else {
|
||||
|
||||
# if there are subelements, set collapsed style
|
||||
if ($navmenu->{'subelements'}) {
|
||||
printf '<li class="dropdown"><a href="%s">%s</a></li>'."\n",
|
||||
pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
|
||||
# regular menu entry
|
||||
} else {
|
||||
printf '<li><a href="%s">%s</a></li>'."\n",
|
||||
pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</ul>'."\n";
|
||||
}
|
||||
|
||||
my $lang = "$(LANG)";
|
||||
|
||||
use Cwd;
|
||||
use Cwd 'abs_path';
|
||||
use File::Spec;
|
||||
|
||||
# get document path from site root
|
||||
my $path = File::Spec->abs2rel(getcwd(),abs_path("$(DOCROOT)"));
|
||||
my $page = $WML_SRC_BASENAME;
|
||||
printNavMenu($sidenav, $path.'/'.$page, $lang);
|
||||
:>
|
||||
</div>
|
||||
<!-- END SIDENAV -->
|
||||
</div>
|
||||
<!-- END IMG-SHADOW -->
|
Loading…
x
Reference in New Issue
Block a user