gobrien | 35e2378 | 2007-11-28 21:37:18 +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 | |
gobrien | 4827546 | 2007-11-29 21:29:17 +0000 | [diff] [blame] | 14 | require_once("cb_global.php"); |
gobrien | 35e2378 | 2007-11-28 21:37:18 +0000 | [diff] [blame] | 15 | |
gobrien | c0a6c65 | 2007-11-28 22:00:47 +0000 | [diff] [blame] | 16 | $query = "select * from languages where is_active = 1 and language_id != 1"; |
gobrien | 35e2378 | 2007-11-28 21:37:18 +0000 | [diff] [blame] | 17 | |
| 18 | $res = mysql_query($query,$dbh); |
| 19 | |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame] | 20 | |
| 21 | $return = Array(); |
| 22 | |
gobrien | 35e2378 | 2007-11-28 21:37:18 +0000 | [diff] [blame] | 23 | while($line = mysql_fetch_array($res, MYSQL_ASSOC)){ |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame] | 24 | // $return .= "<li><a href='?language_id=".$line['language_id']."'>".$line['iso_code']. " - ". $line['name']. "</a>"; |
gobrien | e4a39c8 | 2008-01-11 00:06:14 +0000 | [diff] [blame^] | 25 | if($line['language_id'] == $_SESSION['language']){ |
| 26 | $line['current'] = true; |
| 27 | } |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame] | 28 | $return[] = $line; |
gobrien | 35e2378 | 2007-11-28 21:37:18 +0000 | [diff] [blame] | 29 | } |
| 30 | |
gobrien | f7bc46b | 2007-12-20 23:13:03 +0000 | [diff] [blame] | 31 | //print_r($return); |
gobrien | ad11d89 | 2007-12-19 08:33:25 +0000 | [diff] [blame] | 32 | |
| 33 | print json_encode($return); |
| 34 | exit(); |
| 35 | |
gobrien | 0a15214 | 2007-12-19 08:38:52 +0000 | [diff] [blame] | 36 | ?> |