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


PHP GFFormDisplay::get_form_init_scripts方法代码示例

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


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

示例1: getFormInitScripts

function getFormInitScripts()
{
    if (intval(get_query_var('getFormInitScripts')) != '') {
        require_once GFCommon::get_base_path() . '/form_display.php';
        $form = GFAPI::get_form(get_query_var('getFormInitScripts'));
        $field_values = array();
        // the array of parameter names and values if any fields are being populated
        GFFormDisplay::register_form_init_scripts($form, $field_values);
        $form_string = GFFormDisplay::get_form_init_scripts($form);
        echo strip_tags($form_string);
        exit;
    }
}
开发者ID:afgarcia86,项目名称:react-wordpress-theme-boilerplate,代码行数:13,代码来源:functions.php

示例2: output_scripts

 public static function output_scripts()
 {
     if (self::$allowed_edit === false) {
         /*
          * TODO add error log message here 
          */
         return '';
     }
     echo GFFormDisplay::get_form_init_scripts(self::$form);
     echo '<script type="text/javascript"> jQuery(document).ready(function() { jQuery(document).trigger("gform_post_render", ' . self::$form['id'] . '); }); </script>';
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:11,代码来源:entry-edit-logic.php

示例3: entry_detail_grid

    /**
     * @param $form
     * @param $entry
     * @param bool|false $allow_display_empty_fields
     * @param array $editable_fields
     * @param Gravity_Flow_Step|null $current_step
     */
    public static function entry_detail_grid($form, $entry, $allow_display_empty_fields = false, $editable_fields = array(), $current_step = null)
    {
        $form_id = absint($form['id']);
        $display_empty_fields = false;
        if ($allow_display_empty_fields) {
            $display_empty_fields = rgget('gf_display_empty_fields', $_COOKIE);
        }
        $display_empty_fields = (bool) apply_filters('gravityflow_entry_detail_grid_display_empty_fields', $display_empty_fields, $form, $entry);
        $condtional_logic_enabled = $current_step && $current_step->conditional_logic_editable_fields_enabled;
        self::register_form_init_scripts($form, array(), $condtional_logic_enabled);
        if (apply_filters('gform_init_scripts_footer', false)) {
            add_action('wp_footer', create_function('', 'GFFormDisplay::footer_init_scripts(' . $form['id'] . ');'), 20);
            add_action('gform_preview_footer', create_function('', 'GFFormDisplay::footer_init_scripts(' . $form['id'] . ');'));
        } else {
            echo GFFormDisplay::get_form_init_scripts($form);
            $current_page = 1;
            $scripts = "<script type='text/javascript'>" . apply_filters('gform_cdata_open', '') . " jQuery(document).ready(function(){jQuery(document).trigger('gform_post_render', [{$form_id}, {$current_page}]) } ); " . apply_filters('gform_cdata_close', '') . '</script>';
            echo $scripts;
        }
        ?>

		<input type="hidden" name="action" id="action" value="" />
			<input type="hidden" name="save" id="action" value="Update" />
		<input type="hidden" name="screen_mode" id="screen_mode" value="<?php 
        echo esc_attr(rgpost('screen_mode'));
        ?>
" />

		<table cellspacing="0" class="widefat fixed entry-detail-view">
			<thead>
			<tr>
				<th id="details">
					<?php 
        $title = sprintf('%s : %s %s', esc_html($form['title']), __('Entry # ', 'gravityflow'), absint($entry['id']));
        echo apply_filters('gravityflow_title_entry_detail', $title, $form, $entry);
        ?>
				</th>
				<th style="width:140px; font-size:10px; text-align: right;">
					<?php 
        if ($allow_display_empty_fields) {
            ?>
						<input type="checkbox" id="gentry_display_empty_fields" <?php 
            echo $display_empty_fields ? "checked='checked'" : '';
            ?>
 onclick="ToggleShowEmptyFields();" />&nbsp;&nbsp;
						<label for="gentry_display_empty_fields"><?php 
            _e('show empty fields', 'gravityflow');
            ?>
</label>
					<?php 
        }
        ?>
				</th>
			</tr>
			</thead>
			<tbody class="<?php 
        echo GFCommon::get_ul_classes($form);
        ?>
">
			<?php 
        $count = 0;
        $field_count = sizeof($form['fields']);
        $has_product_fields = false;
        $display_fields_mode = $current_step ? $current_step->display_fields_mode : 'all_fields';
        $display_fields_selected = $current_step && is_array($current_step->display_fields_selected) ? $current_step->display_fields_selected : array();
        foreach ($form['fields'] as &$field) {
            /* @var GF_Field $field */
            $display_field = true;
            if ($display_fields_mode == 'selected_fields') {
                if (!in_array($field->id, $display_fields_selected)) {
                    $display_field = false;
                }
            } else {
                if (GFFormsModel::is_field_hidden($form, $field, array(), $entry)) {
                    $display_field = false;
                }
            }
            $display_field = (bool) apply_filters('gravityflow_workflow_detail_display_field', $display_field, $field, $form, $entry, $current_step);
            switch (RGFormsModel::get_input_type($field)) {
                case 'section':
                    if (!GFCommon::is_section_empty($field, $form, $entry) || $display_empty_fields) {
                        $count++;
                        $is_last = $count >= $field_count ? true : false;
                        ?>
							<tr>
								<td colspan="2" class="entry-view-section-break<?php 
                        echo $is_last ? ' lastrow' : '';
                        ?>
"><?php 
                        echo esc_html(rgar($field, 'label'));
                        ?>
</td>
							</tr>
//.........这里部分代码省略.........
开发者ID:jakejackson1,项目名称:gravityflow,代码行数:101,代码来源:class-entry-detail.php


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