strings = $strings;
if ( ! empty( $strings ) ) {
$this->strings_in_page = icl_get_strings_tracked_in_pages( $strings );
}
$this->active_languages = $sitepress->get_active_languages();
}
public function render() {
?>
render_table_header_or_footer( 'thead' );
$this->render_table_header_or_footer( 'tfoot' );
?>
strings ) ) {
?>
|
strings as $string_id => $icl_string ) {
$this->render_string_row( $string_id, $icl_string );
}
}
?>
<>
|
|
|
|
|
|
|
<>
active_languages[ $icl_string['string_language'] ] ) ) {
$this->active_languages[ $icl_string['string_language'] ] = $sitepress->get_language_details( $icl_string['string_language'] );
}
if ( isset( $icl_string['translations'] ) ) {
foreach ( $icl_string['translations'] as $target_lang_code => $data ) {
if ( ! isset( $this->active_languages[ $target_lang_code ] ) ) {
$this->active_languages[ $target_lang_code ] = $sitepress->get_language_details( $target_lang_code );
}
}
}
?>
render_checkbox_cell( $icl_string ) ?>
|
|
hide_if_md5( $icl_string['name'] ) ); ?> |
render_view_column( $string_id ) ?>
|
>
active_languages as $lang ): if ( $lang['code'] === $icl_string['string_language'] ) {
continue;
} ?>
prefix . 'language_pairs', true );
if ( empty( $user_lang_pairs[ $icl_string['string_language'] ][ $lang['code'] ] ) ) {
continue;
}
}
$tr_complete_checked = '';
}
list( $form_disabled, $form_disabled_reason ) = $this->get_translation_form_status( $icl_string, $lang );
?>
|
|
';
}
private function render_view_column( $string_id ) {
if ( isset( $this->strings_in_page[ ICL_STRING_TRANSLATION_STRING_TRACKING_TYPE_SOURCE ][ $string_id ] ) ) {
?>
strings_in_page[ ICL_STRING_TRANSLATION_STRING_TRACKING_TYPE_PAGE ][ $string_id ] ) ) {
?>
get_var( $wpdb->prepare( "
SELECT c.status FROM {$wpdb->prefix}icl_core_status c
JOIN {$wpdb->prefix}icl_string_status s ON s.rid = c.rid
WHERE s.string_translation_id = (SELECT id FROM {$wpdb->prefix}icl_string_translations WHERE string_id=%d AND language=%s) AND c.target=%s AND c.status = %d
ORDER BY s.id DESC LIMIT 1
", $icl_string['string_id'], $lang['code'], $lang['code'], ICL_TM_WAITING_FOR_TRANSLATOR ) );
$can_translate = isset( $icl_string['translations'][ $lang['code'] ] );
if ( ! $can_translate ) {
$form_disabled_reason = __( "You can't translate this string because it hasn't been sent for translation in this language", 'wpml-string-translation' );
}
$translator_id = $can_translate ? $icl_string['translations'][ $lang['code'] ]['translator_id'] : null;
if ( $can_translate && 0 != $translator_id && get_current_user_id() != $translator_id ) {
$can_translate = false;
$form_disabled_reason = __( "You can't translate this string because it's assigned to another translator", 'wpml-string-translation' );
}
if ( $can_translate &&
0 == $translator_id &&
ICL_TM_WAITING_FOR_TRANSLATOR === (int) $icl_string['translations'][ $lang['code'] ]['status'] &&
$translation_proxy_status
) {
$can_translate = false;
$form_disabled_reason = __( "You can't translate this string because it's assigned to another translator", 'wpml-string-translation' );
}
if ( ! $can_translate ) {
$form_disabled = ' disabled="disabled" ';
}
}
return array( $form_disabled, $form_disabled_reason );
}
private function hide_if_md5( $str ) {
return preg_replace( '#^((.+)( - ))?([a-z0-9]{32})$#', '$2', $str );
}
}