2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2010 */
\r
6 /* Inclusive Design Institute */
\r
8 /* This program is free software. You can redistribute it and/or */
\r
9 /* modify it under the terms of the GNU General Public License */
\r
10 /* as published by the Free Software Foundation. */
\r
11 /************************************************************************/
\r
13 define('TR_INCLUDE_PATH', '../include/');
\r
14 include(TR_INCLUDE_PATH.'vitals.inc.php');
\r
15 include_once(TR_INCLUDE_PATH.'classes/DAO/LanguagesDAO.class.php');
\r
17 if ($_POST['value'] == '')
\r
19 $rtn['status'] = 'fail';
\r
20 $rtn['error'][] = _AT('TR_ERROR_EMPTY_FIELD');
\r
23 if (isset($_POST['field']) && isset($_POST['value']) && $_POST['value'] <> '')
\r
25 $languagesDAO = new LanguagesDAO();
\r
27 // Format of $_POST['field']: [fieldName]|[language_code]|[charset]
\r
28 $pieces = explode(':', $_POST['field']);
\r
29 $languagesDAO->UpdateField($pieces[1], $pieces[0], $_POST['value']);
\r
30 $rtn['status'] = 'success';
\r
31 $rtn['success'][] = _AT('TR_FEEDBACK_ACTION_COMPLETED_SUCCESSFULLY');
\r
34 echo json_encode($rtn);
\r