• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ninja_forms_edit_field_el_output函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ninja_forms_edit_field_el_output函数的典型用法代码示例。如果您正苦于以下问题:PHP ninja_forms_edit_field_el_output函数的具体用法?PHP ninja_forms_edit_field_el_output怎么用?PHP ninja_forms_edit_field_el_output使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ninja_forms_edit_field_el_output函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: ninja_forms_user_info_fields_groups

function ninja_forms_user_info_fields_groups($field_id, $field_data)
{
    global $ninja_forms_fields;
    $field = ninja_forms_get_field_by_id($field_id);
    $field_type = $field['type'];
    $default_user_info = 0;
    if (isset($ninja_forms_fields[$field_type]['edit_options']) and is_array($ninja_forms_fields[$field_type]['edit_options'])) {
        foreach ($ninja_forms_fields[$field_type]['edit_options'] as $option) {
            if (isset($option['name']) and $option['name'] == 'user_info_field_group' and isset($option['default'])) {
                $default_user_info = $option['default'];
                break;
            }
        }
    }
    if (isset($field_data['user_info_field_group']) and $field_data['user_info_field_group'] == 1 or (!isset($field_data['user_info_field_group']) or $field_data['user_info_field_group'] !== 0) and $default_user_info == 1) {
        $options = array(array('name' => '- ' . __('None', 'ninja-forms'), 'value' => ''), array('name' => __('Billing', 'ninja-forms'), 'value' => 'billing'), array('name' => __('Shipping', 'ninja-forms'), 'value' => 'shipping'), array('name' => __('Custom', 'ninja-forms') . ' ->', 'value' => 'custom'));
        if (isset($field_data['user_info_field_group_name'])) {
            $group_name = $field_data['user_info_field_group_name'];
        } else {
            $group_name = '';
        }
        if (isset($field_data['user_info_field_group_custom'])) {
            $group_custom = $field_data['user_info_field_group_custom'];
        } else {
            $group_custom = '';
        }
        if ($group_name == 'custom') {
            $custom_class = '';
        } else {
            $custom_class = 'hidden';
        }
        ninja_forms_edit_field_el_output($field_id, 'select', __('User Info Field Group', 'ninja-forms'), 'user_info_field_group_name', $group_name, 'thin', $options, 'user-info-group-name widefat');
        ninja_forms_edit_field_el_output($field_id, 'text', __('Custom Field Group', 'ninja-forms'), 'user_info_field_group_custom', $group_custom, 'thin', '', 'user-info-custom-group widefat ' . $custom_class, '', $custom_class);
    }
}
开发者ID:nihrain,项目名称:accelerate,代码行数:35,代码来源:user-info-fields.php


示例2: nf_edit_field_sub_settings

function nf_edit_field_sub_settings($field_id)
{
    global $ninja_forms_fields;
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    if ($ninja_forms_fields[$field_type]['process_field']) {
        if (isset($field_row['data']['admin_label'])) {
            $admin_label = $field_row['data']['admin_label'];
        } else {
            $admin_label = '';
        }
        if (isset($field_row['data']['num_sort'])) {
            $num_sort = $field_row['data']['num_sort'];
        } else {
            $num_sort = '';
        }
        ?>
		<div class="description description-wide">
		<hr>
		<h5><?php 
        _e('Submission Settings', 'ninja-forms');
        ?>
</h5>
		<?php 
        ninja_forms_edit_field_el_output($field_id, 'text', __('Admin Label', 'ninja-forms'), 'admin_label', $admin_label, 'wide', '', 'widefat code', __('This is the label used when viewing/editing/exporting submissions.', 'ninja-forms'));
        ninja_forms_edit_field_el_output($field_id, 'checkbox', __('Sort as numeric', 'ninja-forms'), 'num_sort', $num_sort, 'wide', '', '', __('If this box is checked, this column in the submissions table will sort by number.', 'ninja-forms'));
    }
}
开发者ID:serker72,项目名称:T3S,代码行数:28,代码来源:sub-settings.php


示例3: ninja_forms_edit_field_input_limit

/**
 * Function that adds a character and word limit option to textboxes and textareas.
 *
 * @since 2.4.3
 * @return void
 */
