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 | |
| 19 | $query = "select |
| 20 | strings.string_id, |
| 21 | strings.value as string_value, |
| 22 | translations.value as translation_value, |
| 23 | max(translations.version) |
| 24 | from |
| 25 | strings |
| 26 | left join translations on |
| 27 | (strings.string_id = translations.string_id and translations.is_active != 0) |
| 28 | where |
| 29 | strings.is_active != 0 |
| 30 | and |
| 31 | strings.string_id = '".addslashes($string_id)."' |
| 32 | group by translations.version |
| 33 | order by translations.version desc |
| 34 | limit 1 |
| 35 | "; |
| 36 | |
| 37 | $res = mysql_query($query,$dbh); |
| 38 | |
| 39 | $line = mysql_fetch_array($res, MYSQL_ASSOC); |
| 40 | |
| 41 | ?> |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 42 | <form id='translation-form'> |
| 43 | <input type="hidden" name="string_id" value="<?=$line['string_id'];?>"> |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame^] | 44 | |
| 45 | <div id="english-area" class="side-component"> |
| 46 | <h4>English String</h4> |
| 47 | <div id="english-current-area"> |
| 48 | <?= nl2br($line['string_value']);?> |
| 49 | </div> |
| 50 | </div> |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 51 | |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame^] | 52 | <div id="translation-textarea" class="side-component"> |
| 53 | <h4>Your New Translation</h4> |
| 54 | <textarea style='display: inline; width: 400px; height: 150px;' name="translation"></textarea> |
| 55 | <br> |
| 56 | <input type="submit" value="translate"> |
| 57 | </div> |
| 58 | <div id="translation-history" class="side-component"> |
| 59 | <h4>History of Translations</h4> |
| 60 | <div id="translation-history">Coming soon!</div> |
| 61 | </div> |
| 62 | |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 63 | </form> |