Пример #1
0
function icl_translation_send_untranslated_strings($target_languages)
{
    global $wpdb;
    $untranslated = $wpdb->get_col($wpdb->prepare("SELECT id FROM {$wpdb->prefix}icl_strings WHERE status <> %d", ICL_STRING_TRANSLATION_COMPLETE));
    icl_translation_send_strings($untranslated, $target_languages);
}
     $icl_st_complete = isset($_POST['icl_st_translation_complete']) ? $_POST['icl_st_translation_complete'] : ICL_STRING_TRANSLATION_NOT_TRANSLATED;
     if (get_magic_quotes_gpc()) {
         $_POST = stripslashes_deep($_POST);
     }
     echo icl_add_string_translation($_POST['icl_st_string_id'], $_POST['icl_st_language'], stripslashes($_POST['icl_st_translation']), $icl_st_complete);
     echo '|';
     global $icl_st_string_translation_statuses;
     echo $icl_st_string_translation_statuses[icl_update_string_status($_POST['icl_st_string_id'])];
     break;
 case 'icl_st_delete_strings':
     $arr = explode(',', $_POST['value']);
     __icl_unregister_string_multi($arr);
     break;
 case 'icl_st_send_strings':
     $arr = explode(',', $_POST['strings']);
     icl_translation_send_strings($arr, explode('#', $_POST['languages']));
     echo '1';
     break;
 case 'icl_st_send_strings_all':
     icl_translation_send_untranslated_strings(explode(',', $_POST['languages']));
     echo '1';
     break;
 case 'icl_save_theme_localization_type':
     $icl_tl_type = (int) $_POST['icl_theme_localization_type'];
     $iclsettings['theme_localization_type'] = $icl_tl_type;
     if ($icl_tl_type == 1) {
         icl_st_scan_theme_files();
     }
     $this->save_settings($iclsettings);
     echo '1|' . $icl_tl_type;
     break;