本文整理汇总了PHP中RGFormsModel类的典型用法代码示例。如果您正苦于以下问题:PHP RGFormsModel类的具体用法?PHP RGFormsModel怎么用?PHP RGFormsModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RGFormsModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: crb_get_forms
/**
* Get all available gravity forms
*/
function crb_get_forms()
{
$forms = array();
if (!class_exists('RGFormsModel')) {
return;
}
$available_forms = RGFormsModel::get_forms(null, 'title');
foreach ($available_forms as $form) {
$forms[$form->id] = $form->title;
}
return $forms;
}
示例2: is_condition_true
/**
* Check if the iDEAL condition is true
*
* @param mixed $form
* @param mixed $feed
*/
public static function is_condition_true($form, $feed)
{
if (!$feed->condition_enabled) {
return true;
}
$field = RGFormsModel::get_field($form, $feed->condition_field_id);
// Unknown field
if (empty($field)) {
return true;
}
$is_hidden = RGFormsModel::is_field_hidden($form, $field, array());
// Ignore condition if the field is hidden
if ($is_hidden) {
return false;
}
$value = RGFormsModel::get_field_value($field, array());
$is_match = RGFormsModel::is_value_match($value, $feed->condition_value);
switch ($feed->condition_operator) {
case Pronamic_WP_Pay_Extensions_GravityForms_GravityForms::OPERATOR_IS:
$result = $is_match;
break;
case Pronamic_WP_Pay_Extensions_GravityForms_GravityForms::OPERATOR_IS_NOT:
$result = !$is_match;
break;
default:
$result = true;
}
return $result;
}
示例3: set_post_categories
/**
* Update the post categories based on all post category fields
*
* @since 1.17
*
* @param array $form Gravity Forms form array
* @param int $entry_id Numeric ID of the entry that was updated
*
* @return array|false|WP_Error Array of term taxonomy IDs of affected categories. WP_Error or false on failure. false if there are no post category fields or connected post.
*/
public function set_post_categories($form = array(), $entry_id = 0)
{
$entry = GFAPI::get_entry($entry_id);
$post_id = rgar($entry, 'post_id');
if (empty($post_id)) {
return false;
}
$return = false;
$post_category_fields = GFAPI::get_fields_by_type($form, 'post_category');
if ($post_category_fields) {
$updated_categories = array();
foreach ($post_category_fields as $field) {
// Get the value of the field, including $_POSTed value
$field_cats = RGFormsModel::get_field_value($field);
$field_cats = is_array($field_cats) ? array_values($field_cats) : (array) $field_cats;
$field_cats = gv_map_deep($field_cats, 'intval');
$updated_categories = array_merge($updated_categories, array_values($field_cats));
}
// Remove `0` values from intval()
$updated_categories = array_filter($updated_categories);
/**
* @filter `gravityview/edit_entry/post_categories/append` Should post categories be added to or replaced?
* @since 1.17
* @param bool $append If `true`, don't delete existing categories, just add on. If `false`, replace the categories with the submitted categories. Default: `false`
*/
$append = apply_filters('gravityview/edit_entry/post_categories/append', false);
$return = wp_set_post_categories($post_id, $updated_categories, $append);
}
return $return;
}
示例4: partners_sub_page_metaboxes
function partners_sub_page_metaboxes()
{
$prefix = '_partners_page_';
$options[0] = 'Please select...';
if (class_exists('RGFormsModel')) {
foreach (RGFormsModel::get_forms(null, 'title') as $form) {
$options[$form->id] = $form->title;
}
}
/**
* Initiate the metabox
*/
$cmb = new_cmb2_box(array('id' => 'partners_page_form_meta', 'title' => __('Partners Page Form', 'cmb2'), 'object_types' => array('page'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'show_on' => array('key' => 'page-template', 'value' => 'templates/partners.php')));
// Regular text field
$cmb->add_field(array('name' => __('Pick a Form', 'cmb2'), 'id' => $prefix . 'form_dropdown', 'type' => 'select', 'options' => $options));
/**
* Initiate the metabox
*/
$cmb = new_cmb2_box(array('id' => 'partners_page_file_meta', 'title' => __('Partners Page File Downloads', 'cmb2'), 'object_types' => array('page'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'show_on' => array('key' => 'page-template', 'value' => 'templates/partners.php')));
$group_field_id = $cmb->add_field(array('id' => 'partners_file_download_group', 'type' => 'group', 'options' => array('group_title' => __('File {#}', 'cmb2'), 'add_button' => __('Add Another File', 'cmb2'), 'remove_button' => __('Remove File', 'cmb2'), 'sortable' => true)));
// Id's for group's fields only need to be unique for the group. Prefix is not needed.
$cmb->add_group_field($group_field_id, array('name' => 'File Title', 'id' => 'title', 'type' => 'text'));
$cmb->add_group_field($group_field_id, array('name' => 'File Upload', 'id' => 'link', 'type' => 'file'));
$cmb->add_group_field($group_field_id, array('name' => 'File Image', 'id' => 'image', 'type' => 'file'));
}
示例5: setup_entry
function setup_entry($post_entry)
{
// echo "post array <br>";
// print_r($post_entry);
// echo "<br><br>";
// echo "loading and ids <br><br>";
$return = array();
$return['form_id'] = $post_entry['form_id'];
$form = RGFormsModel::get_form_meta($post_entry['form_id']);
// $counter=0;
// filter array entry with no sub content ex: 1,2,3,4,5,6,7,8
foreach ($form['fields'] as $field) {
// $counter++;
$post_entry_key = 'input_' . $field['id'];
// echo "$counter .) " . $field['id'] . ' = ' . $post_entry[$post_entry_key] . " <br>";
if (array_key_exists($post_entry_key, $post_entry)) {
$return[$field['id']] = $post_entry[$post_entry_key];
}
}
//filter array entry with sub content ex: 200.1, 299.2, 323.3
$entrySub1 = getEntrySub1($post_entry);
foreach ($entrySub1 as $entryId) {
$post_entry_key = 'input_' . $entryId;
if (array_key_exists($post_entry_key, $post_entry)) {
$return[$entryId] = $post_entry[$post_entry_key];
}
}
return $return;
}
示例6: get_field_input
/**
* Returns the field input.
*
* @param array $form
* @param string $value
* @param null|array $entry
*
* @return string
*/
public function get_field_input($form, $value = '', $entry = null)
{
if (is_array($value)) {
$value = '';
}
$is_entry_detail = $this->is_entry_detail();
$is_form_editor = $this->is_form_editor();
$form_id = $form['id'];
$id = intval($this->id);
$field_id = $is_entry_detail || $is_form_editor || $form_id == 0 ? "input_{$id}" : 'input_' . $form_id . "_{$id}";
$size = $this->size;
$disabled_text = $is_form_editor ? "disabled='disabled'" : '';
$class_suffix = $is_entry_detail ? '_admin' : '';
$class = $size . $class_suffix;
$instruction_div = '';
if ($this->failed_validation) {
$phone_format = $this->get_phone_format();
if (rgar($phone_format, 'instruction')) {
$instruction_div = sprintf("<div class='instruction validation_message'>%s %s</div>", esc_html__('Phone format:', 'gravityforms'), $phone_format['instruction']);
}
}
$html_input_type = RGFormsModel::is_html5_enabled() ? 'tel' : 'text';
$logic_event = $this->get_conditional_logic_event('keyup');
$placeholder_attribute = $this->get_field_placeholder_attribute();
$required_attribute = $this->isRequired ? 'aria-required="true"' : '';
$invalid_attribute = $this->failed_validation ? 'aria-invalid="true"' : 'aria-invalid="false"';
$tabindex = $this->get_tabindex();
return sprintf("<div class='ginput_container ginput_container_phone'><input name='input_%d' id='%s' type='{$html_input_type}' value='%s' class='%s' {$tabindex} {$logic_event} {$placeholder_attribute} {$required_attribute} {$invalid_attribute} %s/>{$instruction_div}</div>", $id, $field_id, esc_attr($value), esc_attr($class), $disabled_text);
}
示例7: run
public function run($arguments)
{
if (class_exists('RGFormsModel') && is_callable(array('RGFormsModel', 'get_forms'))) {
return RGFormsModel::get_forms();
}
return false;
}
示例8: output_data
function output_data($pdf, $lead = array(), $form = array(), $fieldData = array())
{
$pdf->AddPage();
$dataArray = array(array('Project ID #', 3), array('Project Name', 28), array('Name of person responsible for fire safety at your exhibit', 5), array('Their Email', 15), array('Their phone', 16), array('Description', 19), array('Describe your safety concerns', 12), array('Describe how you plan to keep your exhibit safe', 20), array('Who will be assisting at your exhibit to keep it safe', 11), array('Placement Requirements', 7), array('Do you have Insurance', 9), array('Additional Comments', 13), array('Are you 18 years or older?', 23), array('Signed', 25), array('I am the Parent and/or Legal Guardian of', 26), array('Date', 27));
$pdf->SetFillColor(190, 210, 247);
$lineheight = 6;
foreach ($dataArray as $data) {
$fieldID = $data[1];
if (isset($fieldData[$fieldID])) {
$field = $fieldData[$fieldID];
$value = RGFormsModel::get_lead_field_value($lead, $field);
if (RGFormsModel::get_input_type($field) != 'email') {
$display_value = GFCommon::get_lead_field_display($field, $value);
$display_value = apply_filters('gform_entry_field_value', $display_value, $field, $lead, $form);
} else {
$display_value = $value;
}
} else {
$display_value = '';
}
$pdf->MultiCell(0, $lineheight, $data[0] . ': ');
$pdf->MultiCell(0, $lineheight, $display_value, 0, 'L', true);
$pdf->Ln();
}
}
示例9: get_value_merge_tag
public function get_value_merge_tag($value, $input_id, $entry, $form, $modifier, $raw_value, $url_encode, $esc_html, $format, $nl2br)
{
$use_value = $modifier == 'value';
$use_price = in_array($modifier, array('price', 'currency'));
$format_currency = $modifier == 'currency';
if (is_array($raw_value) && (string) intval($input_id) != $input_id) {
$items = array($input_id => $value);
//float input Ids. (i.e. 4.1 ). Used when targeting specific checkbox items
} elseif (is_array($raw_value)) {
$items = $raw_value;
} else {
$items = array($input_id => $raw_value);
}
$ary = array();
foreach ($items as $input_id => $item) {
if ($use_value) {
list($val, $price) = rgexplode('|', $item, 2);
} elseif ($use_price) {
list($name, $val) = rgexplode('|', $item, 2);
if ($format_currency) {
$val = GFCommon::to_money($val, rgar($entry, 'currency'));
}
} elseif ($this->type == 'post_category') {
$use_id = strtolower($modifier) == 'id';
$item_value = GFCommon::format_post_category($item, $use_id);
$val = RGFormsModel::is_field_hidden($form, $this, array(), $entry) ? '' : $item_value;
} else {
$val = RGFormsModel::is_field_hidden($form, $this, array(), $entry) ? '' : RGFormsModel::get_choice_text($this, $raw_value, $input_id);
}
$ary[] = GFCommon::format_variable_value($val, $url_encode, $esc_html, $format);
}
return GFCommon::implode_non_blank(', ', $ary);
}
示例10: acquirer_field_input
/**
* Acquirrer field input
*
* @param string $field_content
* @param string $field
* @param string $value
* @param string $lead_id
* @param string $form_id
*/
public static function acquirer_field_input($field_content, $field, $value, $lead_id, $form_id)
{
$type = RGFormsModel::get_input_type($field);
if (Pronamic_WP_Pay_Extensions_GravityForms_IssuerDropDown::TYPE === $type) {
$id = $field['id'];
$field_id = IS_ADMIN || 0 === $form_id ? "input_{$id}" : 'input_' . $form_id . "_{$id}";
$class_suffix = RG_CURRENT_VIEW === 'entry' ? '_admin' : '';
$size = rgar($field, 'size');
$class = $size . $class_suffix;
$css_class = trim(esc_attr($class) . ' gfield_ideal_acquirer_select');
$tab_index = GFCommon::get_tabindex();
$disabled_text = IS_ADMIN && 'entry' !== RG_CURRENT_VIEW ? "disabled='disabled'" : '';
$html = '';
$feed = get_pronamic_gf_pay_conditioned_feed_by_form_id($form_id, true);
/**
* Developing warning:
* Don't use single quotes in the HTML you output, it is buggy in combination with SACK
*/
if (IS_ADMIN) {
if (null === $feed) {
$html .= sprintf("<a class='ideal-edit-link' href='%s' target='_blank'>%s</a>", add_query_arg('post_type', 'pronamic_pay_gf', admin_url('post-new.php')), __('Create iDEAL feed', 'pronamic_ideal'));
} else {
$html .= sprintf("<a class='ideal-edit-link' href='%s' target='_blank'>%s</a>", get_edit_post_link($feed->id), __('Edit iDEAL feed', 'pronamic_ideal'));
}
}
$html_input = '';
$html_error = '';
if (null !== $feed) {
$gateway = Pronamic_WP_Pay_Plugin::get_gateway($feed->config_id);
if ($gateway) {
$issuer_field = $gateway->get_issuer_field();
$error = $gateway->get_error();
if (is_wp_error($error)) {
$html_error .= Pronamic_WP_Pay_Plugin::get_default_error_message();
$html_error .= '<br /><em>' . $error->get_error_message() . '</em>';
} elseif ($issuer_field) {
$choices = $issuer_field['choices'];
$options = Pronamic_WP_HTML_Helper::select_options_grouped($choices, $value);
// Double quotes are not working, se we replace them with an single quote
$options = str_replace('"', '\'', $options);
$html_input = '';
$html_input .= sprintf("<select name='input_%d' id='%s' class='%s' %s %s>", $id, $field_id, $css_class, $tab_index, $disabled_text);
$html_input .= sprintf('%s', $options);
$html_input .= sprintf('</select>');
}
}
}
if ($html_error) {
$html .= sprintf("<div class='gfield_description validation_message'>");
$html .= sprintf('%s', $html_error);
$html .= sprintf('</div>');
} else {
$html .= sprintf("<div class='ginput_container ginput_ideal'>");
$html .= sprintf('%s', $html_input);
$html .= sprintf('</div>');
}
$field_content = $html;
}
return $field_content;
}
示例11: output_data
function output_data($pdf, $lead = array(), $form = array(), $fieldData = array())
{
$pdf->AddPage();
$dataArray = array(array('Project ID #', 3, 'text'), array('Project Name', 38, 'text'), array('Name of person responsible for fire safety at your exhibit', 21, 'text'), array('Their Email', 23, 'text'), array('Their Phone', 24, 'text'), array('Description', 37, 'textarea'), array('Describe your fire safety concerns', 19, 'textarea'), array('Describe how you plan to keep your exhibit safe', 27, 'textarea'), array('Who will be assisting at your exhibit to keep it safe', 20, 'text'), array('Placement Requirements', 7, 'textarea'), array('What is burning', 10, 'text'), array('What is the fuel source', 11, 'text'), array('how much is fuel is burning and in what time period', 12, 'textarea'), array('how much fuel will you have at the event, including tank sizes', 13, 'textarea'), array('where and how is the fuel stored', 14, 'text'), array('Does the valve have an electronic propane sniffer', 15, 'text'), array('Other suppression devices', 16, 'textarea'), array('Do you have insurance?', 18, 'text'), array('Additional comments', 28, 'textarea'), array('Are you 18 years or older?', 30, 'text'), array('Signed', 32, 'text'), array('I am the Parent and/or Legal Guardian of', 33, 'text'), array('Date', 34, 'text'));
$pdf->SetFillColor(190, 210, 247);
$lineheight = 6;
foreach ($dataArray as $data) {
$fieldID = $data[1];
if (isset($fieldData[$fieldID])) {
$field = $fieldData[$fieldID];
$value = RGFormsModel::get_lead_field_value($lead, $field);
if (RGFormsModel::get_input_type($field) != 'email') {
$display_value = GFCommon::get_lead_field_display($field, $value);
$display_value = apply_filters('gform_entry_field_value', $display_value, $field, $lead, $form);
} else {
$display_value = $value;
}
} else {
$display_value = '';
}
$pdf->MultiCell(0, $lineheight, $data[0] . ': ');
$pdf->MultiCell(0, $lineheight, $display_value, 0, 'L', true);
$pdf->Ln();
}
}
示例12: gform_column_splits
function gform_column_splits($content, $field, $value, $lead_id, $form_id)
{
if (IS_ADMIN) {
return $content;
}
// only modify HTML on the front end
$form = RGFormsModel::get_form_meta($form_id, true);
$form_class = array_key_exists('cssClass', $form) ? $form['cssClass'] : '';
$form_classes = preg_split('/[\\n\\r\\t ]+/', $form_class, -1, PREG_SPLIT_NO_EMPTY);
$fields_class = array_key_exists('cssClass', $field) ? $field['cssClass'] : '';
$field_classes = preg_split('/[\\n\\r\\t ]+/', $fields_class, -1, PREG_SPLIT_NO_EMPTY);
if (!is_admin()) {
// multi-column form functionality
if ($field['type'] == 'section') {
$form = RGFormsModel::get_form_meta($form_id, true);
// check for the presence of multi-column form classes
$form_class = explode(' ', $form['cssClass']);
$form_class_matches = array_intersect($form_class, array('two-column', 'three-column'));
// check for the presence of section break column classes
$field_class = explode(' ', $field['cssClass']);
$field_class_matches = array_intersect($field_class, array('gform_column'));
// if field is a column break in a multi-column form, perform the list split
if (!empty($form_class_matches) && !empty($field_class_matches)) {
// make sure to target only multi-column forms
// retrieve the form's field list classes for consistency
$form = RGFormsModel::add_default_properties($form);
$description_class = rgar($form, 'descriptionPlacement') == 'above' ? 'description_above' : 'description_below';
// close current field's li and ul and begin a new list with the same form field list classes
return '</li></ul><ul class="gform_fields ' . $form['labelPlacement'] . ' ' . $description_class . ' ' . $field['cssClass'] . '"><li class="gfield gsection empty">';
}
}
}
return $content;
}
示例13: get_field_input
public function get_field_input($form, $value = '', $entry = null)
{
$is_entry_detail = $this->is_entry_detail();
$is_form_editor = $this->is_form_editor();
if (is_array($value)) {
$value = array_values($value);
}
$form_id = $form['id'];
$id = intval($this->id);
$field_id = $is_entry_detail || $is_form_editor || $form_id == 0 ? "input_{$id}" : 'input_' . $form_id . "_{$id}";
$form_id = ($is_entry_detail || $is_form_editor) && empty($form_id) ? rgget('id') : $form_id;
$size = $this->size;
$disabled_text = $is_form_editor ? "disabled='disabled'" : '';
$class_suffix = $is_entry_detail ? '_admin' : '';
$class = $this->emailConfirmEnabled ? '' : $size . $class_suffix;
//Size only applies when confirmation is disabled
$form_sub_label_placement = rgar($form, 'subLabelPlacement');
$field_sub_label_placement = $this->subLabelPlacement;
$is_sub_label_above = $field_sub_label_placement == 'above' || empty($field_sub_label_placement) && $form_sub_label_placement == 'above';
$sub_label_class_attribute = $field_sub_label_placement == 'hidden_label' ? "class='hidden_sub_label'" : '';
$html_input_type = RGFormsModel::is_html5_enabled() ? 'email' : 'text';
$enter_email_field_input = GFFormsModel::get_input($this, $this->id . '');
$confirm_field_input = GFFormsModel::get_input($this, $this->id . '.2');
$enter_email_label = rgar($enter_email_field_input, 'customLabel') != '' ? $enter_email_field_input['customLabel'] : __('Enter Email', 'gravityforms');
$enter_email_label = apply_filters("gform_email_{$form_id}", apply_filters('gform_email', $enter_email_label, $form_id), $form_id);
$confirm_email_label = rgar($confirm_field_input, 'customLabel') != '' ? $confirm_field_input['customLabel'] : __('Confirm Email', 'gravityforms');
$confirm_email_label = apply_filters("gform_email_confirm_{$form_id}", apply_filters('gform_email_confirm', $confirm_email_label, $form_id), $form_id);
$single_placeholder_attribute = $this->get_field_placeholder_attribute();
$enter_email_placeholder_attribute = $this->get_input_placeholder_attribute($enter_email_field_input);
$confirm_email_placeholder_attribute = $this->get_input_placeholder_attribute($confirm_field_input);
if ($is_form_editor) {
$single_style = $this->emailConfirmEnabled ? "style='display:none;'" : '';
$confirm_style = $this->emailConfirmEnabled ? '' : "style='display:none;'";
if ($is_sub_label_above) {
return "<div class='ginput_container ginput_single_email' {$single_style}>\n <input name='input_{$id}' type='{$html_input_type}' class='" . esc_attr($class) . "' disabled='disabled' {$single_placeholder_attribute} />\n <div class='gf_clear gf_clear_complex'></div>\n </div>\n <div class='ginput_complex ginput_container ginput_confirm_email' {$confirm_style} id='{$field_id}_container'>\n <span id='{$field_id}_container' class='ginput_left'>\n <label for='{$field_id}' {$sub_label_class_attribute}>{$enter_email_label}</label>\n <input class='{$class}' type='text' name='input_{$id}' id='{$field_id}' disabled='disabled' {$enter_email_placeholder_attribute}/>\n </span>\n <span id='{$field_id}_2_container' class='ginput_right'>\n <label for='{$field_id}_2' {$sub_label_class_attribute}>{$confirm_email_label}</label>\n <input class='{$class}' type='text' name='input_{$id}_2' id='{$field_id}_2' disabled='disabled' {$confirm_email_placeholder_attribute}/>\n </span>\n <div class='gf_clear gf_clear_complex'></div>\n </div>";
} else {
return "<div class='ginput_container ginput_single_email' {$single_style}>\n <input class='{$class}' name='input_{$id}' type='{$html_input_type}' class='" . esc_attr($class) . "' disabled='disabled' {$single_placeholder_attribute}/>\n <div class='gf_clear gf_clear_complex'></div>\n </div>\n <div class='ginput_complex ginput_container ginput_confirm_email' {$confirm_style} id='{$field_id}_container'>\n <span id='{$field_id}_container' class='ginput_left'>\n <input class='{$class}' type='text' name='input_{$id}' id='{$field_id}' disabled='disabled' {$enter_email_placeholder_attribute}/>\n <label for='{$field_id}' {$sub_label_class_attribute}>{$enter_email_label}</label>\n </span>\n <span id='{$field_id}_2_container' class='ginput_right'>\n <input class='{$class}' type='text' name='input_{$id}_2' id='{$field_id}_2' disabled='disabled' {$confirm_email_placeholder_attribute}/>\n <label for='{$field_id}_2' {$sub_label_class_attribute}>{$confirm_email_label}</label>\n </span>\n <div class='gf_clear gf_clear_complex'></div>\n </div>";
}
} else {
$logic_event = $this->get_conditional_logic_event('keyup');
if ($this->emailConfirmEnabled && !$is_entry_detail) {
$first_tabindex = $this->get_tabindex();
$last_tabindex = $this->get_tabindex();
$email_value = is_array($value) ? esc_attr($value[0]) : $value;
$confirmation_value = is_array($value) ? esc_attr($value[1]) : rgpost('input_' . $this->id . '_2');
$confirmation_disabled = $is_entry_detail ? "disabled='disabled'" : $disabled_text;
if ($is_sub_label_above) {
return "<div class='ginput_complex ginput_container' id='{$field_id}_container'>\n <span id='{$field_id}_container' class='ginput_left'>\n <label for='{$field_id}'>" . $enter_email_label . "</label>\n <input class='{$class}' type='{$html_input_type}' name='input_{$id}' id='{$field_id}' value='" . $email_value . "' {$first_tabindex} {$logic_event} {$disabled_text} {$enter_email_placeholder_attribute}/>\n </span>\n <span id='{$field_id}_2_container' class='ginput_right'>\n <label for='{$field_id}_2' {$sub_label_class_attribute}>{$confirm_email_label}</label>\n <input class='{$class}' type='{$html_input_type}' name='input_{$id}_2' id='{$field_id}_2' value='" . $confirmation_value . "' {$last_tabindex} {$confirmation_disabled} {$confirm_email_placeholder_attribute}/>\n </span>\n <div class='gf_clear gf_clear_complex'></div>\n </div>";
} else {
return "<div class='ginput_complex ginput_container' id='{$field_id}_container'>\n <span id='{$field_id}_container' class='ginput_left'>\n <input class='{$class}' type='{$html_input_type}' name='input_{$id}' id='{$field_id}' value='" . $email_value . "' {$first_tabindex} {$logic_event} {$disabled_text} {$enter_email_placeholder_attribute}/>\n <label for='{$field_id}' {$sub_label_class_attribute}>{$enter_email_label}</label>\n </span>\n <span id='{$field_id}_2_container' class='ginput_right'>\n <input class='{$class}' type='{$html_input_type}' name='input_{$id}_2' id='{$field_id}_2' value='" . $confirmation_value . "' {$last_tabindex} {$confirmation_disabled} {$confirm_email_placeholder_attribute}/>\n <label for='{$field_id}_2' {$sub_label_class_attribute}>{$confirm_email_label}</label>\n </span>\n <div class='gf_clear gf_clear_complex'></div>\n </div>";
}
} else {
$tabindex = $this->get_tabindex();
$value = esc_attr($value);
$class = esc_attr($class);
return "<div class='ginput_container'>\n <input name='input_{$id}' id='{$field_id}' type='{$html_input_type}' value='{$value}' class='{$class}' {$tabindex} {$logic_event} {$disabled_text} {$single_placeholder_attribute}/>\n </div>";
}
}
}
示例14: tearDown
public function tearDown()
{
parent::tearDown();
/*
* Uninstall Gravity Forms
*/
RGFormsModel::drop_tables();
}
示例15: get_makerfaire_status_counts
function get_makerfaire_status_counts($form_id)
{
global $wpdb;
$lead_details_table_name = RGFormsModel::get_lead_details_table_name();
$sql = $wpdb->prepare("SELECT count(0) as entries,value as label FROM {$lead_details_table_name}\n\t\t\t join wp_rg_lead lead \n on lead.id = {$lead_details_table_name}.lead_id and \n lead.status = 'active'\n where field_number='303'\n\t\t\tand {$lead_details_table_name}.form_id=%d\n\t\t\tgroup by value", $form_id);
$results = $wpdb->get_results($sql, ARRAY_A);
return $results;
}