gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 1 | <?php |
| 2 | /******************************************************************************* |
| 3 | * Copyright (c) 2007 Eclipse Foundation and others. |
| 4 | * All rights reserved. This program and the accompanying materials |
| 5 | * are made available under the terms of the Eclipse Public License v1.0 |
| 6 | * which accompanies this distribution, and is available at |
| 7 | * http://www.eclipse.org/legal/epl-v10.html |
| 8 | * |
| 9 | * Contributors: |
| 10 | * Paul Colton (Aptana)- initial API and implementation |
| 11 | * Eclipse Foundation |
| 12 | *******************************************************************************/ |
| 13 | |
| 14 | require_once("cb_global.php"); |
| 15 | |
| 16 | |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame] | 17 | $string_id = $App->getHTTPParameter("string_id", "POST"); |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 18 | |
gobrien | 36356fb | 2008-01-11 16:45:26 +0000 | [diff] [blame] | 19 | $language = $_SESSION['language']; |
| 20 | |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 21 | $query = "select |
| 22 | strings.string_id, |
| 23 | strings.value as string_value, |
| 24 | translations.value as translation_value, |
| 25 | max(translations.version) |
| 26 | from |
| 27 | strings |
| 28 | left join translations on |
gobrien | 36356fb | 2008-01-11 16:45:26 +0000 | [diff] [blame] | 29 | (strings.string_id = translations.string_id |
| 30 | and |
| 31 | translations.is_active != 0 |
| 32 | and |
| 33 | translations.language_id = '".addslashes($language)."') |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 34 | where |
| 35 | strings.is_active != 0 |
| 36 | and |
| 37 | strings.string_id = '".addslashes($string_id)."' |
| 38 | group by translations.version |
| 39 | order by translations.version desc |
| 40 | limit 1 |
| 41 | "; |
| 42 | |
gobrien | fc32692 | 2008-01-11 16:46:44 +0000 | [diff] [blame^] | 43 | //print $query; |
gobrien | 36356fb | 2008-01-11 16:45:26 +0000 | [diff] [blame] | 44 | |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 45 | $res = mysql_query($query,$dbh); |
| 46 | |
| 47 | $line = mysql_fetch_array($res, MYSQL_ASSOC); |
| 48 | |
| 49 | ?> |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 50 | <form id='translation-form'> |
| 51 | <input type="hidden" name="string_id" value="<?=$line['string_id'];?>"> |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame] | 52 | |
| 53 | <div id="english-area" class="side-component"> |
| 54 | <h4>English String</h4> |
| 55 | <div id="english-current-area"> |
| 56 | <?= nl2br($line['string_value']);?> |
| 57 | </div> |
| 58 | </div> |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 59 | |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame] | 60 | <div id="translation-textarea" class="side-component"> |
gobrien | e4a39c8 | 2008-01-11 00:06:14 +0000 | [diff] [blame] | 61 | <h4>Current Translation</h4> |
| 62 | <textarea style='display: inline; width: 390px; height: 150px;' name="translation"><?= nl2br($line['translation_value']);?></textarea> |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame] | 63 | <br> |
| 64 | <input type="submit" value="translate"> |
| 65 | </div> |
| 66 | <div id="translation-history" class="side-component"> |
| 67 | <h4>History of Translations</h4> |
| 68 | <div id="translation-history">Coming soon!</div> |
| 69 | </div> |
| 70 | |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 71 | </form> |