get_current_language(); } if(!isset($icl_translation_filter['to_lang'])){ $icl_translation_filter['to_lang'] = isset($_GET['to_lang'])?$_GET['to_lang']:''; } if($icl_translation_filter['to_lang'] == $icl_translation_filter['from_lang']){ $icl_translation_filter['to_lang'] = false; } if(!isset($icl_translation_filter['tstatus'])){ $icl_translation_filter['tstatus'] = isset($_GET['tstatus'])?$_GET['tstatus']:'not'; } if(!isset($icl_translation_filter['sort_by']) || !$icl_translation_filter['sort_by']){ $icl_translation_filter['sort_by'] = 'p.post_date';} if(!isset($icl_translation_filter['sort_order']) || !$icl_translation_filter['sort_order']){ $icl_translation_filter['sort_order'] = 'DESC';} $sort_order_next = $icl_translation_filter['sort_order'] == 'ASC' ? 'DESC' : 'ASC'; $title_sort_link = 'admin.php?page='.WPML_TM_FOLDER.'/menu/main.php&sm=dashboard&icl_tm_action=sort&sort_by=p.post_title&sort_order='.$sort_order_next; $date_sort_link = 'admin.php?page='.WPML_TM_FOLDER.'/menu/main.php&sm=dashboard&icl_tm_action=sort&sort_by=p.post_date&sort_order='.$sort_order_next; $icl_post_statuses = array( 'publish' =>__('Published', 'wpml-translation-management'), 'draft' =>__('Draft', 'wpml-translation-management'), 'pending' =>__('Pending Review', 'wpml-translation-management'), 'future' =>__('Scheduled', 'wpml-translation-management'), 'private' =>__('Private', 'wpml-translation-management') ); // Get the document types that we can translate $icl_post_types = $sitepress->get_translatable_documents(); $icl_post_types = apply_filters('WPML_get_translatable_types', $icl_post_types); foreach ($icl_post_types as $id => $type_info) { if (is_string($type_info)) { // this is an external type returned by WPML_get_translatable_types $new_type = new stdClass(); $new_type->labels->singular_name = $type_info; $new_type->labels->name = $type_info; $new_type->external_type = 1; $icl_post_types[$id] = $new_type; } } $icl_dashboard_settings = isset($sitepress_settings['dashboard']) ? $sitepress_settings['dashboard'] : array(); $icl_translation_filter['limit_no'] = isset($_GET['show_all']) && $_GET['show_all'] ? 10000 : ICL_TM_DOCS_PER_PAGE; if(!isset($icl_translation_filter['parent_type'])) $icl_translation_filter['parent_type'] = 'any'; // Get all the documents $icl_documents = $iclTranslationManagement->get_documents($icl_translation_filter); // Get any documents from external sources. foreach ($icl_post_types as $id => $type_info) { if (isset($icl_translation_filter['type']) && $id == $icl_translation_filter['type'] && isset($type_info->external_type) && $type_info->external_type) { $icl_documents = apply_filters('WPML_get_translatable_items', $icl_documents, $id, $icl_translation_filter); } } $icl_translators = $iclTranslationManagement->get_blog_translators(); $icl_selected_posts = array(); $icl_selected_languages = array(); $icl_selected_translators = array(); if(!empty($iclTranslationManagement->dashboard_select)){ $icl_selected_posts = $iclTranslationManagement->dashboard_select['post']; $icl_selected_languages = $iclTranslationManagement->dashboard_select['translate_to']; $icl_selected_translators = $iclTranslationManagement->dashboard_select['translator']; } if(!empty($sitepress_settings['default_translators'][$icl_translation_filter['from_lang']])){ foreach($sitepress_settings['default_translators'][$icl_translation_filter['from_lang']] as $_tolang => $tr){ if($iclTranslationManagement->translator_exists($tr['id'], $icl_translation_filter['from_lang'], $_tolang, $tr['type'])){ $icl_selected_translators[$_tolang] = $tr['type'] == 'local' ? $tr['id'] : $tr['id'] . '-' . $tr['type']; } } } foreach($sitepress->get_active_languages()as $lang){ if(empty($icl_selected_translators[$lang['code']]) && !empty($sitepress_settings['icl_lang_status']) && is_array($sitepress_settings['icl_lang_status'])){ foreach($sitepress_settings['icl_lang_status'] as $lpair){ if($lpair['from']==$icl_translation_filter['from_lang'] && $lpair['to']==$lang['code'] && !empty($lpair['translators'])){ $icl_selected_translators[$lang['code']] = $lpair['translators']['0']['id'] . '-icanlocalize'; } } } } if(!defined('ICL_DONT_PROMOTE') || !ICL_DONT_PROMOTE){ $icl_translation_services = apply_filters('icl_translation_services', array()); $icl_translation_services = array_merge($icl_translation_services, TranslationManagement::icanlocalize_service_info()); if (!empty($icl_translation_services)) { $icls_output = ''; if(empty($icl_dashboard_settings['hide_icl_promo'])){ $nt_visible = ' style="display:none"'; $nt_show = ''; }else{ $nt_visible = ''; $nt_show = 'display:none;'; } $icls_output .= '' . __('Need translators?', 'wpml-translation-management') . ''; $icls_output .= '
' . $service['description'] . '
'; $icls_output .= '' . __('Hide this', 'wpml-translation-management') . ' '; $icls_output .= '' . __('Get quote','wpml-translation-management') . ' '; $icls_output .= '