当前位置: 首页>>代码示例>>PHP>>正文


PHP GFCommon::get_field_input方法代码示例

本文整理汇总了PHP中GFCommon::get_field_input方法的典型用法代码示例。如果您正苦于以下问题:PHP GFCommon::get_field_input方法的具体用法?PHP GFCommon::get_field_input怎么用?PHP GFCommon::get_field_input使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GFCommon的用法示例。


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

示例1: lead_detail_edit

    public static function lead_detail_edit($form, $lead)
    {
        $form = apply_filters('gform_admin_pre_render_' . $form['id'], apply_filters('gform_admin_pre_render', $form));
        $form_id = absint($form['id']);
        ?>
		<div class="postbox">
			<h3>
				<label for="name"><?php 
        esc_html_e('Details', 'gravityforms');
        ?>
</label>
			</h3>

			<div class="inside">
				<table class="form-table entry-details">
					<tbody>
					<?php 
        foreach ($form['fields'] as $field) {
            $field_id = $field->id;
            switch (RGFormsModel::get_input_type($field)) {
                case 'section':
                    ?>
								<tr valign="top">
									<td class="detail-view">
										<div style="margin-bottom:10px; border-bottom:1px dotted #ccc;">
											<h2 class="detail_gsection_title"><?php 
                    echo esc_html(GFCommon::get_label($field));
                    ?>
</h2>
										</div>
									</td>
								</tr>
								<?php 
                    break;
                case 'captcha':
                case 'html':
                case 'password':
                    //ignore certain fields
                    break;
                default:
                    $value = RGFormsModel::get_lead_field_value($lead, $field);
                    $td_id = 'field_' . $form_id . '_' . $field_id;
                    $td_id = esc_attr($td_id);
                    $content = "<tr valign='top'><td class='detail-view' id='{$td_id}'><label class='detail-label'>" . esc_html(GFCommon::get_label($field)) . '</label>' . GFCommon::get_field_input($field, $value, $lead['id'], $form_id, $form) . '</td></tr>';
                    $content = apply_filters('gform_field_content', $content, $field, $value, $lead['id'], $form['id']);
                    echo $content;
                    break;
            }
        }
        ?>
					</tbody>
				</table>
				<br />

				<div class="gform_footer">
					<input type="hidden" name="gform_unique_id" value="" />
					<input type="hidden" name="gform_uploaded_files" id='gform_uploaded_files_<?php 
        echo absint($form_id);
        ?>
' value="" />
				</div>
			</div>
		</div>
	<?php 
    }
开发者ID:christopherhodges,项目名称:wp-api,代码行数:65,代码来源:entry_detail.php

示例2: get_field_content

 /**
  * @param GF_Field  	$field
  * @param string 		$value
  * @param bool   		$force_frontend_label
  * @param int   		$form_id
  * @param null|array   	$form
  *
  * @return string
  */
 public static function get_field_content($field, $value = '', $force_frontend_label = false, $form_id = 0, $form = null)
 {
     $field_label = $field->get_field_label($form, $value);
     $admin_buttons = $field->get_admin_buttons();
     $input_type = GFFormsModel::get_input_type($field);
     $is_form_editor = GFCommon::is_form_editor();
     $is_entry_detail = GFCommon::is_entry_detail();
     $is_admin = $is_form_editor || $is_entry_detail;
     if ($input_type == 'adminonly_hidden') {
         $field_content = !$is_admin ? '{FIELD}' : sprintf("%s<label class='gfield_label' >%s</label>{FIELD}", $admin_buttons, esc_html($field_label));
     } else {
         $field_content = $field->get_field_content($value, $force_frontend_label, $form);
     }
     if ($input_type == 'creditcard' && !GFCommon::is_ssl() && !$is_admin) {
         $field_content = "<div class='gfield_creditcard_warning_message'><span>" . esc_html__('This page is unsecured. Do not enter a real credit card number! Use this field only for testing purposes. ', 'gravityforms') . '</span></div>' . $field_content;
     }
     $value = $field->get_value_default_if_empty($value);
     $field_content = str_replace('{FIELD}', GFCommon::get_field_input($field, $value, 0, $form_id, $form), $field_content);
     $field_content = apply_filters('gform_field_content', $field_content, $field, $value, 0, $form_id);
     return $field_content;
 }
