File:  [mozdev] / adblockplus / includes / langnav.php
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Sat May 6 14:36:07 2006 UTC (11 years, 5 months ago) by trev
Branches: MAIN
CVS tags: HEAD
Placing langnav.php above document root

<?php
$file = $_SERVER['REQUEST_URI'];
$file = preg_replace('/\\?.*/', '', $file);
$file = preg_replace('/.*\\//', '', $file);
$file = preg_replace('/[\\0\\\\]/', '', $file);

$languages = array('', 'English', '/fr', 'Fran&ccedil;ais');
$firstitem = ' class="first-item"';
for ($i = 0; $i < count($languages); $i += 2) {
  $prefix = $languages[$i];
  $title = $languages[$i + 1];

  if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/adblockplus/www' . $prefix . '/' . $file)) {
    echo "<a$firstitem href=\"$prefix/$file\">$title</a>\n";
  }
  else {
    echo "<a$firstitem href=\"$prefix/index.html\">$title</a>\n";
  }
  $firstitem = '';
}
?>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>