[ PHPXref.com ] [ Generated: Sun Jul 20 19:39:24 2008 ] [ PhpGedView 4.0 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> editlang_edit_settings.php (source)

   1  <?php
   2  /**
   3   * File to edit the language settings of PHPGedView
   4   *
   5   * phpGedView: Genealogy Viewer
   6   * Copyright (C) 2002 to 2003  John Finlay and Others
   7   *
   8   * This program is free software; you can redistribute it and/or modify
   9   * it under the terms of the GNU General Public License as published by
  10   * the Free Software Foundation; either version 2 of the License, or
  11   * (at your option) any later version.
  12   *
  13   * This program is distributed in the hope that it will be useful,
  14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16   * GNU General Public License for more details.
  17   *
  18   * You should have received a copy of the GNU General Public License
  19   * along with this program; if not, write to the Free Software
  20   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  21   *
  22   * @package PhpGedView
  23   * @subpackage Admin
  24   * @version $Id: editlang_edit_settings.php,v 1.38.2.25 2006/04/28 18:14:39 canajun2eh Exp $
  25   */
  26  
  27  require  "config.php";
  28  require  $confighelpfile["english"];
  29  if (file_exists( $confighelpfile[$LANGUAGE])) require  $confighelpfile[$LANGUAGE];
  30  
  31  if (!isset($ln)) $ln = "";
  32  if (!isset($action)) $action = "";
  33  if ($action == "" and $ln == "") {
  34    header("Location: admin.php");
  35    exit;
  36  }
  37  
  38  if ($action == "cancel") {
  39    header("Location: changelanguage.php");
  40    exit;
  41  }
  42  
  43  //-- make sure that they have admin status before they can use this page
  44  //-- otherwise have them login again
  45  $uname = getUserName();
  46  if (empty($uname)) {
  47    print "Please close this window and do a Login in the former window first...";
  48    exit;
  49  }
  50  
  51  // Create array with configured languages in gedcoms and users
  52  $configuredlanguages = array();
  53  
  54  // Read GEDCOMS configuration and collect language data
  55  foreach ($GEDCOMS as $key => $value) {
  56    require($value["config"]);
  57    $configuredlanguages["gedcom"][$LANGUAGE][$key] = true;
  58  }
  59  // Read user configuration and collect language data
  60  $users = getUsers("username","asc");
  61  foreach($users as $username=>$user) {
  62    $configuredlanguages["users"][$user["language"]][$username] = true;
  63  }
  64  
  65  // Determine whether this language's Active status should be protected
  66  $protectActive = false;
  67  if (array_key_exists($ln, $configuredlanguages["gedcom"]) or
  68    array_key_exists($ln, $configuredlanguages["users"])) {
  69    $protectActive = true;
  70  }
  71  
  72  $d_LangName = "lang_name_" . $ln;
  73  $sentHeader = false;    // Indicates whether HTML headers have been sent
  74  if ($action !="save" and $action != "toggleActive") {
  75    print_simple_header($pgv_lang["config_lang_utility"]);
  76    $sentHeader = true;
  77  
  78    print "<script language=\"JavaScript\" type=\"text/javascript\">";
  79    print "self.focus();";
  80    print "</script>\n";
  81  
  82    print "<style type=\"text/css\">FORM { margin-top: 0px; margin-bottom: 0px; }</style>";
  83    print "<div class=\"center\"><center>";
  84  }
  85  
  86  /* ------------------------------------------------------------------------------------- */
  87  function write_td_with_textdir_check(){
  88    global $TEXT_DIRECTION;
  89  
  90    if ($TEXT_DIRECTION == "ltr")
  91    {print "<td class=\"facts_value\" style=\"text-align:left; \" >";}
  92    else
  93    {print "<td class=\"facts_value\" style=\"text-align:right; \">";}
  94  }
  95  
  96  /* ------------------------------------------------------------------------------------- */
  97  
  98  if ($action == "new_lang") {
  99    require ( "includes/lang_codes_std.php");
 100    $ln = strtolower($lng_codes[$new_shortcut][0]);
 101  
 102    $d_LangName      = "lang_name_" . $ln;
 103    $languages[$ln]     = $ln;
 104    $pgv_lang_use[$ln]    = true;
 105    $pgv_lang[$ln]    = $lng_codes[$new_shortcut][0];
 106    $lang_short_cut[$ln]    = $new_shortcut;
 107    $lang_langcode[$ln]    = $new_shortcut . ";";
 108    if (array_key_exists($new_shortcut, $lng_synonyms)) $lang_langcode[$ln] .= $lng_synonyms[$new_shortcut];
 109    $pgv_language[$ln]    = "languages/lang.".$new_shortcut.".php";
 110    $confighelpfile[$ln]  = "languages/configure_help.".$new_shortcut.".php";
 111    $helptextfile[$ln]    = "languages/help_text.".$new_shortcut.".php";
 112  
 113    // Suggest a suitable flag file
 114    $temp = strtolower($lng_codes[$new_shortcut][1]).".gif";
 115    if (file_exists("images/flags/".$temp)) {
 116      $flag = $temp;                        // long name takes precedence
 117    } else if (file_exists("images/flags/".$new_shortcut.".gif")) {
 118      $flag = $new_shortcut.".gif";        // use short name if long name doesn't exist
 119    } else $flag = "new.gif";                // default if neither a long nor a short name exist
 120    $flagsfile[$ln] = "images/flags/" . $flag;
 121  
 122    $factsfile[$ln]    = "languages/facts.".$new_shortcut.".php";
 123    $DATE_FORMAT_array[$ln]  = "D M Y";
 124    $TIME_FORMAT_array[$ln]  = "g:i:sa";
 125    $WEEK_START_array[$ln]  = "0";
 126    $TEXT_DIRECTION_array[$ln]  = "ltr";
 127    $NAME_REVERSE_array[$ln]  = false;
 128    $ALPHABET_upper[$ln]    = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 129    $ALPHABET_lower[$ln]    = "abcdefghijklmnopqrstuvwxyz";
 130    $MULTI_LETTER_ALPHABET[$ln] = "";
 131    $DICTIONARY_SORT[$ln]   = true;
 132  
 133    $pgv_lang[$d_LangName]  = $lng_codes[$new_shortcut][0];
 134  }
 135  else if(!isset($v_flagsfile) && isset($flagsfile[$ln])) $v_flagsfile=$flagsfile[$ln];
 136  else if(!isset($v_flagsfile)) $v_flagsfile = "";
 137  
 138  if ($action != "save" and $action != "toggleActive") {
 139    print "<script language=\"JavaScript\" type=\"text/javascript\">\n";
 140    print "var helpWin;\n";
 141    print "function helpPopup(which) {\n";
 142    print "if ((!helpWin)||(helpWin.closed)) helpWin = window.open('editconfig_help.php?help='+which,'_blank','left=50,top=50,width=500,height=320,resizable=1,scrollbars=1');\n";
 143    print "else helpWin.location = 'editconfig_help.php?help='+which;\n";
 144    print "return false;\n";
 145    print "}\n";
 146    print "function CheckFileSelect() {\n";
 147    print "if (document.Form1.v_u_lang_filename.value != \"\"){\n";
 148    print "document.Form1.v_lang_filename.value = document.Form1.v_u_lang_filename.value;\n";
 149    print "}\n";
 150    print "}\n";
 151    print "// -->\n";
 152    print "</script>\n";
 153  
 154    print "<table class=\"facts_table\">";
 155    print "<tr>";
 156    if ($action == "new_lang") {
 157      print "<td class=\"facts_label\">" . $pgv_lang["add_new_language"] . "</td>";
 158    }
 159    else {
 160      print "<td class=\"facts_label\">" . $pgv_lang["config_lang_utility"] . "</td>";
 161    }
 162    print "</tr>";
 163    print "<tr>";
 164    print "<td class=\"facts_value\" style=\"text-align:center; \"><b>" . $pgv_lang[$d_LangName];
 165    print "</b></td></tr>";
 166    print "</table>\n";
 167  
 168    print "<form name=\"Form1\" method=\"post\" action=\"editlang_edit_settings.php\">";
 169    print "<input type=\"hidden\" name=\"".session_name()."\" value=\"".session_id()."\" />";
 170    print "<input type=\"hidden\" name=\"action\" value=\"save\" />";
 171    print "<input type=\"hidden\" name=\"ln\" value=\"" . $ln . "\" />";
 172    if ($action == "new_lang") {
 173      print "<input type=\"hidden\" name=\"new_old\" value=\"new\" />";
 174    }
 175    else print "<input type=\"hidden\" name=\"new_old\" value=\"old\" />";
 176  
 177    print "<br /><center>";
 178    print "<input type=\"submit\" value=\"" . $pgv_lang["lang_save"] . "\" />";
 179    print "&nbsp;&nbsp;";
 180    print "<input type=\"submit\" value=\"" . $pgv_lang["cancel"] . "\" onclick=\"document.Form1.action.value='cancel'\" />";
 181    print "</center><br />";
 182  
 183    print "<table class=\"facts_table\">";
 184  
 185    if ($action != "new_lang") {
 186      if ($protectActive) $v_lang_use = true;
 187      if (!isset($v_lang_use)) $v_lang_use = $pgv_lang_use[$ln];
 188      print "<tr>";
 189      print "<td class=\"facts_label\" >";
 190      print $pgv_lang["active"];
 191      print " <a href=\"javascript:;\" onclick=\"return helpPopup('active_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 192      print "</td>";
 193      write_td_with_textdir_check();
 194  
 195      if ($v_lang_use) {
 196        print "<input";
 197        if ($protectActive) print " disabled";
 198        print " type=\"checkbox\" name=\"v_lang_use\" value=\"true\" checked=\"checked\" />";
 199      }
 200      else print "<input type=\"checkbox\" name=\"v_lang_use\" value=\"true\" />";
 201      print "</td>";
 202      print "</tr>";
 203    }
 204    else print "<input type=\"hidden\" name=\"v_lang_use\" value=\"".$pgv_lang_use[$ln]."\" />";
 205  
 206    print "<tr>";
 207    if (!isset($v_original_lang_name)) $v_original_lang_name = $pgv_lang[$ln];
 208    print "<td class=\"facts_label\" >";
 209    print str_replace("#D_LANGNAME#", $pgv_lang[$d_LangName], $pgv_lang["original_lang_name"]);
 210    print " <a href=\"javascript:;\" onclick=\"return helpPopup('original_lang_name_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 211    print "</td>";
 212    write_td_with_textdir_check();
 213    print "<input type=\"text\" name=\"v_original_lang_name\" size=\"30\" value=\"" . $v_original_lang_name . "\" />";
 214    print "</td>";
 215    print "</tr>";
 216  
 217    print "<tr>";
 218    if (!isset($v_lang_shortcut)) $v_lang_shortcut = $lang_short_cut[$ln];
 219    print "<td class=\"facts_label\" >";
 220    print $pgv_lang["lang_shortcut"];
 221    print " <a href=\"javascript:;\" onclick=\"return helpPopup('lang_shortcut_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 222    print "</td>";
 223    write_td_with_textdir_check();
 224    print "<input type=\"text\" name=\"v_lang_shortcut\" size=\"2\" value=\"" . $v_lang_shortcut . "\" onchange=\"document.Form1.action.value=''; submit();\" />";
 225    print "</td>";
 226    print "</tr>";
 227  
 228    print "<tr>";
 229    if (!isset($v_lang_langcode)) $v_lang_langcode = $lang_langcode[$ln];
 230    print "<td class=\"facts_label\" >";
 231    print $pgv_lang["lang_langcode"];
 232    print " <a href=\"javascript:;\" onclick=\"return helpPopup('lang_langcode_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 233    print "</td>";
 234    write_td_with_textdir_check();
 235    print "<input type=\"text\" name=\"v_lang_langcode\" size=\"70\" value=\"" . $v_lang_langcode . "\" />";
 236    print "</td>";
 237    print "</tr>";
 238  
 239    print "<tr>";
 240    if (!isset($v_flagsfile)) $v_flagsfile = $flagsfile[$ln];
 241    print "<td class=\"facts_label\" >";
 242    print $pgv_lang["flagsfile"];
 243    print " <a href=\"javascript:;\" onclick=\"return helpPopup('flagsfile_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 244    print "</td>";
 245    write_td_with_textdir_check();
 246    $dire = "images/flags";
 247    if ($handle = opendir($dire)) {
 248      $flagfiles = array();
 249      $sortedflags = array();
 250      $cf=0;
 251      print $dire."/";
 252      while (false !== ($file = readdir($handle))) {
 253        $pos1 = strpos($file, "gif");
 254        if ($file != "." && $file != ".." && $pos1) {
 255          $filelang = substr($file, 0, $pos1-1);
 256          $fileflag = $dire."/".$filelang.".gif";
 257          $flagfiles["file"][$cf]=$file;
 258          $flagfiles["path"][$cf]=$fileflag;
 259          $sortedflags[$file]=$cf;
 260          $cf++;
 261        }
 262      }
 263      closedir($handle);
 264      $sortedflags = array_flip($sortedflags);
 265      asort($sortedflags);
 266      $sortedflags = array_flip($sortedflags);
 267      reset($sortedflags);
 268      if ($action != "new_lang") {
 269        print "&nbsp;&nbsp;&nbsp;<select name=\"v_flagsfile\" onchange=\"document.Form1.action.value=''; submit();\">\n";
 270        foreach ($sortedflags as $key=>$value) {
 271          $i = $sortedflags[$key];
 272          print "<option value=\"".$flagfiles["path"][$i]."\" ";
 273          if ($v_flagsfile == $flagfiles["path"][$i]){
 274            print "selected ";
 275            $flag_i = $i;
 276          }
 277        print "/>".$flagfiles["file"][$i]."</option>\n";
 278        }
 279        print "</select>\n";
 280      } else {
 281        foreach ($sortedflags as $key=>$value) {
 282          $i = $sortedflags[$key];
 283          if ($v_flagsfile == $flagfiles["path"][$i]){
 284            $flag_i = $i;
 285            break;
 286          }
 287        }
 288        print $flagfiles["file"][$i];
 289      }
 290    }
 291    if (isset($flag_i) && isset($flagfiles["path"][$flag_i])){
 292      print "<div id=\"flag\" style=\"display: inline; padding-left: 7px;\">";
 293      print " <img src=\"".$flagfiles["path"][$flag_i]."\" alt=\"\" class=\"brightflag\" style=\"border: solid black 1px\" /></div>\n";
 294    }
 295    print "</td>";
 296    print "</tr>";
 297  
 298    print "<tr>";
 299    if (!isset($v_date_format)) $v_date_format = $DATE_FORMAT_array[$ln];
 300    print "<td class=\"facts_label\" >";
 301    print $pgv_lang["date_format"];
 302    print " <a href=\"javascript:;\" onclick=\"return helpPopup('date_format_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 303    print "</td>";
 304    write_td_with_textdir_check();
 305    print "<input type=\"text\" name=\"v_date_format\" size=\"30\" value=\"" . $v_date_format . "\" />";
 306    print "</td>";
 307    print "</tr>";
 308  
 309    print "<tr>";
 310    if (!isset($v_time_format)) $v_time_format = $TIME_FORMAT_array[$ln];
 311    print "<td class=\"facts_label\" >";
 312    print $pgv_lang["time_format"];
 313    print " <a href=\"javascript:;\" onclick=\"return helpPopup('time_format_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 314    print "</td>";
 315    write_td_with_textdir_check();
 316    print "<input type=\"text\" name=\"v_time_format\" size=\"30\" value=\"" . $v_time_format . "\" />";
 317    print "</td>";
 318    print "</tr>";
 319  
 320    print "<tr>";
 321    if (!isset($v_week_start)) $v_week_start = $WEEK_START_array[$ln];
 322    print "<td class=\"facts_label\" >";
 323    print $pgv_lang["week_start"];
 324    print " <a href=\"javascript:;\" onclick=\"return helpPopup('week_start_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 325    print "</td>";
 326    write_td_with_textdir_check();
 327  
 328    print "<select size=\"1\" name=\"v_week_start\">";
 329    $dayArray = array($pgv_lang["sunday"],$pgv_lang["monday"],$pgv_lang["tuesday"],$pgv_lang["wednesday"],$pgv_lang["thursday"],$pgv_lang["friday"],$pgv_lang["saturday"]);
 330  
 331    for ($x = 0; $x <= 6; $x++)  {
 332      print "<option";
 333      if ($v_week_start == $x) print " selected=\"selected\"";
 334      print " value=\"";
 335      print $x;
 336      print "\">";
 337      print $dayArray[$x];
 338      print "</option>";
 339    }
 340    print "</select>";
 341  
 342    print "</td>";
 343    print "</tr>";
 344  
 345    print "<tr>";
 346    if (!isset($v_text_direction)) $v_text_direction = $TEXT_DIRECTION_array[$ln];
 347    print "<td class=\"facts_label\" >";
 348    print $pgv_lang["text_direction"];
 349    print " <a href=\"javascript:;\" onclick=\"return helpPopup('text_direction_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 350    print "</td>";
 351    write_td_with_textdir_check();
 352    print "<select size=\"1\" name=\"v_text_direction\">";
 353    print "<option";
 354    if ($v_text_direction == "ltr") print " selected=\"selected\"";
 355    print " value=\"";
 356    print "0";
 357    print "\">";
 358    print $pgv_lang["ltr"];
 359    print "</option>";
 360    print "<option";
 361    if ($v_text_direction == "rtl") print " selected=\"selected\"";
 362    print " value=\"";
 363    print "1";
 364    print "\">";
 365    print $pgv_lang["rtl"];
 366    print "</option>";
 367    print "</select>";
 368    print "</td>";
 369    print "</tr>";
 370  
 371    print "<tr>";
 372    if (!isset($v_name_reverse)) $v_name_reverse = $NAME_REVERSE_array[$ln];
 373    print "<td class=\"facts_label\" >";
 374    print $pgv_lang["name_reverse"];
 375    print " <a href=\"javascript:;\" onclick=\"return helpPopup('name_reverse_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 376    print "</td>";
 377    write_td_with_textdir_check();
 378    print "<select size=\"1\" name=\"v_name_reverse\">";
 379    print "<option";
 380    if (!$v_name_reverse) print " selected=\"selected\"";
 381    print " value=\"";
 382    print "0";
 383    print "\">";
 384    print $pgv_lang["no"];
 385    print "</option>";
 386    print "<option";
 387    if ($v_name_reverse) print " selected=\"selected\"";
 388    print " value=\"";
 389    print "1";
 390    print "\">";
 391    print $pgv_lang["yes"];
 392    print "</option>";
 393    print "</select>";
 394    print "</td>";
 395    print "</tr>";
 396  
 397    print "<tr>";
 398    if (!isset($v_alphabet_upper)) $v_alphabet_upper = $ALPHABET_upper[$ln];
 399    print "<td class=\"facts_label\" >";
 400    print $pgv_lang["alphabet_upper"];
 401    print " <a href=\"javascript:;\" onclick=\"return helpPopup('alphabet_upper_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 402    print "</td>";
 403    write_td_with_textdir_check();
 404    print "<input type=\"text\" name=\"v_alphabet_upper\" size=\"50\" value=\"" . $v_alphabet_upper . "\" />";
 405    print "</td>";
 406    print "</tr>";
 407  
 408    print "<tr>";
 409    if (!isset($v_alphabet_lower)) $v_alphabet_lower = $ALPHABET_lower[$ln];
 410    print "<td class=\"facts_label\" >";
 411    print $pgv_lang["alphabet_lower"];
 412    print " <a href=\"javascript:;\" onclick=\"return helpPopup('alphabet_lower_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 413    print "</td>";
 414    write_td_with_textdir_check();
 415    print "<input type=\"text\" name=\"v_alphabet_lower\" size=\"50\" value=\"" . $v_alphabet_lower . "\" />";
 416    print "</td>";
 417    print "</tr>";
 418  
 419    print "<tr>";
 420    if (!isset($v_multi_letter_alphabet)) $v_multi_letter_alphabet = $MULTI_LETTER_ALPHABET[$ln];
 421    print "<td class=\"facts_label\" >";
 422    print $pgv_lang["multi_letter_alphabet"];
 423    print " <a href=\"javascript:;\" onclick=\"return helpPopup('multi_letter_alphabet_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 424    print "</td>";
 425    write_td_with_textdir_check();
 426    print "<input type=\"text\" name=\"v_multi_letter_alphabet\" size=\"50\" value=\"" . $v_multi_letter_alphabet . "\" />";
 427    print "</td>";
 428    print "</tr>";
 429  
 430    print "<tr>";
 431    if (!isset($v_dictionary_sort)) $v_dictionary_sort = $DICTIONARY_SORT[$ln];
 432    print "<td class=\"facts_label\" >";
 433    print $pgv_lang["dictionary_sort"];
 434    print " <a href=\"javascript:;\" onclick=\"return helpPopup('dictionary_sort_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 435    print "</td>";
 436    write_td_with_textdir_check();
 437    print "<select size=\"1\" name=\"v_dictionary_sort\">";
 438    print "<option";
 439    if (!$v_dictionary_sort) print " selected=\"selected\"";
 440    print " value=\"";
 441    print "0";
 442    print "\">";
 443    print $pgv_lang["no"];
 444    print "</option>";
 445    print "<option";
 446    if ($v_dictionary_sort) print " selected=\"selected\"";
 447    print " value=\"";
 448    print "1";
 449    print "\">";
 450    print $pgv_lang["yes"];
 451    print "</option>";
 452    print "</select>";
 453    print "</td>";
 454    print "</tr>";
 455  
 456    if (!isset($v_lang_filename)) $v_lang_filename = "languages/lang.".$v_lang_shortcut.".php";
 457    if (!isset($v_config_filename)) $v_config_filename = "languages/configure_help.".$v_lang_shortcut.".php";
 458    if (!isset($v_factsfile)) $v_factsfile = "languages/facts.".$v_lang_shortcut.".php";
 459    if (!isset($v_helpfile)) $v_helpfile = "languages/help_text.".$v_lang_shortcut.".php";
 460  
 461    if ($action != "new_lang"){
 462      print "<tr>";
 463      print "<td class=\"facts_label\" >";
 464      print $pgv_lang["lang_filenames"];
 465      print " <a href=\"javascript:;\" onclick=\"return helpPopup('lang_filenames_help'); \"><b style=\"color: red; cursor: help; \">?</b></a>";
 466      print "</td>";
 467      write_td_with_textdir_check();
 468  
 469      print $v_config_filename;
 470      if (!file_exists($v_config_filename)) print "&nbsp;&nbsp;<b class=\"error\">" . $pgv_lang["file_does_not_exist"] . "</b>";
 471      print "<br />";
 472  
 473      print $v_factsfile;
 474      if (!file_exists($v_factsfile)) print "&nbsp;&nbsp;<b class=\"error\">" . $pgv_lang["file_does_not_exist"] . "</b>";
 475      print "<br />";
 476  
 477      print $v_helpfile;
 478      if (!file_exists($v_helpfile)) print "&nbsp;&nbsp;<b class=\"error\">" . $pgv_lang["file_does_not_exist"] . "</b>";
 479      print "<br />";
 480  
 481      print $v_lang_filename;
 482      if (!file_exists($v_lang_filename)) print "&nbsp;&nbsp;<b class=\"error\">" . $pgv_lang["file_does_not_exist"] . "</b>";
 483  
 484      print "</td>";
 485      print "</tr>";
 486    }
 487  
 488    print "</table>";
 489  
 490    print "<br />";
 491    print "<center>";
 492    print "<input type=\"submit\" value=\"" . $pgv_lang["lang_save"] . "\" />";
 493    print "&nbsp;&nbsp;";
 494    print "<input type=\"submit\" value=\"" . $pgv_lang["cancel"] . "\" onclick=\"document.Form1.action.value='cancel'\" />";
 495    print "</center>";
 496    print "</form>";
 497  }
 498  
 499  if ($action == "toggleActive") {
 500    if ($language_settings[$ln]["pgv_lang_use"] == true) $pgv_lang_use[$ln] = false;
 501    else $pgv_lang_use[$ln] = true;
 502  }
 503  
 504  if ($action == "save") {
 505    if (!isset($_POST)) $_POST = $HTTP_POST_VARS;
 506    if ($protectActive) $_POST["v_lang_use"] = true;
 507    if (!isset($_POST["v_lang_use"])) $_POST["v_lang_use"] = false;
 508    if ($_POST["new_old"] == "new") {
 509      $lang = array();
 510      $d_LangName      = "lang_name_".$ln;
 511      $pgv_lang[$d_LangName]  = $v_original_lang_name;
 512      $pgv_lang[$ln]    = $ln;
 513      $pgv_language[$ln]    = "languages/lang.".$v_lang_shortcut.".php";
 514      $confighelpfile[$ln]  = "languages/configure_help.".$v_lang_shortcut.".php";
 515      $helptextfile[$ln]    = "languages/help_text.".$v_lang_shortcut.".php";
 516      $factsfile[$ln]    = "languages/facts.".$v_lang_shortcut.".php";
 517      $language_settings[$ln]  = $lang;
 518      $languages[$ln]    = $ln;
 519    }
 520  
 521    $flagsfile[$ln]    = $v_flagsfile;
 522    $pgv_lang[$ln]  = $_POST["v_original_lang_name"];
 523    $pgv_lang_use[$ln]  = $_POST["v_lang_use"];
 524    $lang_short_cut[$ln]  = $_POST["v_lang_shortcut"];
 525    $lang_langcode[$ln]  = $_POST["v_lang_langcode"];
 526  
 527    if (substr($lang_langcode[$ln],strlen($lang_langcode[$ln])-1,1) != ";") $lang_langcode[$ln] .= ";";
 528  
 529    $ALPHABET_upper[$ln]  = $_POST["v_alphabet_u