开发者ID:timk85,项目名称:DIT,代码行数:30,代码来源:form_display.php

示例3: get_field_content

 public static function get_field_content($field, $value = "", $force_frontend_label = false, $form_id = 0)
 {
     $id = $field["id"];
     $size = rgar($field, "size");
     $validation_message = rgget("failed_validation", $field) && !empty($field["validation_message"]) ? sprintf("<div class='gfield_description validation_message'>%s</div>", $field["validation_message"]) : "";
     $duplicate_disabled = array('captcha', 'post_title', 'post_content', 'post_excerpt', 'total', 'shipping', 'creditcard');
     $duplicate_field_link = !in_array($field['type'], $duplicate_disabled) ? "<a class='field_duplicate_icon' id='gfield_duplicate_{$id}' title='" . __("click to duplicate this field", "gravityforms") . "' href='#' onclick='StartDuplicateField(this); return false;'>" . __("Duplicate", "gravityforms") . "</a>" : "";
     $duplicate_field_link = apply_filters("gform_duplicate_field_link", $duplicate_field_link);
     $delete_field_link = "<a class='field_delete_icon' id='gfield_delete_{$id}' title='" . __("click to delete this field", "gravityforms") . "' href='#' onclick='StartDeleteField(this); return false;'>" . __("Delete", "gravityforms") . "</a>";
     $delete_field_link = apply_filters("gform_delete_field_link", $delete_field_link);
     $field_type_title = GFCommon::get_field_type_title($field["type"]);
     $admin_buttons = IS_ADMIN ? "<div class='gfield_admin_icons'><div class='gfield_admin_header_title'>{$field_type_title} : " . __("Field ID", "gravityforms") . " {$field["id"]}</div>" . $delete_field_link . $duplicate_field_link . "<a class='field_edit_icon edit_icon_collapsed' title='" . __("click to edit this field", "gravityforms") . "'>" . __("Edit", "gravityforms") . "</a></div>" : "";
     $field_label = $force_frontend_label ? $field["label"] : GFCommon::get_label($field);
     if (rgar($field, "inputType") == "singleproduct" && !rgempty($field["id"] . ".1", $value)) {
         $field_label = rgar($value, $field["id"] . ".1");
     }
     $field_id = IS_ADMIN || $form_id == 0 ? "input_{$id}" : "input_" . $form_id . "_{$id}";
     $required_div = IS_ADMIN || rgar($field, "isRequired") ? sprintf("<span class='gfield_required'>%s</span>", $field["isRequired"] ? "*" : "") : "";
     $target_input_id = "";
     $is_description_above = rgar($field, "descriptionPlacement") == "above";
     switch (RGFormsModel::get_input_type($field)) {
         case "section":
             $description = self::get_description(rgget("description", $field), "gsection_description");
             $field_content = sprintf("%s<h2 class='gsection_title'>%s</h2>%s", $admin_buttons, esc_html($field_label), $description);
             break;
         case "page":
             //only executed on the form editor in the admin
             $page_label = __("Page Break", "gravityforms");
             $src = GFCommon::get_base_url() . "/images/gf_pagebreak_inline.png";
             $field_content = "{$admin_buttons} <label class='gfield_label'>&nbsp;</label><img src='{$src}' alt='{$page_label}' title='{$page_label}' />";
             break;
         case "adminonly_hidden":
         case "hidden":
         case "html":
             $field_content = !IS_ADMIN ? "{FIELD}" : ($field_content = sprintf("%s<label class='gfield_label' for='%s'>%s</label>{FIELD}", $admin_buttons, $field_id, esc_html($field_label)));
             break;
         case "checkbox":
         case "radio":
             $description = self::get_description(rgget("description", $field), "gfield_description");
             if ($is_description_above) {
                 $field_content = sprintf("%s<label class='gfield_label'>%s%s</label>%s{FIELD}%s", $admin_buttons, esc_html($field_label), $required_div, $description, $validation_message);
             } else {
                 $field_content = sprintf("%s<label class='gfield_label'>%s%s</label>{FIELD}%s%s", $admin_buttons, esc_html($field_label), $required_div, $description, $validation_message);
             }
             break;
         case "name":
             switch (rgar($field, "nameFormat")) {
                 case "simple":
                     $target_input_id = $field_id;
                     break;
                 case "extended":
                     $target_input_id = $field_id . "_2";
                     break;
                 default:
                     $target_input_id = $field_id . "_3";
             }
         case "address":
             if (empty($target_input_id)) {
                 $target_input_id = $field_id . "_1";
             }
         default:
             if (empty($target_input_id)) {
                 $target_input_id = $field_id;
             }
             $description = self::get_description(rgget("description", $field), "gfield_description");
             if ($is_description_above) {
                 $field_content = sprintf("%s<label class='gfield_label' for='%s'>%s%s</label>%s{FIELD}%s", $admin_buttons, $target_input_id, esc_html($field_label), $required_div, $description, $validation_message);
             } else {
                 $field_content = sprintf("%s<label class='gfield_label' for='%s'>%s%s</label>{FIELD}%s%s", $admin_buttons, $target_input_id, esc_html($field_label), $required_div, $description, $validation_message);
             }
             break;
     }
     if (RGFormsModel::get_input_type($field) == "creditcard" && !GFCommon::is_ssl() && !IS_ADMIN) {
         $field_content = "<div class='gfield_creditcard_warning_message'>" . __("This page is unsecured. Do not enter a real credit card number. Use this field only for testing purposes. ", "gravityforms") . "</div>" . $field_content;
     }
     $value = self::default_if_empty($field, $value);
     $field_content = str_replace("{FIELD}", GFCommon::get_field_input($field, $value, 0, $form_id), $field_content);
     $field_content = apply_filters("gform_field_content", $field_content, $field, $value, 0, $form_id);
     return $field_content;
 }
