本文整理汇总了PHP中RGFormsModel类的典型用法代码示例。如果您正苦于以下问题:PHP RGFormsModel类的具体用法?PHP RGFormsModel怎么用?PHP RGFormsModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RGFormsModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:brutalenemy666,项目名称:wp-utils,代码行数:15,代码来源:functions.php
示例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;
}
开发者ID:wp-pay-extensions,项目名称:gravityforms,代码行数:35,代码来源:Util.php
示例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;
}
开发者ID:mgratch,项目名称:GravityView,代码行数:40,代码来源:class-gravityview-field-post-category.php
示例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'));
}
开发者ID:nickwoodland,项目名称:armorduct,代码行数:25,代码来源:cmbs-partners.php
示例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;
}
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:29,代码来源:gform_add_entry.php
示例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);
}
开发者ID:Garth619,项目名称:Femi9,代码行数:38,代码来源:class-gf-field-phone.php
示例7: run
public function run($arguments)
{
if (class_exists('RGFormsModel') && is_callable(array('RGFormsModel', 'get_forms'))) {
return RGFormsModel::get_forms();
}
return false;
}
开发者ID:jimlongo56,项目名称:rdiv,代码行数:7,代码来源:get-gf-forms.php
示例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();
}
}
开发者ID:hansstam,项目名称:makerfaire,代码行数:25,代码来源:GSP.php
示例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);
}
开发者ID:Garth619,项目名称:Femi9,代码行数:33,代码来源:class-gf-field-select.php
示例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;
}
开发者ID:daanbakker1995,项目名称:vanteun,代码行数:69,代码来源:Fields.php
示例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();
}
}
开发者ID:hansstam,项目名称:makerfaire,代码行数:25,代码来源:FSP.php
示例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;
}
开发者ID:kevwaddell,项目名称:motopro-desktop,代码行数:34,代码来源:gravity_forms_functions.php
示例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>";
}
}
}
开发者ID:anucha-digitalnoir,项目名称:freighthub-logistic,代码行数:59,代码来源:class-gf-field-email.php
示例14: tearDown
public function tearDown()
{
parent::tearDown();
/*
* Uninstall Gravity Forms
*/
RGFormsModel::drop_tables();
}
开发者ID:hirenbhut93,项目名称:gravity-pdf,代码行数:8,代码来源:test-pdf-model.php
示例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;
}
开发者ID:hansstam,项目名称:makerfaire,代码行数:8,代码来源:functions.php
示例16: render_field
/**
* render_field()
*
* Create the HTML interface for your field
*
* @param $field (array) the $field being rendered
*
* @type action
* @since 3.6
* @date 23/01/13
*
* @param $field (array) the $field being edited
* @return n/a
*/
function render_field($field)
{
$field = array_merge($this->defaults, $field);
$choices = array();
if (class_exists('RGFormsModel')) {
$forms = RGFormsModel::get_forms(1);
} else {
echo '<font style="color:red; font-weight:bold;">Warning: Gravity Forms is not installed or activated. This field does not function without Gravity Forms!</font>';
}
if (isset($forms)) {
foreach ($forms as $form) {
$choices[intval($form->id)] = ucfirst($form->title);
}
}
$field['choices'] = $choices;
$field['type'] = 'select';
$multiple = '';
if ($field['allow_multiple']) {
$multiple = 'multiple="multiple" data-multiple="1"';
echo '<input type="hidden" name="' . $field['name'] . '">';
}
?>
<select id="<?php
echo str_replace(array('[', ']'), array('-', ''), $field['name']);
?>
" name="<?php
echo $field['name'] . ($field['allow_multiple'] ? '[]' : '');
?>
" <?php
echo $multiple;
?>
>
<?php
if ($field['allow_null']) {
?>
<option value="">Select ...</option>
<?php
}
?>
<?php
foreach ($field['choices'] as $key => $value) {
?>
<option value="<?php
echo $key;
?>
" <?php
echo (is_array($field['value']) && in_array($key, $field['value']) or $field['value'] == $key) ? 'selected="selected"' : '';
?>
><?php
echo $value;
?>
</option>
<?php
}
?>
</select>
<?php
}
开发者ID:baringji,项目名称:Gravity-Forms-ACF-Field,代码行数:72,代码来源:gravity_forms-v5.php
示例17: gfuea_clean_zips
function gfuea_clean_zips($confirmation, $form, $entry, $ajax)
{
$upload_root = RGFormsModel::get_upload_root();
$filename = $upload_root . "/uploaded_files" . $entry['id'] . ".zip";
if (is_file($filename)) {
unlink($filename);
}
return $confirmation;
}
开发者ID:WPCMSNinja,项目名称:gf-upload-to-email-attachment,代码行数:9,代码来源:gf-upload-to-email-attachment.php
示例18: _get_form_strings
function _get_form_strings($form_id)
{
$form = RGFormsModel::get_form_meta($form_id, true);
$form = RGFormsModel::add_default_properties($form);
$string_data = array();
$form_keys = array('title', 'description', 'limitEntriesMessage', 'scheduleMessage', 'postTitleTemplate', 'postContentTemplate', 'confirmation-message', 'autoResponder-subject', 'autoResponder-message', 'button-text');
foreach ($form_keys as $key) {
$parts = explode('-', $key);
if (sizeof($parts) == 1) {
if (isset($form[$key]) && $form[$key] != '') {
$string_data[$key] = $form[$key];
}
} else {
if (isset($form[$parts[0]][$parts[1]]) && $form[$parts[0]][$parts[1]] != '') {
$string_data[$key] = $form[$parts[0]][$parts[1]];
}
}
}
///- Paging Page Names - $form["pagination"]["pages"][i]
$keys = array('label', 'description', 'defaultValue', 'errorMessage');
foreach ($form['fields'] as $id => $field) {
foreach ($keys as $key) {
if (isset($field[$key]) && $field[$key] != '') {
$string_data['field-' . $field['id'] . '-' . $key] = $field[$key];
}
}
switch ($field['type']) {
case 'text':
case 'textarea':
case 'email':
case 'number':
case 'section':
break;
case 'html':
$string_data['field-' . $field['id'] . '-content'] = $field['content'];
break;
case 'page':
$string_data['field-' . $field['id'] . '-nextButton'] = $field['nextButton']['text'];
$string_data['field-' . $field['id'] . '-previousButton'] = $field['previousButton']['text'];
break;
case 'select':
case 'checkbox':
case 'radio':
case 'product':
if (isset($field['choices']) && is_array($field['choices'])) {
foreach ($field['choices'] as $index => $choice) {
$string_data['field-' . $field['id'] . '-choice-' . $choice['value']] = $choice['text'];
}
}
break;
case 'post_custom_field':
$string_data['field-' . $field['id'] . '-customFieldTemplate'] = $field["customFieldTemplate"];
break;
}
}
return $string_data;
}
开发者ID:envickery,项目名称:staging.xylemwatermark.org,代码行数:57,代码来源:gravity_forms_multilingual.class.php
示例19: get_forms
function get_forms()
{
$forms = RGFormsModel::get_forms();
$options = array('' => '– Select a Form –');
foreach ($forms as $form) {
$options[$form->id] = $form->title;
}
return $options;
}
开发者ID:danaiser,项目名称:hollandLawns,代码行数:9,代码来源:gravity-forms.php
示例20: 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();
$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_sub_label_placement = rgar($form, 'subLabelPlacement');
$field_sub_label_placement = rgar($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'" : '';
$disabled_text = $is_form_editor ? "disabled='disabled'" : '';
$hour = $minute = $am_selected = $pm_selected = '';
if (!is_array($value) && !empty($va
|
请发表评论