public function render_string_row($string_id, $icl_string) { global $wpdb, $sitepress, $WPML_String_Translation; if (isset($icl_string['string_language']) && !isset($this->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 (array_keys($icl_string['translations']) as $target_lang_code) { if (!isset($this->active_languages[$target_lang_code])) { $this->active_languages[$target_lang_code] = $sitepress->get_language_details($target_lang_code); } } } ?> <tr valign="top"> <?php echo $this->render_checkbox_cell($icl_string); ?> <td class="wpml-st-col-domain"><?php echo esc_html($icl_string['context']); ?> </td> <td><?php echo esc_html($icl_string['gettext_context']); ?> </td> <td class="wpml-st-col-name"><?php echo esc_html($this->hide_if_md5($icl_string['name'])); ?> </td> <td nowrap="nowrap"> <?php $this->render_view_column($string_id); ?> </td> <td class="wpml-st-col-string"> <div class="icl-st-original"<?php _icl_string_translation_rtl_div($this->string_settings['strings_language']); ?> > <img src="<?php echo $sitepress->get_flag_url($icl_string['string_language']); ?> "> <?php echo esc_html($icl_string['value']); ?> </div> <div style="float:right;"> <a href="#icl-st-toggle-translations"><?php echo __('translations', 'wpml-string-translation'); ?> </a> </div> <br clear="all" /> <div class="icl-st-inline"> <?php foreach ($this->active_languages as $lang) { if ($lang['code'] === $icl_string['string_language']) { continue; } ?> <?php if (isset($icl_string['translations'][$lang['code']]) && $icl_string['translations'][$lang['code']]['status'] == ICL_TM_COMPLETE) { $tr_complete_checked = 'checked="checked"'; } else { if (icl_st_is_translator()) { $user_lang_pairs = get_user_meta(get_current_user_id(), $wpdb->prefix . 'language_pairs', true); if (empty($user_lang_pairs[$this->string_settings['strings_language']][$lang['code']])) { continue; } } $tr_complete_checked = ''; } list($form_disabled, $form_disabled_reason) = $this->get_translation_form_status($icl_string, $lang); ?> <form class="icl_st_form" name="icl_st_form_<?php echo $lang['code'] . '_' . $string_id; ?> " action=""> <?php wp_nonce_field('icl_st_save_translation_nonce', '_icl_nonce'); ?> <input type="hidden" name="icl_st_language" value="<?php echo $lang['code']; ?> " /> <input type="hidden" name="icl_st_string_id" value="<?php echo $string_id; ?> " /> <table class="icl-st-table"> <tr> <td style="border:none"> <?php echo $lang['display_name']; ?> <br /> <img class="icl_ajx_loader" src="<?php echo WPML_ST_URL; ?> /res/img/ajax-loader.gif" style="float:left;display:none;position:absolute;margin:5px" alt="" /> <?php $rows = ceil(strlen($icl_string['value']) / 80); $temp_line_array = preg_split('/\\n|\\r/', $icl_string['value']); $temp_num_lines = count($temp_line_array); $rows = $rows + $temp_num_lines; if (isset($icl_string['translations'][$lang['code']]) && !is_null($icl_string['translations'][$lang['code']]['value'])) { $string_value = $icl_string['translations'][$lang['code']]['value']; } else { $string_value = $icl_string['value']; } ?> <textarea<?php echo $form_disabled; _icl_string_translation_rtl_textarea($lang['code']); ?> rows="<?php echo $rows; ?> " cols="40" name="icl_st_translation" <?php if (isset($icl_string['translations'][$lang['code']])) { ?> id="icl_st_ta_<?php echo $icl_string['translations'][$lang['code']]['id']; ?> "<?php } ?> ><?php echo $string_value; ?> </textarea> </td> </tr> <tr> <td align="right" style="border:none"> <?php ?> <?php if (isset($icl_string['translations'][$lang['code']]['value']) && preg_match('#<([^>]*)>#im', $icl_string['translations'][$lang['code']]['value'])) { ?> <br clear="all" /><div style="text-align:left;display:none" class="icl_html_preview"></div> <a href="#" class="alignleft icl_htmlpreview_link">HTML preview</a> <?php } ?> <label><input<?php echo $form_disabled; ?> type="checkbox" name="icl_st_translation_complete" value="1" <?php echo $tr_complete_checked; ?> <?php if (isset($icl_string['translations'][$lang['code']])) { ?> id="icl_st_cb_<?php echo $icl_string['translations'][$lang['code']]['id']; ?> "<?php } ?> /> <?php echo __('Translation is complete', 'wpml-string-translation'); ?> </label> <input<?php echo $form_disabled; ?> type="submit" class="button-secondary action" value="<?php echo __('Save', 'wpml-string-translation'); ?> " /> <?php if ($form_disabled_reason) { ?> <br clear="all" /> <p><?php echo $form_disabled_reason; ?> </p> <?php } ?> </td> </tr> </table> </form> <?php } ?> </div> </td> <td nowrap="nowrap" id="icl_st_string_status_<?php echo $string_id; ?> "> <span> <?php echo apply_filters('wpml_string_status_text', WPML_ST_String_Statuses::get_status((int) $icl_string['status']), $string_id); ?> </span> <input type="hidden" id="icl_st_wc_<?php echo $string_id; ?> " value="<?php echo $WPML_String_Translation->estimate_word_count($icl_string['value'], $this->string_settings['strings_language']); ?> " /> </td> </tr> <?php }
?> &width=810&height=600"><img src="<?php echo WPML_ST_URL; ?> /res/img/view-in-page.png" width="16" height="16" alt="<?php _e('view in page', 'wpml-string-translation'); ?> " /></a> <?php } ?> </td> <td width="70%"> <div class="icl-st-original"<?php _icl_string_translation_rtl_div($sitepress_settings['st']['strings_language']); ?> > <?php echo esc_html($icl_string['value']); ?> </div> <div style="float:right;"> <a href="#icl-st-toggle-translations"><?php echo __('translations', 'wpml-string-translation'); ?> </a> </div> <br clear="all" /> <div class="icl-st-inline"> <?php
?> &width=810&height=600"><img src="<?php echo WPML_ST_URL; ?> /res/img/view-in-page.png" width="16" height="16" alt="<?php _e('view in page', 'wpml-string-translation'); ?> " /></a> <?php } ?> </td> <td width="70%"> <div class="icl-st-original"<?php _icl_string_translation_rtl_div($string_settings['strings_language']); ?> > <?php echo esc_html($icl_string['value']); ?> </div> <div style="float:right;"> <a href="#icl-st-toggle-translations"><?php echo __('translations', 'wpml-string-translation'); ?> </a> </div> <br clear="all" /> <div class="icl-st-inline"> <?php