开发者ID:pwillems,项目名称:mimosa-contents,代码行数:80,代码来源:form_display.php

示例4: lead_detail_edit

    public static function lead_detail_edit($form, $lead)
    {
        $form = apply_filters("gform_admin_pre_render_" . $form["id"], apply_filters("gform_admin_pre_render", $form));
        ?>
        <script type="text/javascript" src="<?php 
        echo GFCommon::get_base_url();
        ?>
/js/gravityforms.js?version=<?php 
        echo GFCommon::$version;
        ?>
"></script>
        <div id="namediv" class="stuffbox">
            <h3>
                <label for="name"><?php 
        _e("Details", "gravityforms");
        ?>
</label>
            </h3>
            <div class="inside">
                <table class="form-table entry-details">
                    <tbody>
                    <?php 
        foreach ($form["fields"] as $field) {
            switch (RGFormsModel::get_input_type($field)) {
                case "section":
                    ?>
                                <tr valign="top">
                                    <td class="detail-view">
                                        <div style="margin-bottom:10px; border-bottom:1px dotted #ccc;"><h2 class="detail_gsection_title"><?php 
                    echo esc_html(GFCommon::get_label($field));
                    ?>
</h2></div>
                                    </td>
                                </tr>
                                <?php 
                    break;
                case "captcha":
                case "html":
                case "password":
                    //ignore certain fields
                    break;
                default:
                    $value = RGFormsModel::get_lead_field_value($lead, $field);
                    $content = "<tr valign='top'><td class='detail-view'><label class='detail-label'>" . esc_html(GFCommon::get_label($field)) . "</label>" . GFCommon::get_field_input($field, $value, $lead["id"]) . "</td></tr>";
                    $content = apply_filters("gform_field_content", $content, $field, $value, $lead["id"], $form["id"]);
                    echo $content;
                    break;
            }
        }
        ?>
                    </tbody>
                </table>
                <br/>
            </div>
        </div>
        <?php 
    }
