function display_basket_notification($position) { if (class_exists('ICL_AdminNotifier') && class_exists('TranslationProxy_Basket')) { $positions = TranslationProxy_Basket::get_basket_notification_positions(); if (isset($positions[$position])) { ICL_AdminNotifier::display_messages('translation-basket-notification'); } } }
private function build_content_dashboard_documents_options() { $translate_checked = 'checked="checked"'; $duplicate_checked = ''; $do_nothing_checked = ''; if ($this->is_translation_locked()) { $translate_checked = 'disabled="disabled"'; $do_nothing_checked = 'checked="checked"'; } ?> <table class="widefat fixed" cellspacing="0" style="width:100%"> <thead> <tr> <th><?php _e('Translation options', 'wpml-translation-management'); ?> </th> </tr> </thead> <tbody> <tr> <td> <table id="icl_tm_languages" class="widefat" style="width:auto;border: none;"> <thead> <tr> <td><strong style="font-size: large"><?php _e('All Languages', 'wpml-translation-management'); ?> </strong></td> <td> <input type="radio" id="translate-all" value="1" name="radio-action-all" <?php echo $translate_checked; ?> /> <?php _e('Translate', 'wpml-translation-management'); ?> </td> <td> <input type="radio" id="duplicate-all" value="2" name="radio-action-all" <?php echo $duplicate_checked; ?> /> <?php _e('Duplicate content', 'wpml-translation-management'); ?> </td> <td> <input type="radio" id="update-none" value="0" name="radio-action-all" <?php echo $do_nothing_checked; ?> /> <?php _e('Do nothing', 'wpml-translation-management'); ?> </td> </tr> <tr class="blank_row"> <td colspan="3" style="height:6px!important;"></td> </tr> </thead> <tbody> <?php foreach ($this->active_languages as $lang) { ?> <?php if ($lang['code'] == $this->translation_filter['from_lang']) { continue; } $radio_prefix_html = '<input type="radio" name="tr_action[' . $lang['code'] . ']" '; ?> <tr> <td><strong><?php echo $lang['display_name']; ?> </strong></td> <td> <label> <?php echo $radio_prefix_html; ?> value="1" <?php echo $translate_checked; ?> /> <?php _e('Translate', 'wpml-translation-management'); ?> </label> </td> <td> <label> <?php echo $radio_prefix_html; ?> value="2" <?php echo $duplicate_checked; ?> /> <?php _e('Duplicate content', 'wpml-translation-management'); ?> </label> </td> <td> <label> <?php echo $radio_prefix_html; ?> value="0" <?php echo $do_nothing_checked; ?> /> <?php _e('Do nothing', 'wpml-translation-management'); ?> </label> </td> </tr> <?php } ?> </tbody> </table> <br/> <input name="iclnonce" type="hidden" value="<?php echo wp_create_nonce('pro-translation-icl'); ?> "/> <?php $tm_jobs_submit_disabled = disabled(empty($this->selected_languages) && empty($this->selected_posts), true, false); $tm_jobs_submit_caption = __('Add to translation basket', 'wpml-translation-management'); ?> <input id="icl_tm_jobs_submit" class="button-primary" type="submit" value="<?php echo $tm_jobs_submit_caption; ?> " <?php echo $tm_jobs_submit_disabled; ?> /> <div id="icl_dup_ovr_warn" class="icl_dup_ovr_warn" style="display:none;"> <?php $dup_message = '<p>'; $dup_message .= __('Any existing content (translations) will be overwritten when creating duplicates.', 'wpml-translation-management'); $dup_message .= '</p>'; $dup_message .= '<p>'; $dup_message .= __("When duplicating content, please first duplicate parent pages to maintain the site's hierarchy.", 'wpml-translation-management'); $dup_message .= '</p>'; ICL_AdminNotifier::display_instant_message($dup_message, 'error'); ?> </div> <div style="width: 45%; margin: auto; position: relative; top: -30px;"> <?php ICL_AdminNotifier::display_messages('translation-dashboard-under-translation-options'); ICL_AdminNotifier::remove_message('items_added_to_basket'); ?> </div> </td> </tr> </tbody> </table> <?php }
/** * Displays div with number of items in basket and link to basket * Removes notification if basket is empty */ public static function display_basket_items_notification() { ICL_AdminNotifier::display_messages('translation-basket-notification'); }
public static function display_string_menu($lang_filter) { global $sitepress; $target_status = array(); $target_rate = array(); $lang_status = $sitepress->get_setting('icl_lang_status'); $strings_target_languages = $sitepress->get_active_languages(); if ($lang_status) { foreach ($lang_status as $lang) { if ($lang['from'] == $sitepress->get_current_language()) { $target_status[$lang['to']] = $lang['have_translators']; $target_rate[$lang['to']] = $lang['max_rate']; } } } ?> <form method="post" id="icl_st_send_strings" name="icl_st_send_strings" action=""> <input type="hidden" name="icl_st_action" value="send_strings"/> <input type="hidden" name="strings" value=""/> <input type="hidden" name="icl-tr-from" value="<?php echo $lang_filter; ?> "/> <input type="hidden" name="icl-basket-language" value="<?php echo TranslationProxy_Basket::get_source_language(); ?> "/> <table id="icl-tr-opt" class="widefat fixed" cellspacing="0" style="width:100%"> <thead> <tr> <th><?php _e('Translation options', 'wpml-translation-management'); ?> </th> </tr> </thead> <tbody> <tr> <td> <ul id="icl_tm_languages"> <?php foreach ($strings_target_languages as $lang) { if ($lang['code'] == $lang_filter) { continue; } $is_active_language = $sitepress->is_active_language($lang['code']); $checked = checked(true, $is_active_language, false); $label_class = $is_active_language ? 'active' : 'non-active'; ?> <li> <input type="checkbox" id="translate_to[<?php echo $lang['code']; ?> ]" name="translate_to[<?php echo $lang['code']; ?> ]" value="1" id="icl_st_translate_to_<?php echo $lang['code']; ?> " <?php echo $checked; ?> data-language="<?php echo $lang['code']; ?> " /> <label for="translate_to[<?php echo $lang['code']; ?> ]" class="<?php echo $label_class; ?> "> <?php printf(__('Translate to %s', 'wpml-translation-management'), $lang['display_name']); ?> </label> <?php if (isset($target_status[$lang['code']]) && $target_status[$lang['code']]) { ?> <span style="display: none;" id="icl_st_max_rate_<?php echo $lang['code']; ?> "><?php echo $target_rate[$lang['code']]; ?> </span> <span style="display: none;" id="icl_st_estimate_<?php echo $lang['code']; ?> _wrap" class="icl_st_estimate_wrap"> (<?php printf(__('Estimated cost: %s USD', 'wpml-translation-management'), '<span id="icl_st_estimate_' . $lang['code'] . '">0</span>'); ?> )</span> <?php } ?> </li> <?php } ?> </ul> <?php echo wpml_nonce_field('icl-string-translation'); ?> <input id="icl_send_strings" class="button-primary" type="submit" value="<?php _e('Add to translation basket', 'wpml-translation-management'); ?> " disabled="disabled" data-lang-not-active-message="<?php _e('One of the selected strings is in a language that is not activate. It can not be added to the translation basket.', 'wpml-translation-management'); ?> " data-more-than-one-lang-message="<?php _e('Strings in different languages are selected. They can not be added to the translation basket.', 'wpml-translation-management'); ?> " data-translation-basket-lang-message="<?php _e('You cannot add strings in this language to the basket since it already contains posts or strings of another source language! Either submit the current basket or delete the posts of differing language in the current basket', 'wpml-translation-management'); ?> " /> <div class="update-nag js-translation-message" style="display:none"></div> <div style="width: 45%; margin: auto"> <?php ICL_AdminNotifier::display_messages('string-translation-under-translation-options'); ICL_AdminNotifier::remove_message('items_added_to_basket'); ?> </div> </td> </tr> </tbody> </table> </form> <?php }
public static function display_string_menu($lang_filter) { if (!defined('WPML_TM_VERSION')) { return; } global $sitepress, $WPML_String_Translation; $target_status = array(); $target_rate = array(); $lang_status = icl_get_setting('icl_lang_status'); $strings_target_languages = $sitepress->get_active_languages(); unset($strings_target_languages[$WPML_String_Translation->get_strings_language()]); if ($lang_status) { foreach ($lang_status as $lang) { if ($lang['from'] == $sitepress->get_current_language()) { $target_status[$lang['to']] = $lang['have_translators']; $target_rate[$lang['to']] = $lang['max_rate']; } } } ?> <form method="post" id="icl_st_send_strings" name="icl_st_send_strings" action=""> <input type="hidden" name="icl_st_action" value="send_strings"/> <input type="hidden" name="strings" value=""/> <input type="hidden" name="icl-tr-from" value="<?php echo $lang_filter; ?> "/> <table id="icl-tr-opt" class="widefat fixed" cellspacing="0" style="width:100%"> <thead> <tr> <th><?php _e('Translation options', 'wpml-translation-management'); ?> </th> </tr> </thead> <tbody> <tr> <td> <ul id="icl_tm_languages"> <?php foreach ($strings_target_languages as $lang) { if ($lang['code'] == $lang_filter) { continue; } $is_active_language = $sitepress->is_active_language($lang['code']); $checked = checked(true, $is_active_language, false); $label_class = $is_active_language ? 'active' : 'non-active'; ?> <li> <input type="checkbox" id="translate_to[<?php echo $lang['code']; ?> ]" name="translate_to[<?php echo $lang['code']; ?> ]" value="1" id="icl_st_translate_to_<?php echo $lang['code']; ?> " <?php echo $checked; ?> /> <label for="translate_to[<?php echo $lang['code']; ?> ]" class="<?php echo $label_class; ?> "> <?php printf(__('Translate to %s', 'wpml-translation-management'), $lang['display_name']); ?> </label> <?php if (isset($target_status[$lang['code']]) && $target_status[$lang['code']]) { ?> <span style="display: none;" id="icl_st_max_rate_<?php echo $lang['code']; ?> "><?php echo $target_rate[$lang['code']]; ?> </span> <span style="display: none;" id="icl_st_estimate_<?php echo $lang['code']; ?> _wrap" class="icl_st_estimate_wrap"> (<?php printf(__('Estimated cost: %s USD', 'wpml-translation-management'), '<span id="icl_st_estimate_' . $lang['code'] . '">0</span>'); ?> )</span> <?php } ?> </li> <?php } ?> </ul> <input name="iclnonce" type="hidden" value="<?php echo wp_create_nonce('icl-string-translation'); ?> "/> <input id="icl_send_strings" class="button-primary" type="submit" value="<?php _e('Add to translation basket', 'wpml-translation-management'); ?> " disabled="disabled"/> <div style="width: 45%; margin: auto"> <?php ICL_AdminNotifier::display_messages('string-translation-under-translation-options'); ICL_AdminNotifier::remove_message('items_added_to_basket'); ?> </div> </td> </tr> </tbody> </table> </form> <?php }