本文整理匯總了PHP中GFFormDisplay::get_field_content方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFFormDisplay::get_field_content方法的具體用法?PHP GFFormDisplay::get_field_content怎麽用?PHP GFFormDisplay::get_field_content使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GFFormDisplay
的用法示例。
在下文中一共展示了GFFormDisplay::get_field_content方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: change_input_type
public static function change_input_type()
{
check_ajax_referer('rg_change_input_type', 'rg_change_input_type');
$field_json = stripslashes_deep($_POST["field"]);
$field = GFCommon::json_decode($field_json, true);
$id = $field["id"];
$type = $field["inputType"];
require_once GFCommon::get_base_path() . "/form_display.php";
$field_content = GFFormDisplay::get_field_content($field, "");
die("EndChangeInputType('{$id}', '{$type}', \"{$field_content}\");");
}
示例2: refresh_field_preview
public static function refresh_field_preview()
{
check_ajax_referer('rg_refresh_field_preview', 'rg_refresh_field_preview');
$field_json = stripslashes_deep($_POST['field']);
$field_properties = GFCommon::json_decode($field_json, true);
$field = GF_Fields::create($field_properties);
$form_id = absint($_POST['formId']);
$form = GFFormsModel::get_form_meta($form_id);
require_once GFCommon::get_base_path() . '/form_display.php';
$field_content = GFFormDisplay::get_field_content($field, '', true, $form_id, $form);
$args['fieldString'] = $field_content;
$args_json = json_encode($args);
die($args_json);
}
示例3: show_edit_form
//.........這裏部分代碼省略.........
switch (RGFormsModel::get_input_type($field)) {
case "captcha":
case "html":
case "password":
case "product":
case "coupon":
case "quantity":
case "shipping":
case "donation":
case "total":
case "singleproduct":
case "hiddenproduct":
case "singleshipping":
case "creditcard":
case "page":
case "post_image":
case "fileupload":
//ignore certain fields
continue;
break;
default:
if (isset($field['productField']) && (int) $field['productField'] > 0 || $field['type'] == 'shipping') {
continue;
}
/*
* Ensure our restricted field values stay the same (as they aren't push through the $_POST data)
*/
if (in_array($field_id, $this->atts['restricted_fields'])) {
$value = RGFormsModel::get_lead_field_value($lead, $field);
} else {
/*
* Check if we have POST data, or whether we pull the details from the entry itself
* This is useful when the validation fails
*/
$value = $is_postback ? RGFormsModel::get_field_value($field) : RGFormsModel::get_lead_field_value($lead, $field);
}
$id = "field_" . $form['id'] . "_" . $field_id;
/* $content = " <li id='{$id}' class='$css_class' $style><label class='detail-label'>" . esc_html(GFCommon::get_label($field)) . "</label>" .
GFCommon::get_field_input($field, $value, $lead["id"], $form['id']) . "</li>";
$content = apply_filters("gform_field_content", $content, $field, $value, self::$lead["id"], self::$form["id"]);*/
//$content = "<li id='{$id}' class='$css_class' $style>" . GFFormDisplay::get_field_content($field, $value, true, $form['id']) . '</li>';
$field_content = GFFormDisplay::get_field_content($field, $value, true, $form['id']);
$field_container = "<li id='{$id}' class='{$css_class}' {$style}>{FIELD_CONTENT}</li>";
$field_container = apply_filters('gform_field_container', $field_container, $field, $form, $css_class, $style, $field_content);
$field_container = apply_filters("gform_field_container_{$form['id']}", $field_container, $field, $form, $css_class, $style, $field_content);
$field_container = apply_filters("gform_field_container_{$form['id']}_{$field['id']}", $field_container, $field, $form, $css_class, $style, $field_content);
$field_markup = str_replace('{FIELD_CONTENT}', $field_content, $field_container);
if (in_array($field_id, $this->atts['restricted_fields'])) {
$field_markup = str_replace('<input', '<input disabled', $field_markup);
$field_markup = str_replace('<textarea', '<textarea disabled', $field_markup);
}
echo $field_markup;
break;
}
}
$field_values_str = is_array($field_values) ? http_build_query($field_values) : $field_values;
?>
<input type='hidden' class='gform_hidden' name='is_submit_<?php
echo $form['id'];
?>
' value='1' />
<input type='hidden' class='gform_hidden' name='gform_submit' value='<?php
echo $form['id'];
?>
' />
<input type='hidden' class='gform_hidden' name='gform_unique_id' value='<?php
echo esc_attr(GFFormsModel::get_form_unique_id($form['id']));
?>
' />
<input type='hidden' class='gform_hidden' name='state_<?php
echo $form['id'];
?>
' value='<?php
GFFormDisplay::get_state($form, $field_values);
?>
' />
<input type='hidden' name='gform_field_values' value='<?php
echo esc_attr($field_values_str);
?>
' />
<?php
$button_input = self::get_form_button($form["id"], "gform_submit_button_{$form["id"]}", $form["button"], __("Submit", "gravityforms"), "button gform_button", __("Submit", "gravityforms"));
echo $button_input;
?>
</ul>
</div>
</div>
</form>
</div>
<?php
$html = ob_get_contents();
ob_end_clean();
return $html;
}