开发者ID:xeyefex,项目名称:Mixd-WordPress-Framework,代码行数:57,代码来源:entry_detail.php

示例5: lead_detail_edit

    public static function lead_detail_edit($form, $lead)
    {
        $form = apply_filters("gform_admin_pre_render_" . $form["id"], apply_filters("gform_admin_pre_render", $form));
        $form_id = $form["id"];
        ?>
        <div class="postbox">
            <h3>
                <label for="name"><?php 
        _e("Details", "gravityforms");
        ?>
</label>
            </h3>
            <div class="inside">
                <table class="form-table entry-details">
                    <tbody>
                    <?php 
        foreach ($form["fields"] as $field) {
            $field_id = $field["id"];
            switch (RGFormsModel::get_input_type($field)) {
                case "section":
                    ?>
                                <tr valign="top">
                                    <td class="detail-view">
                                        <div style="margin-bottom:10px; border-bottom:1px dotted #ccc;"><h2 class="detail_gsection_title"><?php 
                    echo esc_html(GFCommon::get_label($field));
                    ?>
</h2></div>
                                    </td>
                                </tr>
                                <?php 
                    break;
                case "captcha":
                case "html":
                case "password":
                    //ignore certain fields
                    break;
                default:
                    $value = RGFormsModel::get_lead_field_value($lead, $field);
                    $td_id = "field_" . $form_id . "_" . $field_id;
                    $content = "<tr valign='top'><td class='detail-view' id='{$td_id}'><label class='detail-label'>" . esc_html(GFCommon::get_label($field)) . "</label>" . GFCommon::get_field_input($field, $value, $lead["id"]) . "</td></tr>";
                    $content = apply_filters("gform_field_content", $content, $field, $value, $lead["id"], $form["id"]);
                    echo $content;
                    break;
            }
        }
        ?>
                    </tbody>
                </table>
                <br/>
                <div class="gform_footer">
                    <input type="hidden" name="gform_unique_id" value="" />
                    <input type="hidden" name="gform_uploaded_files" id='gform_uploaded_files_<?php 
        echo $form_id;
        ?>
' value="" />
                </div>
            </div>
        </div>
        <?php 
    }
开发者ID:JSpier,项目名称:smacamp,代码行数:60,代码来源:entry_detail.php

示例6: esc_html

				                                </tr>
				                                <?php 
                break;
            case "captcha":
            case "html":
            case "password":
                //ignore certain fields
                break;
            case "creditcard":
                $content1 = "<tr valign='top'><td class='detail-view'><label class='detail-label'>Credit Card Payment</label></td></tr>";
                echo $content1;
                break;
            default:
                $value = RGFormsModel::get_lead_field_value($lead, $field);
                $td_id = "field_" . $form_id . "_" . $field_id;
                $content = "<tr valign='top'><td class='detail-view' id='{$td_id}'><label class='detail-label'>" . esc_html(GFCommon::get_label($field)) . "</label>" . GFCommon::get_field_input($field, $value, $lead["id"]) . "</td></tr>";
                $content = apply_filters("gform_field_content", $content, $field, $value, $lead["id"], $form["id"]);
                echo $content;
                break;
        }
    }
    ?>
				                    </tbody>
				                </table>
				                <br/>
				                <div class="gform_footer">
				                    <input type="hidden" name="gform_unique_id" value="" />
				                    <input type="hidden" name="gform_uploaded_files" id='gform_uploaded_files_<?php 
    echo $form_id;
    ?>
' value="" />
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:31,代码来源:entry_edit_page.php

