本文整理汇总了PHP中FrmFieldsHelper::field_selection方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmFieldsHelper::field_selection方法的具体用法?PHP FrmFieldsHelper::field_selection怎么用?PHP FrmFieldsHelper::field_selection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmFieldsHelper
的用法示例。
在下文中一共展示了FrmFieldsHelper::field_selection方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: change_type
function change_type($type)
{
global $frmpro_is_installed;
if ($frmpro_is_installed) {
return $type;
}
if ($type == 'scale' || $type == '10radio') {
$type = 'radio';
} else {
if ($type == 'rte') {
$type = 'textarea';
}
}
$frm_field_selection = FrmFieldsHelper::field_selection();
$types = array_keys($frm_field_selection);
if (!in_array($type, $types) && $type != 'captcha') {
$type = 'text';
}
return $type;
}
示例2: get_edit_vars
private static function get_edit_vars($id, $errors = '', $message = '', $create_link = false)
{
global $frm_entry, $frm_field, $frm_vars;
$frm_form = new FrmForm();
$form = $frm_form->getOne($id);
if (!$form) {
wp_die(__('You are trying to edit a form that does not exist.', 'formidable'));
}
$frm_field_selection = FrmFieldsHelper::field_selection();
$fields = $frm_field->getAll(array('fi.form_id' => $form->id), 'field_order');
$values = FrmAppHelper::setup_edit_vars($form, 'forms', $fields, true);
$edit_message = __('Form was Successfully Updated', 'formidable');
if ($form->is_template && $message == $edit_message) {
$message = __('Template was Successfully Updated', 'formidable');
}
if ($form->default_template) {
wp_die(__('That template cannot be edited', 'formidable'));
} else {
if (defined('DOING_AJAX')) {
die;
} else {
if ($create_link) {
require FrmAppHelper::plugin_path() . '/classes/views/frm-forms/new.php';
} else {
require FrmAppHelper::plugin_path() . '/classes/views/frm-forms/edit.php';
}
}
}
}
示例3: options_form
public static function options_form($field, $display, $values)
{
global $frm_field, $frm_settings, $frm_vars;
$form_fields = false;
if (!in_array($field['type'], array('hidden', 'user_id')) and !empty($field['hide_field']) and is_array($field['hide_field'])) {
$form_fields = $frm_field->getAll(array('fi.form_id' => (int) $field['form_id']), 'field_order');
}
$frm_field_selection = FrmFieldsHelper::field_selection();
if ($field['type'] == 'date') {
$locales = array('' => __('English/Western', 'formidable'), 'af' => __('Afrikaans', 'formidable'), 'sq' => __('Albanian', 'formidable'), 'ar' => __('Arabic', 'formidable'), 'hy' => __('Armenian', 'formidable'), 'az' => __('Azerbaijani', 'formidable'), 'eu' => __('Basque', 'formidable'), 'bs' => __('Bosnian', 'formidable'), 'bg' => __('Bulgarian', 'formidable'), 'ca' => __('Catalan', 'formidable'), 'zh-HK' => __('Chinese Hong Kong', 'formidable'), 'zh-CN' => __('Chinese Simplified', 'formidable'), 'zh-TW' => __('Chinese Traditional', 'formidable'), 'hr' => __('Croatian', 'formidable'), 'cs' => __('Czech', 'formidable'), 'da' => __('Danish', 'formidable'), 'nl' => __('Dutch', 'formidable'), 'en-GB' => __('English/UK', 'formidable'), 'eo' => __('Esperanto', 'formidable'), 'et' => __('Estonian', 'formidable'), 'fo' => __('Faroese', 'formidable'), 'fa' => __('Farsi/Persian', 'formidable'), 'fi' => __('Finnish', 'formidable'), 'fr' => __('French', 'formidable'), 'fr-CH' => __('French/Swiss', 'formidable'), 'de' => __('German', 'formidable'), 'el' => __('Greek', 'formidable'), 'he' => __('Hebrew', 'formidable'), 'hu' => __('Hungarian', 'formidable'), 'is' => __('Icelandic', 'formidable'), 'it' => __('Italian', 'formidable'), 'ja' => __('Japanese', 'formidable'), 'ko' => __('Korean', 'formidable'), 'lv' => __('Latvian', 'formidable'), 'lt' => __('Lithuanian', 'formidable'), 'ms' => __('Malaysian', 'formidable'), 'no' => __('Norwegian', 'formidable'), 'pl' => __('Polish', 'formidable'), 'pt-BR' => __('Portuguese/Brazilian', 'formidable'), 'ro' => __('Romanian', 'formidable'), 'ru' => __('Russian', 'formidable'), 'sr' => __('Serbian', 'formidable'), 'sr-SR' => __('Serbian', 'formidable'), 'sk' => __('Slovak', 'formidable'), 'sl' => __('Slovenian', 'formidable'), 'es' => __('Spanish', 'formidable'), 'sv' => __('Swedish', 'formidable'), 'ta' => __('Tamil', 'formidable'), 'th' => __('Thai', 'formidable'), 'tu' => __('Turkish', 'formidable'), 'uk' => __('Ukranian', 'formidable'), 'vi' => __('Vietnamese', 'formidable'));
} else {
if ($field['type'] == 'file') {
$mimes = get_allowed_mime_types();
}
}
require FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-fields/options-form.php';
}
示例4: get_field_types
public static function get_field_types($type)
{
$frm_field_selection = FrmFieldsHelper::field_selection();
$field_types = array();
$single_input = array('text', 'textarea', 'rte', 'number', 'email', 'url', 'image', 'file', 'date', 'phone', 'hidden', 'time', 'user_id', 'tag', 'password');
$multiple_input = array('radio', 'checkbox', 'select', 'scale');
$other_type = array('divider', 'html', 'break');
$frm_pro_field_selection = FrmFieldsHelper::pro_field_selection();
if (in_array($type, $single_input)) {
foreach ($single_input as $input) {
if (isset($frm_pro_field_selection[$input])) {
$field_types[$input] = $frm_pro_field_selection[$input];
} else {
$field_types[$input] = $frm_field_selection[$input];
}
}
} else {
if (in_array($type, $multiple_input)) {
foreach ($multiple_input as $input) {
if (isset($frm_pro_field_selection[$input])) {
$field_types[$input] = $frm_pro_field_selection[$input];
} else {
$field_types[$input] = $frm_field_selection[$input];
}
}
} else {
if (in_array($type, $other_type)) {
foreach ($other_type as $input) {
if (isset($frm_pro_field_selection[$input])) {
$field_types[$input] = $frm_pro_field_selection[$input];
} else {
$field_types[$input] = $frm_field_selection[$input];
}
}
}
}
}
return $field_types;
}
示例5: get_edit_vars
function get_edit_vars($id, $errors = '', $message = '', $create_link = false)
{
global $frm_entry, $frm_form, $frm_field, $frmpro_is_installed, $frm_ajax_url;
$record = $frm_form->getOne($id);
$frm_field_selection = FrmFieldsHelper::field_selection();
$fields = $frm_field->getAll(array('fi.form_id' => $record->id), 'field_order');
$values = FrmAppHelper::setup_edit_vars($record, 'forms', $fields, true);
$edit_message = __('Form was Successfully Updated', 'formidable');
if ($values['is_template'] and $message == $edit_message) {
$message = __('Template was Successfully Updated', 'formidable');
}
if (isset($values['default_template']) && $values['default_template']) {
wp_die(__('That template cannot be edited', 'formidable'));
} else {
if ($create_link) {
require FRM_VIEWS_PATH . '/frm-forms/new.php';
} else {
require FRM_VIEWS_PATH . '/frm-forms/edit.php';
}
}
}
示例6: options_form
function options_form($field, $display, $values)
{
global $frm_field, $frm_settings, $frm_ajax_url;
$form_fields = $frm_field->getAll("fi.form_id = " . $field['form_id'] . " and (type in ('select','radio','checkbox','10radio','scale','data') or (type = 'data' and (field_options LIKE '\"data_type\";s:6:\"select\"%' OR field_options LIKE '%\"data_type\";s:5:\"radio\"%' OR field_options LIKE '%\"data_type\";s:8:\"checkbox\"%') )) and fi.id != " . $field['id'], " ORDER BY field_order");
$post_type = FrmProForm::post_type($values);
if (function_exists('get_object_taxonomies')) {
$taxonomies = get_object_taxonomies($post_type);
}
$frm_field_selection = FrmFieldsHelper::field_selection();
$field_types = array();
$single_input = array('text', 'textarea', 'rte', 'number', 'email', 'url', 'image', 'file', 'date', 'phone', 'hidden', 'time', 'user_id', 'tag', 'password');
$multiple_input = array('radio', 'checkbox', 'select');
$other_type = array('divider', 'html', 'break');
if (in_array($field['type'], $single_input)) {
$frm_pro_field_selection = FrmFieldsHelper::pro_field_selection();
foreach ($single_input as $input) {
if (isset($frm_pro_field_selection[$input])) {
$field_types[$input] = $frm_pro_field_selection[$input];
} else {
$field_types[$input] = $frm_field_selection[$input];
}
}
} else {
if (in_array($field['type'], $multiple_input)) {
$frm_pro_field_selection = FrmFieldsHelper::pro_field_selection();
foreach ($multiple_input as $input) {
if (isset($frm_pro_field_selection[$input])) {
$field_types[$input] = $frm_pro_field_selection[$input];
} else {
$field_types[$input] = $frm_field_selection[$input];
}
}
} else {
if (in_array($field['type'], $other_type)) {
$frm_pro_field_selection = FrmFieldsHelper::pro_field_selection();
foreach ($other_type as $input) {
if (isset($frm_pro_field_selection[$input])) {
$field_types[$input] = $frm_pro_field_selection[$input];
} else {
$field_types[$input] = $frm_field_selection[$input];
}
}
}
}
}
if ($field['type'] == 'date') {
$locales = array('' => __('English/Western', 'formidable'), 'af' => __('Afrikaans', 'formidable'), 'sq' => __('Albanian', 'formidable'), 'ar' => __('Arabic', 'formidable'), 'hy' => __('Armenian', 'formidable'), 'az' => __('Azerbaijani', 'formidable'), 'eu' => __('Basque', 'formidable'), 'bs' => __('Bosnian', 'formidable'), 'bg' => __('Bulgarian', 'formidable'), 'ca' => __('Catalan', 'formidable'), 'zh-HK' => __('Chinese Hong Kong', 'formidable'), 'zh-CN' => __('Chinese Simplified', 'formidable'), 'zh-TW' => __('Chinese Traditional', 'formidable'), 'hr' => __('Croatian', 'formidable'), 'cs' => __('Czech', 'formidable'), 'da' => __('Danish', 'formidable'), 'nl' => __('Dutch', 'formidable'), 'en-GB' => __('English/UK', 'formidable'), 'eo' => __('Esperanto', 'formidable'), 'et' => __('Estonian', 'formidable'), 'fo' => __('Faroese', 'formidable'), 'fa' => __('Farsi/Persian', 'formidable'), 'fi' => __('Finnish', 'formidable'), 'fr' => __('French', 'formidable'), 'fr-CH' => __('French/Swiss', 'formidable'), 'de' => __('German', 'formidable'), 'el' => __('Greek', 'formidable'), 'he' => __('Hebrew', 'formidable'), 'hu' => __('Hungarian', 'formidable'), 'is' => __('Icelandic', 'formidable'), 'it' => __('Italian', 'formidable'), 'ja' => __('Japanese', 'formidable'), 'ko' => __('Korean', 'formidable'), 'lv' => __('Latvian', 'formidable'), 'lt' => __('Lithuanian', 'formidable'), 'ms' => __('Malaysian', 'formidable'), 'no' => __('Norwegian', 'formidable'), 'pl' => __('Polish', 'formidable'), 'pt-BR' => __('Portuguese/Brazilian', 'formidable'), 'ro' => __('Romanian', 'formidable'), 'ru' => __('Russian', 'formidable'), 'sr' => __('Serbian', 'formidable'), 'sr-SR' => __('Serbian', 'formidable'), 'sk' => __('Slovak', 'formidable'), 'sl' => __('Slovenian', 'formidable'), 'es' => __('Spanish', 'formidable'), 'sv' => __('Swedish', 'formidable'), 'ta' => __('Tamil', 'formidable'), 'th' => __('Thai', 'formidable'), 'tu' => __('Turkish', 'formidable'), 'uk' => __('Ukranian', 'formidable'), 'vi' => __('Vietnamese', 'formidable'));
} else {
if ($field['type'] == 'file') {
$mimes = get_allowed_mime_types();
}
}
require FRMPRO_VIEWS_PATH . '/frmpro-fields/options-form.php';
}
示例7: htmlspecialchars
" />
<span class="frm_hidden_fdata frm_hidden"><?php
echo htmlspecialchars(json_encode($field));
?>
</span>
</li>
<?php
return;
}
global $frm_settings;
if (!isset($frm_all_field_selection)) {
if (isset($frm_field_selection) and isset($frm_pro_field_selection)) {
$frm_all_field_selection = array_merge($frm_field_selection, $frm_pro_field_selection);
} else {
$frm_pro_field_selection = FrmFieldsHelper::pro_field_selection();
$frm_all_field_selection = array_merge(FrmFieldsHelper::field_selection(), $frm_pro_field_selection);
}
}
if (!isset($frm_vars)) {
global $frm_vars;
}
$disabled_fields = $frm_vars['pro_is_installed'] ? array() : $frm_pro_field_selection;
$display = apply_filters('frm_display_field_options', array('type' => $field['type'], 'field_data' => $field, 'required' => true, 'unique' => false, 'read_only' => false, 'description' => true, 'options' => true, 'label_position' => true, 'invalid' => false, 'size' => false, 'clear_on_focus' => false, 'default_blank' => true, 'css' => true));
if (!isset($ajax)) {
?>
<li id="frm_field_id_<?php
echo $field['id'];
?>
" class="form-field edit_form_item frm_field_box ui-state-default edit_field_type_<?php
echo $display['type'];
?>