示例#1
0
 function saveLanguage()
 {
     global $toC_Json, $osC_Language;
     $languages_id = isset($_REQUEST['languages_id']) && is_numeric($_REQUEST['languages_id']) ? $_REQUEST['languages_id'] : null;
     $data = array('name' => $_REQUEST['name'], 'code' => $_REQUEST['code'], 'locale' => $_REQUEST['locale'], 'charset' => $_REQUEST['charset'], 'date_format_short' => $_REQUEST['date_format_short'], 'date_format_long' => $_REQUEST['date_format_long'], 'time_format' => $_REQUEST['time_format'], 'text_direction' => $_REQUEST['text_id'], 'currencies_id' => $_REQUEST['currencies_id'], 'numeric_separator_decimal' => $_REQUEST['numeric_separator_decimal'], 'numeric_separator_thousands' => $_REQUEST['numeric_separator_thousands'], 'parent_id' => $_REQUEST['parent_id'], 'sort_order' => $_REQUEST['sort_order']);
     if (osC_Language_Admin::update($languages_id, $data, isset($_REQUEST['default']) && $_REQUEST['default'] == 'on')) {
         $response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed'));
     } else {
         $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed'));
     }
     echo $toC_Json->encode($response);
 }