function ninja_forms_edit_field_input_limit($field_id, $field_data)
{
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    $allowed_types = apply_filters('nf_input_limit_types', array('_text', '_textarea'));
    if (!in_array($field_type, $allowed_types)) {
        return false;
    }
    if (isset($field_data['input_limit'])) {
        $input_limit = $field_data['input_limit'];
    } else {
        $input_limit = '';
    }
    if (isset($field_data['input_limit_type'])) {
        $input_limit_type = $field_data['input_limit_type'];
    } else {
        $input_limit_type = '';
    }
    if (isset($field_data['input_limit_msg'])) {
        $input_limit_msg = $field_data['input_limit_msg'];
    } else {
        $input_limit_msg = '';
    }
    $desc = '<em>' . __('If you leave the box empty, no limit will be used', 'ninja-forms') . '</em>';
    ninja_forms_edit_field_el_output($field_id, 'text', __('Limit input to this number', 'ninja-forms'), 'input_limit', $input_limit, 'thin', '', 'widefat', $desc);
    ninja_forms_edit_field_el_output($field_id, 'select', __('of', 'ninja-forms'), 'input_limit_type', $input_limit_type, 'thin', array(array('name' => __('Characters', 'ninja-forms'), 'value' => 'char'), array('name' => __('Words', 'ninja-forms'), 'value' => 'word')), 'widefat');
    echo '<p class="description description-wide">&nbsp;</p>';
    ninja_forms_edit_field_el_output($field_id, 'text', __('Text to appear after character/word counter', 'ninja-forms'), 'input_limit_msg', $input_limit_msg, 'wide', '', 'widefat');
}
开发者ID:RA2WP,项目名称:RA2WP,代码行数:35,代码来源:input-limit.php


示例4: nf_edit_field_admin_label

function nf_edit_field_admin_label($field_id, $field_data)
{
    global $ninja_forms_fields;
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    if ($ninja_forms_fields[$field_type]['process_field']) {
        if (isset($field_data['admin_label'])) {
            $admin_label = $field_data['admin_label'];
        } else {
            $admin_label = '';
        }
        if (isset($field_data['num_sort'])) {
            $num_sort = $field_data['num_sort'];
        } else {
            $num_sort = '';
        }
        ?>
		<div class="description description-wide">
		<?php 
        ninja_forms_edit_field_el_output($field_id, 'text', __('Admin Label', 'ninja-forms'), 'admin_label', $admin_label, 'wide', '', 'widefat code', __('This is the label used when viewing/editing/exporting submissions.', 'ninja-forms'));
        ?>
		</div>
		<?php 
    }
}
开发者ID:ramiy,项目名称:ninja-forms,代码行数:25,代码来源:sub-settings.php


示例5: ninja_forms_edit_field_input_limit

/**
 * Function that adds a character and word limit option to textboxes and textareas.
 *
 * @since 2.4.3
 * @return void
 */
function ninja_forms_edit_field_input_limit($field_id)
{
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    $allowed_types = apply_filters('nf_input_limit_types', array('_text', '_textarea'));
    if (!in_array($field_type, $allowed_types)) {
        return false;
    }
    $field_data = $field_row['data'];
    if (isset($field_data['input_limit'])) {
        $input_limit = $field_data['input_limit'];
    } else {
        $input_limit = '';
    }
    if (isset($field_data['input_limit_type'])) {
        $input_limit_type = $field_data['input_limit_type'];
    } else {
        $input_limit_type = '';
    }
    if (isset($field_data['input_limit_msg'])) {
        $input_limit_msg = $field_data['input_limit_msg'];
    } else {
        $input_limit_msg = '';
    }
    $desc = __('If you want to limit the number of characters or words that your user can input, set the number and type of limit you want to enforce below.', 'ninja-forms');
    ninja_forms_edit_field_el_output($field_id, 'desc', $desc);
    $desc = '<em>' . __('If you leave the box empty, no limit will be used', 'ninja-forms') . '</em>';
    ninja_forms_edit_field_el_output($field_id, 'desc', $desc);
    ninja_forms_edit_field_el_output($field_id, 'text', __('Limit input to this number', 'ninja-forms'), 'input_limit', $input_limit, 'thin', '', 'widefat', '');
    ninja_forms_edit_field_el_output($field_id, 'select', __('of', 'ninja-forms'), 'input_limit_type', $input_limit_type, 'thin', array(array('name' => __('Characters', 'ninja-forms'), 'value' => 'char'), array('name' => __('Words', 'ninja-forms'), 'value' => 'word')), 'widefat');
    ninja_forms_edit_field_el_output($field_id, 'text', __('Text to appear after character/word counter', 'ninja-forms'), 'input_limit_msg', $input_limit_msg, 'wide', '', 'widefat');
}
开发者ID:HeliWang,项目名称:EngSoc-Website,代码行数:38,代码来源:input-limit.php


示例6: nf_edit_field_req

function nf_edit_field_req($field_id, $field_data)
{
    global $ninja_forms_fields;
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    $reg_field = $ninja_forms_fields[$field_type];
    $field_req = $reg_field['req'];
    if ($field_req) {
        ninja_forms_edit_field_el_output($field_id, 'hidden', '', 'req', 1);
    }
}
开发者ID:ramiy,项目名称:ninja-forms,代码行数:11,代码来源:req.php


