本文整理汇总了PHP中TranslationManagement::translators_dropdown方法的典型用法代码示例。如果您正苦于以下问题:PHP TranslationManagement::translators_dropdown方法的具体用法?PHP TranslationManagement::translators_dropdown怎么用?PHP TranslationManagement::translators_dropdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TranslationManagement
的用法示例。
在下文中一共展示了TranslationManagement::translators_dropdown方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_translator_html
protected function get_translator_html($job)
{
$job = (object) $job;
$current_service_name = TranslationProxy::get_current_service_name();
$translation_services = array('local', TranslationProxy::get_current_service_id());
$translator = '';
if ($job->translation_service && $job->translation_service !== 'local') {
try {
$project = TranslationProxy::get_current_project();
if ($project) {
if ($project->service->has_translator_selection) {
$translator_contact_iframe_url = $project->translator_contact_iframe_url($job->translator_id);
$iframe_args = array('title' => __('Contact the translator', 'wpml-translation-management'), 'unload_cb' => 'icl_thickbox_refresh');
$translator .= TranslationProxy_Popup::get_link($translator_contact_iframe_url, $iframe_args);
$translator .= esc_html($job->translator_name);
$translator .= "</a> (" . $current_service_name . ")";
} else {
$translator .= $current_service_name;
}
} else {
$translator .= esc_html($job->translator_name);
}
} catch (Exception $e) {
// Just doesn't create the output
}
} elseif ($job->status == ICL_TM_COMPLETE) {
$translator_data = get_userdata($job->translator_id);
$translator_name = $translator_data ? $translator_data->display_name : "";
$translator = '<span class="icl-finished-local-name">' . $translator_name . '</span>';
} else {
$translator .= '<span class="icl_tj_select_translator">';
$selected_translator = isset($job->translator_id) ? $job->translator_id : false;
$disabled = false;
if ($job->translation_service && $job->translation_service !== 'local' && is_numeric($job->translation_service)) {
$selected_translator = TranslationProxy_Service::get_wpml_translator_id($job->translation_service, $job->translator_id);
$disabled = true;
}
$job_id = isset($job->job_id) ? $job->job_id : $job->id;
$local_only = isset($job->local_only) ? $job->local_only : true;
$args = array('id' => 'icl_tj_translator_for_' . $job_id, 'name' => 'icl_tj_translator_for_' . $job_id, 'from' => $job->source_language_code, 'to' => $job->language_code, 'selected' => $selected_translator, 'services' => $translation_services, 'disabled' => $disabled, 'echo' => false, 'local_only' => $local_only);
$translator .= TranslationManagement::translators_dropdown($args);
$translator .= '<input type="hidden" id="icl_tj_ov_' . $job_id . '" value="' . (int) $job->translator_id . '" />';
$translator .= '<input type="hidden" id="icl_tj_ty_' . $job_id . '" value="' . strtolower($this->get_type()) . '" />';
$translator .= '<span class="icl_tj_select_translator_controls" id="icl_tj_tc_' . $job_id . '">';
$translator .= '<input type="button" class="button-secondary icl_tj_ok" value="' . __('Send', 'wpml-translation-management') . '" /> ';
$translator .= '<input type="button" class="button-secondary icl_tj_cancel" value="' . __('Cancel', 'wpml-translation-management') . '" />';
$translator .= '</span>';
}
return $translator;
}
示例2: build_translation_options
//.........这里部分代码省略.........
</th>
<th scope="col"><?php
_e('Translator', 'wpml-translation-management');
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="col"><?php
_e('Language', 'wpml-translation-management');
?>
</th>
<th scope="col"><?php
_e('Translator', 'wpml-translation-management');
?>
</th>
</tr>
</tfoot>
<?php
$basket_languages = TranslationProxy_Basket::get_target_languages();
if ($basket_languages) {
?>
<tbody>
<?php
$target_languages = $sitepress->get_active_languages();
foreach ($target_languages as $key => $lang) {
if (!in_array($lang['code'], $basket_languages)) {
unset($target_languages[$key]);
}
}
foreach ($target_languages as $lang) {
if ($lang['code'] === TranslationProxy_Basket::get_source_language()) {
continue;
}
?>
<tr>
<td><strong><?php
echo $lang['display_name'];
?>
</strong></td>
<td>
<label for="<?php
echo esc_attr('translator[' . $lang['code'] . ']');
?>
">
<?php
_e('Translate by', 'wpml-translation-management');
?>
</label>
<?php
$selected_translator = isset($icl_selected_translators[$lang['code']]) ? $icl_selected_translators[$lang['code']] : false;
if ($selected_translator === false) {
$selected_translator = TranslationProxy_Service::get_wpml_translator_id();
}
$args = array('from' => TranslationProxy_Basket::get_source_language(), 'to' => $lang['code'], 'name' => 'translator[' . $lang['code'] . ']', 'selected' => $selected_translator, 'services' => array('local', TranslationProxy::get_current_service_id()));
TranslationManagement::translators_dropdown($args);
?>
<a href="admin.php?page=<?php
echo WPML_TM_FOLDER;
?>
/menu/main.php&sm=translators"><?php
_e('Manage translators', 'wpml-translation-management');
?>
</a>
</td>
</tr>
<?php
}
?>
</tbody>
<?php
}
?>
</table>
<br>
<?php
echo TranslationProxy_Basket::get_basket_extra_fields_section();
?>
<?php
wp_nonce_field('send_basket_items_nonce', '_icl_nonce_send_basket_items');
?>
<?php
wp_nonce_field('send_basket_item_nonce', '_icl_nonce_send_basket_item');
?>
<?php
wp_nonce_field('send_basket_commit_nonce', '_icl_nonce_send_basket_commit');
?>
<?php
wp_nonce_field('check_basket_name_nonce', '_icl_nonce_check_basket_name');
?>
<input type="submit" class="button-primary" name="send-all-jobs-for-translation" value="<?php
_e('Send all items for translation', 'wpml-translation-management');
?>
">
</form>
<?php
}
do_action('wpml_translation_basket_page_after');
}
示例3: array
<script type="text/html" id="table-listing-filter">
<?php
global $iclTranslationManagement, $sitepress;
$translation_services = array('local', TranslationProxy::get_current_service_id());
$args = array('name' => 'filter[translator_id]', 'default_name' => __('All', 'wpml-translation-management'), 'selected' => isset($icl_translation_filter['translator_id']) ? $icl_translation_filter['translator_id'] : '', 'services' => $translation_services, 'add_label' => true);
TranslationManagement::translators_dropdown($args);
?>
<label for="filter-job-status">
<?php
_e('Status', 'wpml-translation-management');
?>
</label> <select id="filter-job-status" name="filter[status]">
<option value=""><?php
_e('All translation jobs', 'wpml-translation-management');
?>
</option>
<option value="<?php
echo ICL_TM_WAITING_FOR_TRANSLATOR;
?>
"><?php
echo TranslationManagement::status2text(ICL_TM_WAITING_FOR_TRANSLATOR);
?>
</option>
<option value="<?php
echo ICL_TM_IN_PROGRESS;
?>
"><?php
echo TranslationManagement::status2text(ICL_TM_IN_PROGRESS);
?>
</option>
<option value="<?php