本文整理汇总了PHP中GFFormDisplay::has_field_input_mask方法的典型用法代码示例。如果您正苦于以下问题:PHP GFFormDisplay::has_field_input_mask方法的具体用法?PHP GFFormDisplay::has_field_input_mask怎么用?PHP GFFormDisplay::has_field_input_mask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFFormDisplay
的用法示例。
在下文中一共展示了GFFormDisplay::has_field_input_mask方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_field_input
//.........这里部分代码省略.........
$form = RGFormsModel::get_form_meta($form_id);
$has_quantity_field = sizeof(GFCommon::get_product_fields_by_type($form, array("quantity"), $field["id"])) > 0;
$product_name = !is_array($value) || empty($value[$field["id"] . ".1"]) ? esc_attr($field["label"]) : esc_attr($value[$field["id"] . ".1"]);
$quantity = is_array($value) ? esc_attr($value[$field["id"] . ".3"]) : "";
$price = !is_array($value) || empty($value[$field["id"] . ".2"]) ? rgget("basePrice", $field) : esc_attr($value[$field["id"] . ".2"]);
if (empty($price)) {
$price = 0;
}
$quantity_field = $has_quantity_field ? "" : "<input type='hidden' name='input_{$id}.3' value='1' class='ginput_quantity_{$form_id}_{$field["id"]} gform_hidden' />";
$product_name_field = "<input type='hidden' name='input_{$id}.1' value='{$product_name}' class='gform_hidden' />";
$field_type = IS_ADMIN ? "text" : "hidden";
return $quantity_field . $product_name_field . sprintf("<input name='input_%d.2' id='ginput_base_price_{$form_id}_{$field["id"]}' type='{$field_type}' value='%s' class='gform_hidden ginput_amount' %s/>", $id, esc_attr($price), $disabled_text);
break;
case "singleshipping":
$price = !empty($value) ? $value : rgget("basePrice", $field);
if (empty($price)) {
$price = 0;
}
return "<div class='ginput_container'><input type='hidden' name='input_{$id}' value='{$price}' class='gform_hidden'/><span class='ginput_shipping_price' id='{$field_id}'>" . GFCommon::to_money($price, $currency) . "</span></div>";
break;
case "website":
$is_html5 = RGFormsModel::is_html5_enabled();
$value = empty($value) && !$is_html5 ? "http://" : $value;
$html_input_type = $is_html5 ? "url" : "text";
$html5_attributes = $is_html5 ? "placeholder='http://'" : "";
case "text":
if (empty($html_input_type)) {
$html_input_type = "text";
}
if (rgget("enablePasswordInput", $field) && RG_CURRENT_VIEW != "entry") {
$html_input_type = "password";
}
$input_mask_script = "";
if (!IS_ADMIN && GFFormDisplay::has_field_input_mask($field)) {
$input_mask_script = self::get_input_mask_script($form_id, $field_id, $field["inputMaskValue"]);
}
if (is_numeric(rgget("maxLength", $field))) {
$max_length = "maxlength='{$field["maxLength"]}'";
}
if (!empty($post_link)) {
return $post_link;
}
$tabindex = self::get_tabindex();
return sprintf("<div class='ginput_container'><input name='input_%d' id='%s' type='%s' value='%s' class='%s' {$max_length} {$tabindex} {$html5_attributes} %s/></div>{$input_mask_script}", $id, $field_id, $html_input_type, esc_attr($value), esc_attr($class), $disabled_text);
break;
case "email":
if (!empty($post_link)) {
return $post_link;
}
$html_input_type = RGFormsModel::is_html5_enabled() ? "email" : "text";
if (IS_ADMIN && RG_CURRENT_VIEW != "entry") {
$single_style = rgget("emailConfirmEnabled", $field) ? "style='display:none;'" : "";
$confirm_style = rgget("emailConfirmEnabled", $field) ? "" : "style='display:none;'";
return "<div class='ginput_container ginput_single_email' {$single_style}><input name='input_{$id}' type='{$html_input_type}' class='" . esc_attr($class) . "' disabled='disabled' /></div><div class='ginput_complex ginput_container ginput_confirm_email' {$confirm_style} id='{$field_id}_container'><span id='{$field_id}_1_container' class='ginput_left'><input type='text' name='input_{$id}' id='{$field_id}' disabled='disabled' /><label for='{$field_id}'>" . apply_filters("gform_email_{$form_id}", apply_filters("gform_email", __("Enter Email", "gravityforms"), $form_id), $form_id) . "</label></span><span id='{$field_id}_2_container' class='ginput_right'><input type='text' name='input_{$id}_2' id='{$field_id}_2' disabled='disabled' /><label for='{$field_id}_2'>" . apply_filters("gform_email_confirm_{$form_id}", apply_filters("gform_email_confirm", __("Confirm Email", "gravityforms"), $form_id), $form_id) . "</label></span></div>";
} else {
if (rgget("emailConfirmEnabled", $field) && RG_CURRENT_VIEW != "entry") {
$first_tabindex = self::get_tabindex();
$last_tabindex = self::get_tabindex();
return "<div class='ginput_complex ginput_container' id='{$field_id}_container'><span id='{$field_id}_1_container' class='ginput_left'><input type='{$html_input_type}' name='input_{$id}' id='{$field_id}' value='" . esc_attr($value) . "' {$first_tabindex} {$disabled_text}/><label for='{$field_id}'>" . apply_filters("gform_email_{$form_id}", apply_filters("gform_email", __("Enter Email", "gravityforms"), $form_id), $form_id) . "</label></span><span id='{$field_id}_2_container' class='ginput_right'><input type='{$html_input_type}' name='input_{$id}_2' id='{$field_id}_2' value='" . esc_attr(rgpost("input_" . $id . "_2")) . "' {$last_tabindex} {$disabled_text}/><label for='{$field_id}_2'>" . apply_filters("gform_email_confirm_{$form_id}", apply_filters("gform_email_confirm", __("Confirm Email", "gravityforms"), $form_id), $form_id) . "</label></span></div>";
} else {
$tabindex = self::get_tabindex();
return sprintf("<div class='ginput_container'><input name='input_%d' id='%s' type='%s' value='%s' class='%s' {$max_length} {$tabindex} {$html5_attributes} %s/></div>", $id, $field_id, $html_input_type, esc_attr($value), esc_attr($class), $disabled_text);
}
}
break;
case "honeypot":