示例7: nf_field_autocomplete_off

function nf_field_autocomplete_off($field_id, $field_data)
{
    global $ninja_forms_fields;
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    $reg_field = $ninja_forms_fields[$field_type];
    $edit_autocomplete_off = $reg_field['edit_autocomplete_off'];
    if ($edit_autocomplete_off) {
        $autocomplete_off = isset($field_data['autocomplete_off']) ? $field_data['autocomplete_off'] : 0;
        ninja_forms_edit_field_el_output($field_id, 'checkbox', __('Disable Browser Autocomplete', 'ninja-forms'), 'autocomplete_off', $autocomplete_off, 'wide');
    }
}
开发者ID:se7ven214,项目名称:Kungfuphp.local,代码行数:12,代码来源:autocomplete-off.php


示例8: ninja_forms_edit_field_custom_class

function ninja_forms_edit_field_custom_class($field_id, $field_data)
{
    global $ninja_forms_fields;
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    $reg_field = $ninja_forms_fields[$field_type];
    $edit_custom_class = $reg_field['edit_custom_class'];
    if ($edit_custom_class) {
        if (isset($field_data['class'])) {
            $class = $field_data['class'];
        } else {
            $class = '';
        }
        ninja_forms_edit_field_el_output($field_id, 'text', __('Custom CSS Classes', 'ninja-forms'), 'class', $class, 'wide', '', 'widefat');
    }
}
开发者ID:ramiy,项目名称:ninja-forms,代码行数:16,代码来源:custom-class.php


示例9: ninja_forms_edit_field_calc

function ninja_forms_edit_field_calc($field_id)
{
    global $ninja_forms_fields;
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    if ($ninja_forms_fields[$field_type]['process_field']) {
        if (isset($field_row['data']['calc_option'])) {
            $calc_option = $field_row['data']['calc_option'];
        } else {
            $calc_option = 0;
        }
        if (isset($field_row['data']['calc_auto_include'])) {
            $calc_auto_include = $field_row['data']['calc_auto_include'];
        } else {
            $calc_auto_include = 0;
        }
        if (isset($field_row['data']['calc_value'])) {
            $calc_value = $field_row['data']['calc_value'];
        } else {
            $calc_value = 0;
        }
        ?>
		<div class="description description-wide">
		<hr>
		<h5><?php 
        _e('Calculation Settings', 'ninja-forms');
        ?>
</h5>
		<?php 
        if ($field_type == '_checkbox') {
            if (!isset($calc_value['unchecked'])) {
                $calc_value = array();
                $calc_value['unchecked'] = 0;
                $calc_value['checked'] = 0;
            }
            ninja_forms_edit_field_el_output($field_id, 'text', __('<strong>Checked</strong> Calculation Value', 'ninja-forms'), 'calc_value[checked]', $calc_value['checked'], 'wide', '', '', __('This is the value that will be used if <strong>Checked</strong>.', 'ninja-forms'));
            ninja_forms_edit_field_el_output($field_id, 'text', __('<strong>Unchecked</strong> Calculation Value', 'ninja-forms'), 'calc_value[unchecked]', $calc_value['unchecked'], 'wide', '', '', __('This is the value that will be used if <strong>Unchecked</strong>.', 'ninja-forms'));
        }
        //if ( $field_type != '_calc' ) {
        ninja_forms_edit_field_el_output($field_id, 'checkbox', __('Include in the auto-total? (If enabled)', 'ninja-forms'), 'calc_auto_include', $calc_auto_include, 'wide', '', 'ninja-forms-field-auto-total-include');
        //}
        //ninja_forms_edit_field_el_output($field_id, 'checkbox', __( 'Include in payment details list?', 'ninja-forms' ), 'calc_option', $calc_option, 'wide', '', '', __( ' - Should this field be considered as pertinant to a payment/product? i.e. an item option, a product size or color, etc.', 'ninja-forms' ) );
    }
    ?>
		
	<?php 
}
开发者ID:HeliWang,项目名称:EngSoc-Website,代码行数:47,代码来源:calc.php


示例10: ninja_forms_edit_field_placeholder

function ninja_forms_edit_field_placeholder($field_id)
{
    global $ninja_forms_fields;
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    $field_data = $field_row['data'];
    $reg_field = $ninja_forms_fields[$field_type];
    $edit_placeholder = $reg_field['edit_placeholder'];
    if ($edit_placeholder) {
        if (isset($field_data['placeholder'])) {
            $placeholder = stripslashes($field_data['placeholder']);
        } else {
            $placeholder = '';
        }
        ninja_forms_edit_field_el_output($field_id, 'text', __('Placeholder', 'ninja-forms'), 'placeholder', $placeholder, 'wide', '', 'widefat ninja-forms-field-label');
    }
}
开发者ID:ramiy,项目名称:ninja-forms,代码行数:17,代码来源:placeholder.php


