<?php
/*
    CREATIVE COMMONS - Attribution-No Derivative Works 3.0 Germany:
    - You may not alter, transform, or build upon this work.
    - Dieses Werk darf nicht bearbeitet oder in anderer Weise verändert werden.
*/
  if ( $senden && $UserLanguage=="" )
  {
    echo '<tr><td></td><td class="ErrorMessage">'.$L_108.'</td></tr>';
  }
  echo '<tr>
          <td>'.$L_UserLanguage.':</td>
          <td>
            <select name="UserLanguage" size="1">';
  // Sprachen zählen
    $directory = 'languages';
    $handle=opendir ($directory);
    $i=0;
    while ($file = readdir ($handle))
    {
      if ($file != "." && $file != "..") { $i++; }
    }
  // Fehlermeldung, wenn keine Sprachen vorhanden
    if ($i == 0) { echo $L_036; }  
    else // Sprachen-Liste ausgeben
    {
      $handle=opendir ($directory);
      if ( getCurrentUserVar('UserLanguage')=='' && $UserLanguage=="" )
      {
        echo '<option value="" selected="selected"></option>';
      }
      else
      {
      }
      while ($file = readdir ($handle))
      {
        if ($file != "." && $file != "..")
        {
          $file = str_replace('.php','',$file);
          echo '<option value="'.$file.'" ';
          if ( $file==getCurrentUserVar('UserLanguage') && $UserLanguage=="" ) { echo ' selected="selected"'; }
          if ( $file==$UserLanguage ) { echo ' selected="selected"'; }
          $file = ucwords ($file);
          echo '>'.$file.'</option>';
        }
      }
    }
  closedir($handle);
  echo '</select>
      </td>
    </tr>';
?>
