本文整理汇总了PHP中FrmAppHelper::get_countries方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper::get_countries方法的具体用法?PHP FrmAppHelper::get_countries怎么用?PHP FrmAppHelper::get_countries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmAppHelper
的用法示例。
在下文中一共展示了FrmAppHelper::get_countries方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: import_choices
function import_choices($field_id)
{
if (!current_user_can('frm_edit_forms')) {
return;
}
global $frm_ajax_url;
if (function_exists('register_admin_color_schemes')) {
register_admin_color_schemes();
}
$hook_suffix = $admin_body_class = '';
if (get_user_setting('mfold') == 'f') {
$admin_body_class .= ' folded';
}
if (function_exists('is_admin_bar_showing') and is_admin_bar_showing()) {
$admin_body_class .= ' admin-bar';
}
if (is_rtl()) {
$admin_body_class .= ' rtl';
}
$admin_body_class .= ' admin-color-' . sanitize_html_class(get_user_option('admin_color'), 'fresh');
$prepop = array();
$prepop[__('Countries', 'formidable')] = FrmAppHelper::get_countries();
$states = FrmAppHelper::get_us_states();
$prepop[__('U.S. States', 'formidable')] = array_values($states);
$prepop[__('U.S. State Abbreviations', 'formidable')] = array_keys($states);
$prepop[__('Age', 'formidable')] = array(__('Under 18', 'formidable'), __('18-24', 'formidable'), __('25-34', 'formidable'), __('35-44', 'formidable'), __('45-54', 'formidable'), __('55-64', 'formidable'), __('65 or Above', 'formidable'), __('Prefer Not to Answer', 'formidable'));
$prepop[__('Satisfaction', 'formidable')] = array(__('Very Satisfied', 'formidable'), __('Satisfied', 'formidable'), __('Neutral', 'formidable'), __('Unsatisfied', 'formidable'), __('Very Unsatisfied', 'formidable'), __('N/A', 'formidable'));
$prepop[__('Importance', 'formidable')] = array(__('Very Important', 'formidable'), __('Important', 'formidable'), __('Neutral', 'formidable'), __('Somewhat Important', 'formidable'), __('Not at all Important', 'formidable'), __('N/A', 'formidable'));
$prepop[__('Agreement', 'formidable')] = array(__('Strongly Agree', 'formidable'), __('Agree', 'formidable'), __('Neutral', 'formidable'), __('Disagree', 'formidable'), __('Strongly Disagree', 'formidable'), __('N/A', 'formidable'));
$field = FrmField::getOne($field_id);
$field->options = stripslashes_deep(maybe_unserialize($field->options));
$field->field_options = maybe_unserialize($field->field_options);
include FRM_VIEWS_PATH . '/frm-fields/import_choices.php';
die;
}
示例2: import_choices
public static function import_choices()
{
if (!current_user_can('frm_edit_forms')) {
return;
}
$field_id = $_REQUEST['field_id'];
global $current_screen, $hook_suffix;
// Catch plugins that include admin-header.php before admin.php completes.
if (empty($current_screen) && function_exists('set_current_screen')) {
$hook_suffix = '';
set_current_screen();
}
if (function_exists('register_admin_color_schemes')) {
register_admin_color_schemes();
}
$hook_suffix = $admin_body_class = '';
if (get_user_setting('mfold') == 'f') {
$admin_body_class .= ' folded';
}
if (function_exists('is_admin_bar_showing') && is_admin_bar_showing()) {
$admin_body_class .= ' admin-bar';
}
if (is_rtl()) {
$admin_body_class .= ' rtl';
}
$admin_body_class .= ' admin-color-' . sanitize_html_class(get_user_option('admin_color'), 'fresh');
$prepop = array();
$prepop[__('Countries', 'formidable')] = FrmAppHelper::get_countries();
$states = FrmAppHelper::get_us_states();
$state_abv = array_keys($states);
sort($state_abv);
$prepop[__('U.S. State Abbreviations', 'formidable')] = $state_abv;
$states = array_values($states);
sort($states);
$prepop[__('U.S. States', 'formidable')] = $states;
unset($state_abv);
unset($states);
$prepop[__('Age', 'formidable')] = array(__('Under 18', 'formidable'), __('18-24', 'formidable'), __('25-34', 'formidable'), __('35-44', 'formidable'), __('45-54', 'formidable'), __('55-64', 'formidable'), __('65 or Above', 'formidable'), __('Prefer Not to Answer', 'formidable'));
$prepop[__('Satisfaction', 'formidable')] = array(__('Very Satisfied', 'formidable'), __('Satisfied', 'formidable'), __('Neutral', 'formidable'), __('Unsatisfied', 'formidable'), __('Very Unsatisfied', 'formidable'), __('N/A', 'formidable'));
$prepop[__('Importance', 'formidable')] = array(__('Very Important', 'formidable'), __('Important', 'formidable'), __('Neutral', 'formidable'), __('Somewhat Important', 'formidable'), __('Not at all Important', 'formidable'), __('N/A', 'formidable'));
$prepop[__('Agreement', 'formidable')] = array(__('Strongly Agree', 'formidable'), __('Agree', 'formidable'), __('Neutral', 'formidable'), __('Disagree', 'formidable'), __('Strongly Disagree', 'formidable'), __('N/A', 'formidable'));
$prepop = apply_filters('frm_bulk_field_choices', $prepop);
$frm_field = new FrmField();
$field = $frm_field->getOne($field_id);
include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/import_choices.php';
die;
}