當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。