示例7: get_field_content

 public static function get_field_content($field, $value = "", $force_frontend_label = false, $form_id = 0)
 {
     $id = $field["id"];
     $size = $field["size"];
     $validation_message = rgget("failed_validation", $field) && !empty($field["validation_message"]) ? sprintf("<div class='gfield_description validation_message'>%s</div>", $field["validation_message"]) : "";
     $delete_field_link = "<a class='field_delete_icon' id='gfield_delete_{$id}' title='" . __("click to delete this field", "gravityforms") . "' href='javascript:void(0);' onclick='StartDeleteField(this);'>" . __("Delete", "gravityforms") . "</a>";
     $delete_field_link = apply_filters("gform_delete_field_link", $delete_field_link);
     $admin_buttons = IS_ADMIN ? $delete_field_link . " <a class='field_edit_icon edit_icon_collapsed' href='javascript:void(0);' title='" . __("click to edit this field", "gravityforms") . "'>" . __("Edit", "gravityforms") . "</a>" : "";
     $field_label = $force_frontend_label ? $field["label"] : GFCommon::get_label($field);
     $field_id = IS_ADMIN || $form_id == 0 ? "input_{$id}" : "input_" . $form_id . "_{$id}";
     $required_div = IS_ADMIN || $field["isRequired"] ? sprintf("<span class='gfield_required'>%s</span>", $field["isRequired"] ? "*" : "") : "";
     $target_input_id = "";
     switch (RGFormsModel::get_input_type($field)) {
         case "section":
             $description = self::get_description(rgget("description", $field), "gsection_description");
             $field_content = sprintf("%s<h2 class='gsection_title'>%s</h2>%s", $admin_buttons, esc_html($field_label), $description);
             break;
         case "page":
             //only executed on the form editor in the admin
             $page_label = __("Page Break", "gravityforms");
             $src = GFCommon::get_base_url() . "/images/gf_pagebreak_inline.png";
             $field_content = "{$admin_buttons} <label class='gfield_label'>&nbsp;</label><img src='{$src}' alt='{$page_label}' title='{$page_label}' />";
             break;
         case "adminonly_hidden":
         case "hidden":
         case "html":
             $field_content = !IS_ADMIN ? "{FIELD}" : ($field_content = sprintf("%s<label class='gfield_label' for='%s'>%s</label>{FIELD}", $admin_buttons, $field_id, esc_html($field_label)));
             break;
         case "checkbox":
         case "radio":
             $description = self::get_description(rgget("description", $field), "gfield_description");
             $field_content = sprintf("%s<label class='gfield_label'>%s%s</label>{FIELD}%s%s", $admin_buttons, esc_html($field_label), $required_div, $description, $validation_message);
             break;
         case "name":
             $target_input_id = $field_id . ".3";
         case "address":
             if (empty($target_input_id)) {
                 $target_input_id = $field_id . "_1";
             }
         default:
             if (empty($target_input_id)) {
                 $target_input_id = $field_id;
             }
             $description = self::get_description(rgget("description", $field), "gfield_description");
             $field_content = sprintf("%s<label class='gfield_label' for='%s'>%s%s</label>{FIELD}%s%s", $admin_buttons, $target_input_id, esc_html($field_label), $required_div, $description, $validation_message);
             break;
     }
     if (empty($value)) {
         $value = IS_ADMIN ? rgget("defaultValue", $field) : GFCommon::replace_variables_prepopulate(rgget("defaultValue", $field));
     }
     $field_content = str_replace("{FIELD}", GFCommon::get_field_input($field, $value, 0, $form_id), $field_content);
     return $field_content;
 }
开发者ID:hypenotic,项目名称:slowfood,代码行数:53,代码来源:form_display.php

