home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / calendar-2010-08-23.tar.gz / calendar-2010-08-23.tar / calendar / functions / list_languages.php < prev    next >
PHP Script  |  2003-10-12  |  637b  |  20 lines

  1. <?php
  2.  
  3. print "<form>\n<select name=\"action\" class=\"query_style\">\n";
  4. $dir_handle = @opendir(BASE.'languages/');
  5. $tmp_pref_language = urlencode(ucfirst($language));
  6. while ($file = readdir($dir_handle)) {
  7.     if (substr($file, -8) == ".inc.php") {
  8.         $language_tmp = urlencode(ucfirst(substr($file, 0, -8)));
  9.         if ($language_tmp == $tmp_pref_language) {
  10.             print "<option value=\"$current_view.php?chlang=$language_tmp\" selected>in $language_tmp</option>\n";
  11.         } else {
  12.             print "<option value=\"$current_view.php?chlang=$language_tmp\">in $language_tmp</option>\n";
  13.         }
  14.     }
  15. }
  16.  
  17. closedir($dir_handle);
  18. print "</select>\n</form>\n";
  19.  
  20. ?>