示例11: ninja_forms_edit_field_help

function ninja_forms_edit_field_help($field_id)
{
    global $ninja_forms_fields;
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    $field_data = $field_row['data'];
    $reg_field = $ninja_forms_fields[$field_type];
    $edit_help = $reg_field['edit_help'];
    if ($edit_help) {
        if (isset($field_data['help_text'])) {
            $help_text = $field_data['help_text'];
        } else {
            $help_text = '';
        }
        if (isset($field_data['show_help'])) {
            $show_help = $field_data['show_help'];
        } else {
            $show_help = '';
        }
        if ($show_help == 1) {
            $display_span = '';
        } else {
            $display_span = 'display:none;';
        }
        $help_desc = sprintf(__('If "help text" is enabled, there will be a question mark %s placed next to the input field. Hovering over this question mark will show the help text.', 'ninja-forms'), '<img src="' . NINJA_FORMS_URL . 'images/question-ico.gif">');
        ninja_forms_edit_field_el_output($field_id, 'checkbox', __('Show Help Text', 'ninja-forms'), 'show_help', $show_help, 'wide', '', 'ninja-forms-show-help');
        ?>
		<span id="ninja_forms_field_<?php 
        echo $field_id;
        ?>
_help_span" style="<?php 
        echo $display_span;
        ?>
">
			<?php 
        ninja_forms_edit_field_el_output($field_id, 'textarea', __('Help Text', 'ninja-forms'), 'help_text', $help_text, 'wide', '', 'widefat');
        ninja_forms_edit_field_el_output($field_id, 'desc', $help_desc, 'help_desc');
        ?>
		</span>
		<?php 
    }
}
开发者ID:HeliWang,项目名称:EngSoc-Website,代码行数:42,代码来源:help.php


示例12: ninja_forms_field_required

function ninja_forms_field_required($field_id)
{
    global $ninja_forms_fields;
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    $field_data = $field_row['data'];
    $reg_field = $ninja_forms_fields[$field_type];
    $edit_req = $reg_field['edit_req'];
    $field_req = $reg_field['req'];
    if ($edit_req) {
        if (isset($field_data['req'])) {
            $req = $field_data['req'];
        } else {
            $req = '';
        }
        $options = array(array('name' => __('No', 'ninja-forms'), 'value' => '0'), array('name' => __('Yes', 'ninja-forms'), 'value' => '1'));
        ninja_forms_edit_field_el_output($field_id, 'select', __('Required', 'ninja-forms'), 'req', $req, 'thin', $options);
    }
    if ($field_req) {
        ninja_forms_edit_field_el_output($field_id, 'hidden', '', 'req', 1);
    }
}
开发者ID:HeliWang,项目名称:EngSoc-Website,代码行数:22,代码来源:req.php


示例13: ninja_forms_edit_field_label_pos

function ninja_forms_edit_field_label_pos($field_id, $field_data)
{
    global $ninja_forms_fields;
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    $reg_field = $ninja_forms_fields[$field_type];
    $edit_label_pos = $reg_field['edit_label_pos'];
    $label_pos_options = $reg_field['label_pos_options'];
    if (!$label_pos_options or $label_pos_options == '') {
        $options = array(array('name' => __('Left of Element', 'ninja-forms'), 'value' => 'left'), array('name' => __('Above Element', 'ninja-forms'), 'value' => 'above'), array('name' => __('Below Element', 'ninja-forms'), 'value' => 'below'), array('name' => __('Right of Element', 'ninja-forms'), 'value' => 'right'), array('name' => __('Inside Element', 'ninja-forms'), 'value' => 'inside'));
    } else {
        $options = $label_pos_options;
    }
    if ($edit_label_pos) {
        if (isset($field_data['label_pos'])) {
            $label_pos = $field_data['label_pos'];
        } else {
            $label_pos = 'above';
        }
        ninja_forms_edit_field_el_output($field_id, 'select', __('Label Position', 'ninja-forms'), 'label_pos', $label_pos, 'wide', $options, 'widefat');
    }
}
开发者ID:se7ven214,项目名称:Kungfuphp.local,代码行数:22,代码来源:label.php


示例14: ninja_forms_user_info_fields_groups