示例8: get_field_content

 public static function get_field_content($field, $value = "", $force_frontend_label = false, $form_id = 0)
 {
     $id = $field["id"];
     $size = $field["size"];
     $validation_message = $field["failed_validation"] && !empty($field["validation_message"]) ? sprintf("<div class='gfield_description validation_message'>%s</div>", $field["validation_message"]) : "";
     $delete_field_link = "<a class='field_delete_icon' id='gfield_delete_{$id}' title='" . __("click to delete this field", "gravityforms") . "' href='javascript:void(0);' onclick='StartDeleteField(this);'>" . __("Delete", "gravityforms") . "</a>";
     $delete_field_link = apply_filters("gform_delete_field_link", $delete_field_link);
     $admin_buttons = IS_ADMIN ? $delete_field_link . " <a class='field_edit_icon edit_icon_collapsed' href='javascript:void(0);' title='" . __("click to edit this field", "gravityforms") . "'>" . __("Edit", "gravityforms") . "</a>" : "";
     $field_label = $force_frontend_label ? $field["label"] : GFCommon::get_label($field);
     $field_id = IS_ADMIN || $form_id == 0 ? "input_{$id}" : "input_" . $form_id . "_{$id}";
     $required_div = IS_ADMIN || $field["isRequired"] ? sprintf("<span class='gfield_required'>%s</span>", $field["isRequired"] ? "*" : "") : "";
     switch (RGFormsModel::get_input_type($field)) {
         case "section":
             $description = self::get_description($field["description"], "gsection_description");
             $field_content = sprintf("%s<h2 class='gsection_title'>%s</h2>%s", $admin_buttons, esc_html($field_label), $description);
             break;
         case "adminonly_hidden":
         case "hidden":
             $field_content = !IS_ADMIN ? "{FIELD}" : ($field_content = sprintf("%s<label class='gfield_label' for='%s'>%s</label>{FIELD}", $admin_buttons, $field_id, esc_html($field_label)));
             break;
         default:
             $description = self::get_description($field["description"], "gfield_description");
             $field_content = sprintf("%s<label class='gfield_label' for='%s'>%s%s</label>{FIELD}%s%s", $admin_buttons, $field_id, esc_html($field_label), $required_div, $description, $validation_message);
             break;
     }
     if (empty($value)) {
         $value = IS_ADMIN ? $field["defaultValue"] : GFCommon::replace_variables_prepopulate($field["defaultValue"]);
     }
     $field_content = str_replace("{FIELD}", GFCommon::get_field_input($field, $value, 0, $form_id), $field_content);
     return $field_content;
 }
开发者ID:812studio,项目名称:812studio,代码行数:31,代码来源:form_display.php

示例9: prso_theme_gform_field_content

function prso_theme_gform_field_content($content, $field, $value, $lead_id, $form_id)
{
    $force_frontend_label = false;
    if (!is_admin()) {
        $id = $field["id"];
        //Cache validation message html
        ob_start();
        ?>
			<div class='row'>
				<div class='<?php 
        echo apply_filters('prso_theme_gform_validation_wrapper_class', 'large-12 columns', $field, $form_id);
        ?>
'>
					<small class='error gfield_description validation_message'>%s</small>
				</div>
			</div>
			<?php 
        $validation_message = ob_get_contents();
        ob_end_clean();
        $validation_message = rgget("failed_validation", $field) && !empty($field["validation_message"]) ? sprintf($validation_message, $field["validation_message"]) : "";
        $field_label = $force_frontend_label ? $field["label"] : GFCommon::get_label($field);
        if (rgar($field, "inputType") == "singleproduct" && !rgempty($field["id"] . ".1", $value)) {
            $field_label = rgar($value, $field["id"] . ".1");
        }
        $field_id = IS_ADMIN || $form_id == 0 ? "input_{$id}" : "input_" . $form_id . "_{$id}";
        $target_input_id = "";
        $required_div = IS_ADMIN || rgar($field, "isRequired") ? sprintf("<span class='gfield_required'>%s</span>", $field["isRequired"] ? "*" : "") : "";
        $is_description_above = rgar($field, "descriptionPlacement") == "above";
        $admin_buttons = IS_ADMIN ? "<div class='gfield_admin_icons'><div class='gfield_admin_header_title'>{$field_type_title} : " . __("Field ID", "gravityforms") . " {$field["id"]}</div>" . $delete_field_link . $duplicate_field_link . "<a class='field_edit_icon edit_icon_collapsed' title='" . __("click to edit this field", "gravityforms") . "'>" . __("Edit", "gravityforms") . "</a></div>" : "";
        if (empty($target_input_id)) {
            $target_input_id = $field_id;
        }
        //Field Description
        $description = '';
        if ($is_description_above) {
            $field_content = sprintf("%s<label class='gfield_label' for='%s'>%s%s</label>%s{FIELD}%s", $admin_buttons, $target_input_id, esc_html($field_label), $required_div, $description, $validation_message);
        } else {
            $field_content = sprintf("%s<label class='gfield_label' for='%s'>%s%s</label>{FIELD}%s%s", $admin_buttons, $target_input_id, esc_html($field_label), $required_div, $description, $validation_message);
        }
        //Detect if field type is text or address and call the required function to get field content
        if ($field['type'] === 'address') {
            $content = str_replace("{FIELD}", prso_theme_gform_get_address_field($field, $value, 0, $form_id), $field_content);
        } elseif ($field['type'] === 'name') {
            $content = str_replace("{FIELD}", prso_theme_gform_get_name_field($field, $value, 0, $form_id), $field_content);
        } elseif ($field['type'] === 'website') {
            $content = str_replace("{FIELD}", prso_theme_gform_get_website_field($field, $value, 0, $form_id), $field_content);
        } elseif ($field['type'] === 'email') {
            $content = str_replace("{FIELD}", prso_theme_gform_get_email_field($field, $value, 0, $form_id), $field_content);
        } elseif ($field['type'] === 'text') {
            $content = str_replace("{FIELD}", prso_theme_gform_get_text_field($field, $value, 0, $form_id), $field_content);
        } else {
            $content = str_replace("{FIELD}", GFCommon::get_field_input($field, $value, 0, $form_id), $field_content);
        }
    }
    return $content;
}
开发者ID:exeQutor,项目名称:prso-gravityforms-foundation-5,代码行数:56,代码来源:core.prso-gravityforms-foundation-5.php

