function wpml_st_parse_config($file)
{
    require_once WPML_ST_PATH . '/inc/admin-texts/wpml-admin-text-import.class.php';
    $config = new WPML_Admin_Text_Configuration($file);
    $import = new WPML_Admin_Text_Import();
    $import->parse_config($config->get_config_array());
}
function wpml_st_parse_config($file)
{
    global $wpdb;
    require_once WPML_ST_PATH . '/inc/admin-texts/wpml-admin-text-import.class.php';
    $config = new WPML_Admin_Text_Configuration($file);
    $st_records = new WPML_ST_Records($wpdb);
    $import = new WPML_Admin_Text_Import($st_records);
    $import->parse_config($config->get_config_array());
}
 function ajax_calls($call, $data)
 {
     require_once WPML_ST_PATH . '/inc/admin-texts/wpml-admin-text-configuration.php';
     switch ($call) {
         case 'icl_st_save_translation':
             $icl_st_complete = isset($data['icl_st_translation_complete']) && $data['icl_st_translation_complete'] ? ICL_TM_COMPLETE : ICL_TM_NOT_TRANSLATED;
             if (get_magic_quotes_gpc()) {
                 $data = stripslashes_deep($data);
             }
             if (icl_st_is_translator()) {
                 $translator_id = get_current_user_id() > 0 ? get_current_user_id() : null;
             } else {
                 $translator_id = null;
             }
             echo icl_add_string_translation($data['icl_st_string_id'], $data['icl_st_language'], stripslashes($data['icl_st_translation']), $icl_st_complete, $translator_id);
             echo '|';
             $ts = icl_update_string_status($data['icl_st_string_id']);
             if (icl_st_is_translator()) {
                 $ts = icl_get_relative_translation_status($data['icl_st_string_id']);
             }
             echo WPML_ST_String_Statuses::get_status($ts);
             break;
         case 'icl_st_delete_strings':
             $arr = explode(',', $data['value']);
             __icl_unregister_string_multi($arr);
             break;
         case 'icl_st_option_writes_form':
             if (!empty($data['icl_admin_options'])) {
                 $wpml_admin_text = wpml_st_load_admin_texts();
                 $wpml_admin_text->icl_register_admin_options($data['icl_admin_options']);
                 echo '1|';
             } else {
                 echo '0' . __('No strings selected', 'wpml-string-translation');
             }
             break;
         case 'icl_st_ow_export':
             // filter empty options out
             do {
                 list($data['icl_admin_options'], $empty_found) = _icl_st_filter_empty_options_out($data['icl_admin_options']);
             } while ($empty_found);
             if (!empty($data['icl_admin_options'])) {
                 foreach ($data['icl_admin_options'] as $k => $opt) {
                     if (!$opt) {
                         unset($data['icl_admin_options'][$k]);
                     }
                 }
                 $wpml_admin_text_config = new WPML_Admin_Text_Configuration();
                 $message = __('Save the following to a wpml-config.xml in the root of your theme or plugin.', 'wpml-string-translation') . "<textarea wrap=\"soft\" spellcheck=\"false\">" . htmlentities($wpml_admin_text_config->get_wpml_config_file($data['icl_admin_options'])) . "</textarea>";
             } else {
                 $message = __('Error: no strings selected', 'wpml-string-translation');
             }
             echo json_encode(array('error' => 0, 'message' => $message));
             break;
     }
 }