function ninja_forms_user_info_fields_groups($field_id)
{
    $field = ninja_forms_get_field_by_id($field_id);
    if (isset($field['data']['user_info_field_group']) and $field['data']['user_info_field_group'] == 1) {
        $options = array(array('name' => '- ' . __('None', 'ninja-forms'), 'value' => ''), array('name' => __('Billing', 'ninja-forms'), 'value' => 'billing'), array('name' => __('Shipping', 'ninja-forms'), 'value' => 'shipping'), array('name' => __('Custom', 'ninja-forms') . ' ->', 'value' => 'custom'));
        if (isset($field['data']['user_info_field_group_name'])) {
            $group_name = $field['data']['user_info_field_group_name'];
        } else {
            $group_name = '';
        }
        if (isset($field['data']['user_info_field_group_custom'])) {
            $group_custom = $field['data']['user_info_field_group_custom'];
        } else {
            $group_custom = '';
        }
        if ($group_name == 'custom') {
            $custom_class = '';
        } else {
            $custom_class = 'hidden';
        }
        ninja_forms_edit_field_el_output($field_id, 'select', __('User Info Field Group', 'ninja-forms'), 'user_info_field_group_name', $group_name, 'thin', $options, 'user-info-group-name widefat');
        ninja_forms_edit_field_el_output($field_id, 'text', __('Custom Field Group', 'ninja-forms'), 'user_info_field_group_custom', $group_custom, 'thin', '', 'user-info-custom-group widefat ' . $custom_class, '', $custom_class);
    }
}
开发者ID:hoonio,项目名称:PhoneAfrika,代码行数:24,代码来源:user-info-fields.php


示例15: nf_output_registered_field_settings