示例10: read_only_input

 public function read_only_input($input_html, $field, $value, $entry_id, $form_id)
 {
     $input_type = RGFormsModel::get_input_type($field);
     if (in_array($input_type, $this->unsupported_field_types) || !rgar($field, $this->key('enable'))) {
         return $input_html;
     }
     remove_filter('gform_field_input', array($this, 'read_only_input'), 11, 5);
     $input_html = GFCommon::get_field_input($field, $value, $entry_id, $form_id, GFAPI::get_form($form_id));
     switch ($input_type) {
         case 'textarea':
         case 'post_content':
         case 'post_excerpt':
             $search = "<textarea";
             $replace = $search . " readonly='readonly'";
             break;
         case 'multiselect':
         case 'select':
             $search = "<select";
             $replace = $search . " disabled='disabled'";
             break;
         case 'radio':
         case 'checkbox':
             $search = "<input";
             $replace = $search . " disabled='disabled'";
             break;
         default:
             $search = "<input";
             $replace = $search . " readonly='readonly'";
             break;
     }
     $input_html = str_replace($search, $replace, $input_html);
     // add hidden capture input markup for disabled field types
     if (in_array($input_type, $this->disable_attr_field_types)) {
         $value = $this->get_field_value($field);
         $hc_input_markup = '';
         if (is_array($field['inputs'])) {
             foreach ($field['inputs'] as $input) {
                 $input_id_bits = explode('.', $input['id']);
                 $hc_input_id = sprintf('gwro_hidden_capture_%d_%d_%d', $form_id, $field['id'], array_pop($input_id_bits));
                 $hc_input_markup .= sprintf('<input type="hidden" id="%s" name="%s" value="%s" />', $hc_input_id, $hc_input_id, rgar($value, (string) $input['id']));
             }
         } else {
             $hc_input_id = sprintf('gwro_hidden_capture_%d_%d', $form_id, $field['id']);
             $hc_input_markup = sprintf('<input type="hidden" id="%s" name="%s" value="%s" />', $hc_input_id, $hc_input_id, $value);
         }
         $input_html .= $hc_input_markup;
     }
     add_filter('gform_field_input', array($this, 'read_only_input'), 11, 5);
     return $input_html;
 }
开发者ID:hansstam,项目名称:makerfaire,代码行数:50,代码来源:gwreadonly.php


注:本文中的GFCommon::get_field_input方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。