SVN tag for release should only contain scripts in "docs" folder without "mods",...
[atutor.git] / docs / mods / _core / languages / language_translate.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2010                                      */
6 /* Inclusive Design Institute                                   */
7 /* http://atutor.ca                                                                                             */
8 /*                                                              */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License  */
11 /* as published by the Free Software Foundation.                                */
12 /****************************************************************/
13 // $Id$
14
15 define('AT_INCLUDE_PATH', '../../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 admin_authenticate(AT_ADMIN_PRIV_LANGUAGES);
18
19 if (isset($_POST['svn_submit'])) {
20         $languageManager->liveImport($addslashes($_POST['import_lang']));
21         header('Location: '.$_SERVER['PHP_SELF']);
22         exit;
23 }
24
25 require(AT_INCLUDE_PATH.'header.inc.php');
26
27
28 $button_state = '';
29 if (!defined('AT_DEVEL_TRANSLATE') || !AT_DEVEL_TRANSLATE) {
30         $button_state = 'disabled="disabled"';
31 }
32
33 ?>
34
35 <form method="get">
36 <div class="input-form">
37         <div class="row">
38                 <h3><?php echo _AT('translate'); ?></h3>
39         </div>
40
41         <div class="row">
42                 <p><?php echo _AT('translate_lang_howto'); ?></p>
43         </div>
44
45         <div class="row buttons">
46                 <input type="button" onclick="javascript:window.open('<?php echo AT_BASE_HREF; ?>mods/_core/languages/translate_atutor.php', 'newWin1', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=1, copyhistory=0, width=640, height=480')" value="<?php echo _AT('translate'); ?>" <?php echo $button_state; ?> />
47         </div>
48 </div>
49 </form>
50
51 <?php if (defined('AT_DEVEL_TRANSLATE') && AT_DEVEL_TRANSLATE): ?>
52         <form name="form1" method="post" action="mods/_core/languages/language_translate.php">
53                 <div class="input-form">
54                         <div class="row">
55                                 Import partial language from the <strong>live ATutor language database</strong> to your local installation for translating.
56                         </div>
57                         <div class="row">
58                                 <?php
59                                         require_once(AT_INCLUDE_PATH.'../mods/_core/languages/classes/RemoteLanguageManager.class.php');
60                                         $remoteLanguageManager = new RemoteLanguageManager();
61                                         $remoteLanguageManager->printDropdown($_SESSION['lang'], 'import_lang', 'import_lang');
62                                 ?>
63                         </div>
64
65                         <div class="row buttons">
66                                 <input type="submit" name="svn_submit" value="<?php echo _AT('import'); ?>" />
67                         </div>
68                 </div>
69         </form>
70 <?php endif; ?>
71
72 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>