[ PHPXref.com ] [ Generated: Sun Jul 20 20:25:38 2008 ] [ SPiD 1.3.1 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/admin/ -> scan_lang.php (source)

   1  <?
   2      // Language scanning for SPiD v1.3.0
   3      // http://spid.adnx.net/
   4      // by Cariad IlmÓra <cariad@adnx.net>
   5      
   6      // This script scan the lang/ directory
   7      // and construct an auto reloading select form
   8      // with all the available language
   9      
  10      require_once  "scan_lang_insert.php";
  11      
  12      $mydir = getcwd() . "/../lang";
  13      if ($dir = @opendir($mydir)) {
  14          $url = "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["PHP_SELF"];
  15          print "<select name=\"language\" onchange=\"JS_jump(this)\">\n";
  16          while (($file = readdir($dir)) !== false) {
  17              list ($code, $name) = myfiletype($file, 1);
  18              if ($code != null) {
  19                  // Will build <select> with the given $url var (contain the current url)
  20                  list ($firsturl, $secondurl) = split("\?", $url);
  21                  if ($secondurl != null) {
  22                      // For sanity reasons, the $url will be parsed
  23                      // and rebuild - to eliminate multiple reference to $lang
  24  
  25                      // Getting base url
  26                      $url = "http://".$_SERVER["HTTP_HOST"].$PHP_SELF.'?';
  27                       print "<option value=\"$url"."lang=$code\""; }
  28                  else { print "<option value=\"$url?lang=$code\""; }
  29                  if ($lang == $code) { print " selected=\"selected\""; }
  30                  print ">$name</option>\n";
  31              }
  32          }
  33          print "</select>";
  34      } else { die("Can't open language directory !"); }
  35  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]