//.........这里部分代码省略.........
            } else {
                $name = '';
            }
            if (isset($opt['width'])) {
                $width = $opt['width'];
            } else {
                $width = '';
            }
            if (isset($opt['options'])) {
                $options = $opt['options'];
            } else {
                $options = '';
            }
            if (isset($opt['class'])) {
                $class = $opt['class'];
            } else {
                $class = '';
            }
            if (isset($opt['default'])) {
                $default = $opt['default'];
            } else {
                $default = '';
            }
            if (isset($opt['desc'])) {
                $desc = $opt['desc'];
            } else {
                $desc = '';
            }
            if (isset($field_data[$name])) {
                $value = $field_data[$name];
            } else {
                $value = $default;
            }
            ninja_forms_edit_field_el_output($field_id, $type, $label, $name, $value, $width, $options, $class, $desc, $label_class);
        }
    }
    add_action('nf_edit_field_advanced', 'nf_test', 10, 2);
    $settings_sections = apply_filters('nf_edit_field_settings_sections', array('restrictions' => __('Restriction Settings', 'ninja-forms'), 'calculations' => __('Calculation Settings', 'ninja-forms'), 'advanced' => __('Advanced Settings', 'ninja-forms')));
    foreach ($settings_sections as $key => $name) {
        ?>
		<div class="nf-field-settings description-wide description">
			<div class="title">
				<?php 
        echo $name;
        ?>
<span class="dashicons dashicons-arrow-down nf-field-sub-section-toggle"></span>
			</div>
			<div class="inside" style="display:none;">
				<?php 
        if (!empty($edit_settings[$key])) {
            foreach ($edit_settings[$key] as $opt) {
                $type = $opt['type'];
                $label_class = '';
                if (isset($opt['label'])) {
                    $label = $opt['label'];
                } else {
                    $label = '';
                }
                if (isset($opt['name'])) {
                    $name = $opt['name'];
                } else {
                    $name = '';
                }
                if (isset($opt['width'])) {
                    $width = $opt['width'];
                } else {
开发者ID:ramiy,项目名称:ninja-forms,代码行数:67,代码来源:li.php


示例16: nf_field_calc_advanced_settings

function nf_field_calc_advanced_settings($field_id, $data)
{
    $field = ninja_forms_get_field_by_id($field_id);
    if ('_calc' != $field['type']) {
        return false;
    }
    $calc_name = isset($data['calc_name']) ? $data['calc_name'] : 'calc_name';
    $default_value = isset($data['default_value']) ? $data['default_value'] : '';
    $calc_payment = isset($data['calc_payment']) ? $data['calc_payment'] : '';
    $calc_autho = isset($data['calc_auto']) ? $data['calc_auto'] : 0;
    $calc_display_type = isset($data['calc_display_type']) ? $data['calc_display_type'] : 'text';
    ninja_forms_edit_field_el_output($field_id, 'text', __('Calculation name', 'ninja-forms'), 'calc_name', $calc_name, 'wide', '', 'widefat ninja-forms-calc-name', __('This is the programmatic name of your field. Examples are: my_calc, price_total, user-total.', 'ninja-forms'));
    ninja_forms_edit_field_el_output($field_id, 'text', __('Default Value', 'ninja-forms'), 'default_value', $default_value, 'wide', '', 'widefat');
    // If any option besides "none" is selected, then show our custom class and help options.
    if ($calc_display_type == 'hidden') {
        $class = 'hidden';
    } else {
        $class = '';
    }
    if (isset($data['class'])) {
        $custom_class = $data['class'];
    } else {
        $custom_class = '';
    }
    if (isset($data['show_help'])) {
        $show_help = $data['show_help'];
    } else {
        $show_help = 0;
    }
    if (isset($data['help_text'])) {
        $help_text = $data['help_text'];
    } else {
        $help_text = '';
    }
    if ($show_help == 1) {
        $display_span = '';
    } else {
        $display_span = 'display:none;';
    }
    echo '<div id="ninja_forms_field_' . $field_id . '_calc_extra_display" class="' . $class . '">';
    // Output our custom class textbox.
    ninja_forms_edit_field_el_output($field_id, 'text', __('Custom CSS Class', 'ninja-forms'), 'class', $custom_class, 'wide', '', 'widefat');
    // Output our help text options.
    $help_desc = sprintf(__('If "help text" is enabled, there will be a question mark %s placed next to the input field. Hovering over this question mark will show the help text.', 'ninja-forms'), '<img src="' . NINJA_FORMS_URL . 'images/question-ico.gif">');
    ninja_forms_edit_field_el_output($field_id, 'checkbox', __('Show Help Text', 'ninja-forms'), 'show_help', $show_help, 'wide', '', 'ninja-forms-show-help');
    ?>
	<span id="ninja_forms_field_<?php 
    echo $field_id;
    ?>
_help_span" style="<?php 
    echo $display_span;
    ?>
">
		<?php 
    ninja_forms_edit_field_el_output($field_id, 'textarea', __('Help Text', 'ninja-forms'), 'help_text', $help_text, 'wide', '', 'widefat', $help_desc);
    ?>
	</span>
	<?php 
    echo '</div>';
}
开发者ID:ramiy,项目名称:ninja-forms,代码行数:60,代码来源:calc.php


示例17: ninja_forms_field_calc_edit

function ninja_forms_field_calc_edit($field_id, $data)
{
    if (isset($data['calc_name'])) {
        $calc_name = $data['calc_name'];
    } else {
        $calc_name = 'calc_name';
    }
    if (isset($data['default_value'])) {
        $default_value = $data['default_value'];
    } else {
        $default_value = '';
    }
    if (isset($data['calc_payment'])) {
        $calc_payment = $data['calc_payment'];
    } else {
        $calc_payment = '';
    }
    if (isset($data['calc_auto'])) {
        $calc_auto = $data['calc_auto'];
    } else {
        $calc_auto = 0;
    }
    ninja_forms_edit_field_el_output($field_id, 'text', __('Calculation name', 'ninja-forms'), 'calc_name', $calc_name, 'wide', '', 'widefat ninja-forms-calc-name', __('This is the programmatic name of your field. Examples are: my_calc, price_total, user-total.', 'ninja-forms'));
    ninja_forms_edit_field_el_output($field_id, 'text', __('Default Value', 'ninja-forms'), 'default_value', $default_value, 'wide', '', 'widefat');
    echo '<hr>';
    echo '<h5>' . __('Display Options', 'ninja-forms') . '</h5>';
    // Output calculation display type
    $options = array(array('name' => __('- None', 'ninja-forms'), 'value' => 'hidden'), array('name' => __('Textbox', 'ninja-forms'), 'value' => 'text'), array('name' => __('HTML', 'ninja-forms'), 'value' => 'html'));
    if (isset($data['calc_display_type'])) {
        $calc_display_type = $data['calc_display_type'];
    } else {
        $calc_display_type = 'text';
    }
    ninja_forms_edit_field_el_output($field_id, 'select', __('Output calculation as', 'ninja-forms'), 'calc_display_type', $calc_display_type, 'wide', $options, 'widefat ninja-forms-calc-display');
    // If the calc_display_type is set to text, then we have several options to output.
    // Set the output to hidden for these options if the calc_display_type is not set to text.
    if ($calc_display_type != 'text') {
        $class = 'hidden';
    } else {
        $class = '';
    }
    echo '<div id="ninja_forms_field_' . $field_id . '_clac_text_display" class="' . $class . '">';
    // Output a label input textbox.
    if (isset($data['label'])) {
        $label = stripslashes($data['label']);
    } else {
        $label = '';
    }
    ninja_forms_edit_field_el_output($field_id, 'text', __('Label', 'ninja-forms'), 'label', $label, 'wide', '', 'widefat');
    // Output a label position select box.
    if (isset($data['label_pos'])) {
        $label_pos = $data['label_pos'];
    } else {
        $label_pos = '';
    }
    $options = array(array('name' => __('Left of Element', 'ninja-forms'), 'value' => 'left'), array('name' => __('Above Element', 'ninja-forms'), 'value' => 'above'), array('name' => __('Below Element', 'ninja-forms'), 'value' => 'below'), array('name' => __('Right of Element', 'ninja-forms'), 'value' => 'right'));
    ninja_forms_edit_field_el_output($field_id, 'select', __('Label Position', 'ninja-forms'), 'label_pos', $label_pos, 'wide', $options, 'widefat');
    // Output a disabled option checkbox.
    if (isset($data['calc_display_text_disabled'])) {
        $calc_display_text_disabled = $data['calc_display_text_disabled'];
    } else {
        $calc_display_text_disabled = 1;
    }
    ninja_forms_edit_field_el_output($field_id, 'checkbox', __('Disable input?', 'ninja-forms'), 'calc_display_text_disabled', $calc_display_text_disabled, 'thin', '', '');
    echo '</div>';
    // Set the output to hidden for the HTML RTE if the calc_display_type is not set to HTML.
    if ($calc_display_type != 'html') {
        $class = 'hidden';
    } else {
        $class = '';
    }
    // Output our RTE. This is the only extra setting needed if the calc_display_type is set to HTML.
    if (isset($data['calc_display_html'])) {
        $calc_display_html = $data['calc_display_html'];
    } else {
        $calc_display_html = '[ninja_forms_calc]';
    }
    echo '<div id="ninja_forms_field_' . $field_id . '_clac_html_display" class="' . $class . '">';
    ninja_forms_edit_field_el_output($field_id, 'rte', '', 'calc_display_html', $calc_display_html, '', '', '', __('Use the following shortcode to insert the final calculation: [ninja_forms_calc]', 'ninja-forms'));
    echo '</div>';
    // If any option besides "none" is selected, then show our custom class and help options.
    if ($calc_display_type == 'hidden') {
        $class = 'hidden';
    } else {
        $class = '';
    }
    if (isset($data['class'])) {
        $custom_class = $data['class'];
    } else {
        $custom_class = '';
    }
    if (isset($data['show_help'])) {
        $show_help = $data['show_help'];
    } else {
        $show_help = 0;
    }
    if (isset($data['help_text'])) {
        $help_text = $data['help_text'];
    } else {
        $help_text = '';
//.........这里部分代码省略.........
开发者ID:hoonio,项目名称:PhoneAfrika,代码行数:101,代码来源:calc.php


示例18: ninja_forms_edit_field_output_li


//.........这里部分代码省略.........
            echo $field_id;
            ?>
_def">Remove Defined</a></td> --> <td width="5%"><a href="#" class="<?php 
            echo $fav_class;
            ?>
" id="ninja_forms_field_<?php 
            echo $field_id;
            ?>
_fav">Star</a></td></tr></table>
			<?php 
            do_action('ninja_forms_edit_field_before_registered', $field_id);
            $arguments = func_get_args();
            array_shift($arguments);
            // We need to remove the first arg ($function_name)
            $arguments['field_id'] = $field_id;
            $arguments['data'] = $field_data;
            if ($edit_function != '') {
                call_user_func_array($edit_function, $arguments);
            }
            /**
             * We need to get a list of all of our RTEs. 
             * If we're submitting via ajax, we'll need to use this list.
             */
            if (!isset($nf_rte_editors)) {
                $nf_rte_editors = array();
            }
            $editors = new NF_WP_Editor_Ajax();
            if (is_array($edit_options) and !empty($edit_options)) {
                foreach ($edit_options as $opt) {
                    $type = $opt['type'];
                    $label_class = '';
                    if (isset($opt['label'])) {
                        $label = $opt['label'];
                    } else {
                        $label = '';
                    }
                    if (isset($opt['name'])) {
                        $name = $opt['name'];
                    } else {
                        $name = '';
                    }
                    if (isset($opt['width'])) {
                        $width = $opt['width'];
                    } else {
                        $width = '';
                    }
                    if (isset($opt['options'])) {
                        $options = $opt['options'];
                    } else {
                        $options = '';
                    }
                    if (isset($opt['class'])) {
                        $class = $opt['class'];
                    } else {
                        $class = '';
                    }
                    if (isset($opt['default'])) {
                        $default = $opt['default'];
                    } else {
                        $default = '';
                    }
                    if (isset($opt['desc'])) {
                        $desc = $opt['desc'];
                    } else {
                        $desc = '';
                    }
                    if (isset($field_data[$name])) {
                        $value = $field_data[$name];
                    } else {
                        $value = $default;
                    }
                    ninja_forms_edit_field_el_output($field_id, $type, $label, $name, $value, $width, $options, $class, $desc, $label_class);
                }
            }
            do_action('ninja_forms_edit_field_after_registered', $field_id);
        }
    } else {
        if (isset($ninja_forms_fields[$field_type])) {
            $reg_field = $ninja_forms_fields[$field_type];
            $edit_function = $reg_field['edit_function'];
            $arguments = func_get_args();
            array_shift($arguments);
            // We need to remove the first arg ($function_name)
            $arguments['field_id'] = $field_id;
            $arguments['data'] = $field_data;
            if ($edit_function != '') {
                call_user_func_array($edit_function, $arguments);
            }
        }
    }
    /**
     * We need to get a list of all of our RTEs. 
     * If we're submitting via ajax, we'll need to use this list.
     */
    if (isset($_POST['action']) && $_POST['action'] == 'ninja_forms_new_field') {
        if (!empty($nf_rte_editors) && isset($editors) && is_object($editors)) {
            $editors->output_js($field_id, $nf_rte_editors);
        }
    }
}
开发者ID:serker72,项目名称:T3S,代码行数:101,代码来源:li.php


示例19: ninja_forms_edit_field_desc

function ninja_forms_edit_field_desc($field_id)
{
    global $ninja_forms_fields;
    $field_row = ninja_forms_get_field_by_id($field_id);
    $field_type = $field_row['type'];
    $field_data = $field_row['data'];
    $reg_field = $ninja_forms_fields[$field_type];
    if (isset($reg_field['edit_desc'])) {
        $edit_desc = $reg_field['edit_desc'];
    } else {
        $edit_desc = true;
    }
    if ($edit_desc) {
        if (isset($field_data['desc_text'])) {
            $desc_text = $field_data['desc_text'];
        } else {
            $desc_text = '';
        }
        if (isset($field_data['show_desc'])) {
            $show_desc = $field_data['show_desc'];
        } else {
            $show_desc = '';
        }
        if ($show_desc == 1) {
            $display_span = '';
        } else {
            $display_span = ' style="display:none;"';
        }
        if (!isset($desc_pos_options) or $desc_pos_options == '') {
            $options = array();
            $options[] = array('name' => __('None', 'ninja-forms'), 'value' => 'none');
            $options[] = array('name' => __('Before Everything', 'ninja-forms'), 'value' => 'before_everything');
            if ('_submit' != $field_type) {
                $options[] = array('name' => __('Before Label', 'ninja-forms'), 'value' => 'before_label');
                $options[] = array('name' => __('After Label', 'ninja-forms'), 'value' => 'after_label');
            }
            $options[] = array('name' => __('After Everything', 'ninja-forms'), 'value' => 'after_everything');
        } else {
            $options = $desc_pos_options;
        }
        $desc_desc = sprintf(__('If "desc text" is enabled, there will be a question mark %s placed next to the input field. Hovering over this question mark will show the desc text.', 'ninja-forms'), '<img src="' . NINJA_FORMS_URL . 'images/question-ico.gif">');
        ninja_forms_edit_field_el_output($field_id, 'checkbox', __('Add Description', 'ninja-forms'), 'show_desc', $show_desc, 'wide', '', 'ninja-forms-show-desc');
        ?>
		<span id="ninja_forms_field_<?php 
        echo $field_id;
        ?>
_desc_span" <?php 
        echo $display_span;
        ?>
>
			<?php 
        if (isset($field_data['desc_pos'])) {
            $desc_pos = $field_data['desc_pos'];
        } else {
            $desc_pos = '';
        }
        ninja_forms_edit_field_el_output($field_id, 'select', __('Description Position', 'ninja-forms'), 'desc_pos', $desc_pos, 'wide', $options, 'wide');
        ninja_forms_edit_field_el_output($field_id, 'rte', __('Description Content', 'ninja-forms'), 'desc_text', $desc_text, 'wide', '', 'widefat');
        ?>
		</span>
		<?php 
    }
}
开发者ID:Natedaug,项目名称:WordPressSites,代码行数:63,代码来源:desc.php


示例20: ninja_forms_field_list_edit

function ninja_forms_field_list_edit($field_id, $data)
{
    global $wpdb;
    $list_type = isset($data['list_type']) ? $data['list_type'] : '';
    $hidden = isset($data['list_show_value']) ? $data['list_show_value'] : 0;
    $multi_size = isset($data['multi_size']) ? $data['multi_size'] : 5;
    $default_options = array(array('label' => 'Option 1', 'value' => '', 'calc' => '', 'selected' => 0), array('label' => 'Option 2', 'value' => '', 'calc' => '', 'selected' => 0), array('label' => 'Option 3', 'value' => '', 'calc' => '', 'selected' => 0));
    $list_options = isset($data['list']['options']) ? $data['list']['options'] : $default_options;
    $list_type_options = array(array('name' => __('Dropdown', 'ninja-forms'), 'value' => 'dropdown'), array('name' => __('Radio', 'ninja-forms'), 'value' => 'rad 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ninja_forms_esc_html_deep函数代码示例发布时间:2022-05-15
下一篇:
PHP ninja_forms_display_form函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap