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


PHP GFCommon::get_lead_field_display方法代码示例

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


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

示例1: output_data

function output_data($pdf, $lead = array(), $form = array(), $fieldData = array())
{
    $pdf->AddPage();
    $dataArray = array(array('Project ID #', 3), array('Project Name', 28), array('Name of person responsible for fire safety at your exhibit', 5), array('Their Email', 15), array('Their phone', 16), array('Description', 19), array('Describe your safety concerns', 12), array('Describe how you plan to keep your exhibit safe', 20), array('Who will be assisting at your exhibit to keep it safe', 11), array('Placement Requirements', 7), array('Do you have Insurance', 9), array('Additional Comments', 13), array('Are you 18 years or older?', 23), array('Signed', 25), array('I am the Parent and/or Legal Guardian of', 26), array('Date', 27));
    $pdf->SetFillColor(190, 210, 247);
    $lineheight = 6;
    foreach ($dataArray as $data) {
        $fieldID = $data[1];
        if (isset($fieldData[$fieldID])) {
            $field = $fieldData[$fieldID];
            $value = RGFormsModel::get_lead_field_value($lead, $field);
            if (RGFormsModel::get_input_type($field) != 'email') {
                $display_value = GFCommon::get_lead_field_display($field, $value);
                $display_value = apply_filters('gform_entry_field_value', $display_value, $field, $lead, $form);
            } else {
                $display_value = $value;
            }
        } else {
            $display_value = '';
        }
        $pdf->MultiCell(0, $lineheight, $data[0] . ': ');
        $pdf->MultiCell(0, $lineheight, $display_value, 0, 'L', true);
        $pdf->Ln();
    }
}
开发者ID:hansstam,项目名称:makerfaire,代码行数:25,代码来源:GSP.php

示例2: output_data

function output_data($pdf, $lead = array(), $form = array(), $fieldData = array())
{
    $pdf->AddPage();
    $dataArray = array(array('Project ID #', 3, 'text'), array('Project Name', 38, 'text'), array('Name of person responsible for fire safety at your exhibit', 21, 'text'), array('Their Email', 23, 'text'), array('Their Phone', 24, 'text'), array('Description', 37, 'textarea'), array('Describe your fire safety concerns', 19, 'textarea'), array('Describe how you plan to keep your exhibit safe', 27, 'textarea'), array('Who will be assisting at your exhibit to keep it safe', 20, 'text'), array('Placement Requirements', 7, 'textarea'), array('What is burning', 10, 'text'), array('What is the fuel source', 11, 'text'), array('how much is fuel is burning and in what time period', 12, 'textarea'), array('how much fuel will you have at the event, including tank sizes', 13, 'textarea'), array('where and how is the fuel stored', 14, 'text'), array('Does the valve have an electronic propane sniffer', 15, 'text'), array('Other suppression devices', 16, 'textarea'), array('Do you have insurance?', 18, 'text'), array('Additional comments', 28, 'textarea'), array('Are you 18 years or older?', 30, 'text'), array('Signed', 32, 'text'), array('I am the Parent and/or Legal Guardian of', 33, 'text'), array('Date', 34, 'text'));
    $pdf->SetFillColor(190, 210, 247);
    $lineheight = 6;
    foreach ($dataArray as $data) {
        $fieldID = $data[1];
        if (isset($fieldData[$fieldID])) {
            $field = $fieldData[$fieldID];
            $value = RGFormsModel::get_lead_field_value($lead, $field);
            if (RGFormsModel::get_input_type($field) != 'email') {
                $display_value = GFCommon::get_lead_field_display($field, $value);
                $display_value = apply_filters('gform_entry_field_value', $display_value, $field, $lead, $form);
            } else {
                $display_value = $value;
            }
        } else {
            $display_value = '';
        }
        $pdf->MultiCell(0, $lineheight, $data[0] . ': ');
        $pdf->MultiCell(0, $lineheight, $display_value, 0, 'L', true);
        $pdf->Ln();
    }
}
开发者ID:hansstam,项目名称:makerfaire,代码行数:25,代码来源:FSP.php

示例3: preview_special_merge_tags

 /**
  * Adds special support for file upload, post image and multi input merge tags.
  */
 public static function preview_special_merge_tags($value, $input_id, $merge_tag, $field)
 {
     // added to prevent overriding :noadmin filter (and other filters that remove fields)
     if (!$value) {
         return $value;
     }
     $input_type = RGFormsModel::get_input_type($field);
     $is_upload_field = in_array($input_type, array('post_image', 'fileupload'));
     $is_multi_input = is_array(rgar($field, 'inputs'));
     $is_input = intval($input_id) != $input_id;
     if (!$is_upload_field && !$is_multi_input) {
         return $value;
     }
     // if is individual input of multi-input field, return just that input value
     if ($is_input) {
         return $value;
     }
     $form = RGFormsModel::get_form_meta($field['formId']);
     $lead = self::create_lead($form);
     $currency = GFCommon::get_currency();
     if (is_array(rgar($field, 'inputs'))) {
         $value = RGFormsModel::get_lead_field_value($lead, $field);
         return GFCommon::get_lead_field_display($field, $value, $currency);
     }
     switch ($input_type) {
         case 'fileupload':
             $value = self::preview_image_value("input_{$field['id']}", $field, $form, $lead);
             $value = self::preview_image_display($field, $form, $value);
             break;
         default:
             $value = self::preview_image_value("input_{$field['id']}", $field, $form, $lead);
             $value = GFCommon::get_lead_field_display($field, $value, $currency);
             break;
     }
     return $value;
 }
开发者ID:wpcampus,项目名称:wpcampus-2016-theme,代码行数:39,代码来源:forms-preview.php

示例4: field_value

 /**
  * Given an entry and a form field id, calculate the entry value for that field.
  *
  * @access public
  * @param array $entry
  * @param array $field
  * @return null|string
  */
 public static function field_value($entry, $field_settings, $format = 'html')
 {
     if (empty($entry['form_id']) || empty($field_settings['id'])) {
         return NULL;
     }
     $gravityview_view = GravityView_View::getInstance();
     $field_id = $field_settings['id'];
     $form = $gravityview_view->getForm();
     $field = gravityview_get_field($form, $field_id);
     if ($field && is_numeric($field_id)) {
         // Used as file name of field template in GV.
         // Don't use RGFormsModel::get_input_type( $field ); we don't care if it's a radio input; we want to know it's a 'quiz' field
         $field_type = $field->type;
         $value = RGFormsModel::get_lead_field_value($entry, $field);
     } else {
         $field = GravityView_Fields::get_associated_field($field_id);
         $field_type = $field_id;
         // Used as file name of field template in GV
     }
     // If a Gravity Forms Field is found, get the field display
     if ($field) {
         // Prevent any PHP warnings that may be generated
         ob_start();
         $display_value = GFCommon::get_lead_field_display($field, $value, $entry["currency"], false, $format);
         if ($errors = ob_get_clean()) {
             do_action('gravityview_log_error', 'GravityView_API[field_value] Errors when calling GFCommon::get_lead_field_display()', $errors);
         }
         $display_value = apply_filters("gform_entry_field_value", $display_value, $field, $entry, $form);
         // prevent the use of merge_tags for non-admin fields
         if (!empty($field->adminOnly)) {
             $display_value = self::replace_variables($display_value, $form, $entry);
         }
     } else {
         $value = $display_value = rgar($entry, $field_id);
         $display_value = $value;
     }
     // Check whether the field exists in /includes/fields/{$field_type}.php
     // This can be overridden by user template files.
     $field_path = $gravityview_view->locate_template("fields/{$field_type}.php");
     // Set the field data to be available in the templates
     $gravityview_view->setCurrentField(array('form' => $form, 'field_id' => $field_id, 'field' => $field, 'field_settings' => $field_settings, 'value' => $value, 'display_value' => $display_value, 'format' => $format, 'entry' => $entry, 'field_type' => $field_type, 'field_path' => $field_path));
     if (!empty($field_path)) {
         do_action('gravityview_log_debug', sprintf('[field_value] Rendering %s', $field_path));
         ob_start();
         load_template($field_path, false);
         $output = ob_get_clean();
     } else {
         // Backup; the field template doesn't exist.
         $output = $display_value;
     }
     // Get the field settings again so that the field template can override the settings
     $field_settings = $gravityview_view->getCurrentField('field_settings');
     /**
      * @filter `gravityview_field_entry_value_{$field_type}_pre_link` Modify the field value output for a field type before Show As Link setting is applied. Example: `gravityview_field_entry_value_number_pre_link`
      * @since 1.16
      * @param string $output HTML value output
      * @param array  $entry The GF entry array
      * @param array  $field_settings Settings for the particular GV field
      * @param array  $field Field array, as fetched from GravityView_View::getCurrentField()
      */
     $output = apply_filters('gravityview_field_entry_value_' . $field_type . '_pre_link', $output, $entry, $field_settings, $gravityview_view->getCurrentField());
     /**
      * Link to the single entry by wrapping the output in an anchor tag
      *
      * Fields can override this by modifying the field data variable inside the field. See /templates/fields/post_image.php for an example.
      *
      */
     if (!empty($field_settings['show_as_link']) && !gv_empty($output, false, false)) {
         $link_atts = empty($field_settings['new_window']) ? array() : array('target' => '_blank');
         $output = self::entry_link_html($entry, $output, $link_atts, $field_settings);
     }
     /**
      * @filter `gravityview_field_entry_value_{$field_type}` Modify the field value output for a field type. Example: `gravityview_field_entry_value_number`
      * @since 1.6
      * @param string $output HTML value output
      * @param array  $entry The GF entry array
      * @param  array $field_settings Settings for the particular GV field
      * @param array $field Current field being displayed
      */
     $output = apply_filters('gravityview_field_entry_value_' . $field_type, $output, $entry, $field_settings, $gravityview_view->getCurrentField());
     /**
      * @filter `gravityview_field_entry_value` Modify the field value output for all field types
      * @param string $output HTML value output
      * @param array  $entry The GF entry array
      * @param  array $field_settings Settings for the particular GV field
      * @param array $field_data  {@since 1.6}
      */
     $output = apply_filters('gravityview_field_entry_value', $output, $entry, $field_settings, $gravityview_view->getCurrentField());
     return $output;
 }
开发者ID:mgratch,项目名称:GravityView,代码行数:98,代码来源:class-api.php

示例5: make_directory


//.........这里部分代码省略.........
                            case "post_content":
                            case "post_excerpt":
                                if ($fulltext) {
                                    $long_text = $value = "";
                                    if (isset($lead[$field_id]) && strlen($lead[$field_id]) >= GFORMS_MAX_FIELD_LENGTH) {
                                        $long_text = get_gf_field_value_long($lead["id"], $field_id);
                                    }
                                    if (isset($lead[$field_id])) {
                                        $value = !empty($long_text) ? $long_text : $lead[$field_id];
                                    }
                                    if ($wpautop) {
                                        $value = wpautop($value);
                                    }
                                } else {
                                    $value = esc_html($value);
                                }
                                break;
                            case "date_created":
                                $value = GFCommon::format_date($value, false, $datecreatedformat);
                                break;
                            case "date":
                                $field = RGFormsModel::get_field($form, $field_id);
                                if ($dateformat) {
                                    $value = GFCommon::date_display($value, $dateformat);
                                } else {
                                    $value = GFCommon::date_display($value, $field["dateFormat"]);
                                }
                                break;
                            case "id":
                                $linkClass = '';
                                break;
                            case "list":
                                $field = RGFormsModel::get_field($form, $field_id);
                                $value = GFCommon::get_lead_field_display($field, $value);
                                break;
                            default:
                                $input_type = 'text';
                                if (is_email($value) && $linkemail) {
                                    $value = "<a href='mailto:{$value}'{$nofollow}>{$value}</a>";
                                } elseif (preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $value) && $linkwebsite) {
                                    $href = $value;
                                    if (!empty($lightboxsettings['images'])) {
                                        if (in_array('urls', $lightboxsettings) || !empty($lightboxsettings['urls'])) {
                                            $lightboxclass .= ' rel="directory_all directory_urls"';
                                        }
                                        $linkClass = $lightboxclass;
                                    } else {
                                        $linkClass = isset($linkClass) ? $linkClass : '';
                                    }
                                    if ($truncatelink) {
                                        $value = apply_filters('kws_gf_directory_anchor_text', $value);
                                    }
                                    $value = "<a href='{$href}'{$nofollow}{$target}{$linkClass}>{$value}</a>";
                                } else {
                                    $value = esc_html($value);
                                }
                        }
                        if ($is_first_column) {
                            echo "\n";
                        }
                        if ($value !== NULL) {
                            if (isset($columns["{$field_id}"]['label']) && $hovertitle || $directoryview !== 'table') {
                                $celltitle = ' title="' . esc_html(apply_filters('kws_gf_directory_th', apply_filters('kws_gf_directory_th_' . $field_id, apply_filters('kws_gf_directory_th_' . sanitize_title($columns["{$field_id}"]['label']), $columns["{$field_id}"]['label'])))) . '"';
                            } else {
                                $celltitle = '';
                            }
开发者ID:rongandat,项目名称:cyarevfoods,代码行数:67,代码来源:gravity-forms-addons.php

示例6: lead_detail_grid

    public static function lead_detail_grid($form, $lead, $allow_display_empty_fields = false)
    {
        $form_id = $form["id"];
        $display_empty_fields = false;
        if ($allow_display_empty_fields) {
            $display_empty_fields = rgget("gf_display_empty_fields", $_COOKIE);
        }
        ?>
        <table cellspacing="0" class="widefat fixed entry-detail-view">
            <thead>
                <tr>
                    <th id="details">
                    <?php 
        echo $form["title"];
        ?>
 : <?php 
        _e("Entry # ", "gravityforms");
        ?>
 <?php 
        echo $lead["id"];
        ?>
                    </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", "gravityforms");
            ?>
</label>
                            <?php 
        }
        ?>
                    </th>
                </tr>
            </thead>
            <tbody>
                <?php 
        $count = 0;
        $field_count = sizeof($form["fields"]);
        $has_product_fields = false;
        foreach ($form["fields"] as $field) {
            switch (RGFormsModel::get_input_type($field)) {
                case "section":
                    if (!GFCommon::is_section_empty($field, $form, $lead) || $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(GFCommon::get_label($field));
                        ?>
</td>
                                </tr>
                                <?php 
                    }
                    break;
                case "captcha":
                case "html":
                case "password":
                case "page":
                    //ignore captcha, html, password, page field
                    break;
                default:
                    //ignore product fields as they will be grouped together at the end of the grid
                    if (GFCommon::is_product_field($field["type"])) {
                        $has_product_fields = true;
                        continue;
                    }
                    $value = RGFormsModel::get_lead_field_value($lead, $field);
                    $display_value = GFCommon::get_lead_field_display($field, $value, $lead["currency"]);
                    $display_value = apply_filters("gform_entry_field_value", $display_value, $field, $lead, $form);
                    if ($display_empty_fields || !empty($display_value) || $display_value === "0") {
                        $count++;
                        $is_last = $count >= $field_count && !$has_product_fields ? true : false;
                        $last_row = $is_last ? " lastrow" : "";
                        $display_value = empty($display_value) && $display_value !== "0" ? "&nbsp;" : $display_value;
                        $content = '
                                <tr>
                                    <td colspan="2" class="entry-view-field-name">' . esc_html(GFCommon::get_label($field)) . '</td>
                                </tr>
                                <tr>
                                    <td colspan="2" class="entry-view-field-value' . $last_row . '">' . $display_value . '</td>
                                </tr>';
                        $content = apply_filters("gform_field_content", $content, $field, $value, $lead["id"], $form["id"]);
                        echo $content;
                    }
                    break;
            }
        }
        $products = array();
        if ($has_product_fields) {
            $products = GFCommon::get_product_fields($form, $lead);
            if (!empty($products["products"])) {
//.........这里部分代码省略.........
开发者ID:JSpier,项目名称:smacamp,代码行数:101,代码来源:entry_detail.php

示例7: get_entry_value

 private static function get_entry_value($field_id, $entry, $name_fields)
 {
     foreach ($name_fields as $name_field) {
         if ($field_id == $name_field["id"]) {
             $value = RGFormsModel::get_lead_field_value($entry, $name_field);
             return GFCommon::get_lead_field_display($name_field, $value);
         }
     }
     return $entry[$field_id];
 }
开发者ID:Inteleck,项目名称:hwc,代码行数:10,代码来源:userregistration.php

示例8: field_value

 /**
  * Given an entry and a form field id, calculate the entry value for that field.
  *
  * @access public
  * @param array $entry
  * @param integer $field
  * @return null|string
  */
 public static function field_value($entry, $field_settings, $format = 'html')
 {
     if (empty($entry['form_id']) || empty($field_settings['id'])) {
         return NULL;
     }
     $gravityview_view = GravityView_View::getInstance();
     if (class_exists('GFCache')) {
         /**
          * Gravity Forms' GFCache function was thrashing the database, causing double the amount of time for the field_value() method to run.
          *
          * The reason is that the cache was checking against a field value stored in a transient every time `GFFormsModel::get_lead_field_value()` is called.
          *
          * What we're doing here is telling the GFCache that it's already checked the transient and the value is false, forcing it to just use the non-cached data, which is actually faster.
          *
          * @hack
          * @since  1.3
          * @param  string $cache_key Field Value transient key used by Gravity Forms
          * @param mixed false Setting the value of the cache to false so that it's not used by Gravity Forms' GFFormsModel::get_lead_field_value() method
          * @param boolean false Tell Gravity Forms not to store this as a transient
          * @param  int 0 Time to store the value. 0 is maximum amount of time possible.
          */
         GFCache::set("GFFormsModel::get_lead_field_value_" . $entry["id"] . "_" . $field_settings["id"], false, false, 0);
     }
     $field_id = $field_settings['id'];
     $form = $gravityview_view->getForm();
     $field = gravityview_get_field($form, $field_id);
     $field_type = RGFormsModel::get_input_type($field);
     if ($field_type) {
         $field_type = $field['type'];
         $value = RGFormsModel::get_lead_field_value($entry, $field);
     } else {
         // For non-integer field types (`id`, `date_created`, etc.)
         $field_type = $field_id;
         $field['type'] = $field_id;
         $value = isset($entry[$field_type]) ? $entry[$field_type] : NULL;
     }
     // Prevent any PHP warnings that may be generated
     ob_start();
     $display_value = GFCommon::get_lead_field_display($field, $value, $entry["currency"], false, $format);
     if ($errors = ob_get_clean()) {
         do_action('gravityview_log_error', 'GravityView_API[field_value] Errors when calling GFCommon::get_lead_field_display()', $errors);
     }
     $display_value = apply_filters("gform_entry_field_value", $display_value, $field, $entry, $form);
     // prevent the use of merge_tags for non-admin fields
     if (!empty($field['adminOnly'])) {
         $display_value = self::replace_variables($display_value, $form, $entry);
     }
     // Check whether the field exists in /includes/fields/{$field_type}.php
     // This can be overridden by user template files.
     $field_exists = $gravityview_view->locate_template("fields/{$field_type}.php");
     // Set the field data to be available in the templates
     $gravityview_view->setCurrentField(array('form' => $form, 'field_id' => $field_id, 'field' => $field, 'field_settings' => $field_settings, 'value' => $value, 'display_value' => $display_value, 'format' => $format, 'entry' => $entry, 'field_type' => $field_type));
     if ($field_exists) {
         do_action('gravityview_log_debug', sprintf('[field_value] Rendering %s', $field_exists));
         ob_start();
         load_template($field_exists, false);
         $output = ob_get_clean();
     } else {
         // Backup; the field template doesn't exist.
         $output = $display_value;
     }
     $field_settings = $gravityview_view->getCurrentField('field_settings');
     /**
      * Link to the single entry by wrapping the output in an anchor tag
      *
      * Fields can override this by modifying the field data variable inside the field. See /templates/fields/post_image.php for an example.
      *
      */
     if (!empty($field_settings['show_as_link'])) {
         $output = self::entry_link_html($entry, $output, array(), $field_settings);
     }
     /**
      * @filter `gravityview_field_entry_value_{$field_type}` Modify the field value output for a field type. Example: `gravityview_field_entry_value_number`
      * @since 1.6
      * @param string $output HTML value output
      * @param array  $entry The GF entry array
      * @param  array $field_settings Settings for the particular GV field
      */
     $output = apply_filters('gravityview_field_entry_value_' . $field_type, $output, $entry, $field_settings, $gravityview_view->getCurrentField());
     /**
      * @filter `gravityview_field_entry_value` Modify the field value output for all field types
      * @param string $output HTML value output
      * @param array  $entry The GF entry array
      * @param  array $field_settings Settings for the particular GV field
      * @param array $field_data  {@since 1.6}
      */
     $output = apply_filters('gravityview_field_entry_value', $output, $entry, $field_settings, $gravityview_view->getCurrentField());
     return $output;
 }
开发者ID:roarmoser,项目名称:gv1,代码行数:97,代码来源:class-api.php

示例9: send_admin_notification

 public static function send_admin_notification($form, $lead)
 {
     $form_id = $form["id"];
     //handling admin notification email
     $subject = GFCommon::replace_variables($form["notification"]["subject"], $form, $lead, false, false);
     $message = GFCommon::replace_variables($form["notification"]["message"], $form, $lead, false, false, !$form["notification"]["disableAutoformat"]);
     $message = do_shortcode($message);
     $from = empty($form["notification"]["fromField"]) ? $form["notification"]["from"] : $lead[$form["notification"]["fromField"]];
     if (empty($form["notification"]["fromNameField"])) {
         $from_name = $form["notification"]["fromName"];
     } else {
         $field = RGFormsModel::get_field($form, $form["notification"]["fromNameField"]);
         $value = RGFormsModel::get_lead_field_value($lead, $field);
         $from_name = GFCommon::get_lead_field_display($field, $value);
     }
     $replyTo = empty($form["notification"]["replyToField"]) ? $form["notification"]["replyTo"] : $lead[$form["notification"]["replyToField"]];
     if (empty($form["notification"]["routing"])) {
         $email_to = $form["notification"]["to"];
     } else {
         $email_to = array();
         foreach ($form["notification"]["routing"] as $routing) {
             $source_field = RGFormsModel::get_field($form, $routing["fieldId"]);
             $field_value = RGFormsModel::get_field_value($source_field, array());
             $is_value_match = is_array($field_value) ? in_array($routing["value"], $field_value) : $field_value == $routing["value"];
             if ($routing["operator"] == "is" && $is_value_match || $routing["operator"] == "isnot" && !$is_value_match) {
                 $email_to[] = $routing["email"];
             }
         }
         $email_to = join(",", $email_to);
     }
     //Running through variable replacement
     $email_to = GFCommon::replace_variables($email_to, $form, $lead, false, false);
     $from = GFCommon::replace_variables($from, $form, $lead, false, false);
     $bcc = GFCommon::replace_variables($form["notification"]["bcc"], $form, $lead, false, false);
     $reply_to = GFCommon::replace_variables($replyTo, $form, $lead, false, false);
     $from_name = GFCommon::replace_variables($from_name, $form, $lead, false, false);
     //Filters the admin notification email to address. Allows users to change email address before notification is sent
     $to = apply_filters("gform_notification_email_{$form_id}", apply_filters("gform_notification_email", $email_to, $lead), $lead);
     self::send_email($from, $to, $bcc, $replyTo, $subject, $message, $from_name);
 }
开发者ID:novuscory,项目名称:ACH,代码行数:40,代码来源:common.php

示例10: shortcode_gravitylistcompleted


//.........这里部分代码省略.........
                             }
                         }
                     }
                 } else {
                     /**
                      * Retrieve the lead
                      */
                     $lead = RGFormsModel::get_lead($lead['id']);
                     $lead['gform_edit_id'] = $lead['id'];
                     if (is_null($lead['lead_id'])) {
                         $lead['lead_id'] = $lead['id'];
                     }
                 }
                 $i = 0;
                 $html .= "\t\t\t\t<tr>\n";
                 //echo print_r($lead, true);
                 /**
                  * Add a column to display the lead-id
                  */
                 if ($displaylead) {
                     $html .= "\t\t\t\t\t<td scope=\"col\" class=\"col{$i}\" width=\"10%\">{$lead['lead_id']}</td>\n";
                 }
                 /** 
                  * Loop through the Fields
                  */
                 foreach ($form['fields'] as $field) {
                     /** 
                      * Display 'adminOnly' fields only to form admins
                      */
                     if (!$field['adminOnly'] || GFCommon::current_user_can_any('gravityforms_edit_entries')) {
                         /** 
                          * Only display fields that are checked at the field-settings
                          */
                         if ($field['spgfle_showinlist']) {
                             $i++;
                             unset($value, $display_value);
                             $value = RGFormsModel::get_lead_field_value($lead, $field);
                             /**
                              * Only the value is stored, but we need to display
                              * the display-data for this value
                              */
                             if ($field['enableChoiceValue'] == '1') {
                                 if (!empty($value)) {
                                     unset($item, $items, $itemcount);
                                     foreach ((array) $value as $single_value) {
                                         if (!empty($single_value)) {
                                             foreach ($field['choices'] as $choices) {
                                                 if ($choices['value'] == $single_value) {
                                                     $items .= '<li>' . $choices['text'] . '</li>';
                                                     $item = $choices['text'];
                                                     $itemcount++;
                                                     break;
                                                 }
                                             }
                                         }
                                     }
                                     if ($itemcount == 1) {
                                         $display_value = $item;
                                     } elseif ($itemcount > 0) {
                                         $display_value = "<ul class='bulleted'>{$items}</ul>";
                                     } else {
                                         $display_value = "";
                                     }
                                 }
                             } else {
                                 $display_value = GFCommon::get_lead_field_display($field, $value, $lead["currency"]);
                             }
                             $html .= "\t\t\t\t\t<td scope=\"col\" class=\"col{$i}\">{$display_value}</td>\n";
                         }
                     }
                 }
                 /**
                  * Display Button to the gfEdit Destination
                  */
                 if ($gfediturl || $gfdeleteurl) {
                     $i++;
                     $html .= "\t\t\t\t\t<td scope=\"col\" class=\"col{$i}\" width=\"25%\">\n";
                     /**
                      * Display the view button
                      */
                     if ($form['spgfle_enableview']) {
                         $html .= "\t\t\t\t\t\t<button class=\"btn default btn-xs blue\" onClick=\"SetHiddenFormSettings({$lead['gform_edit_id']}, 'view')\"><i class=\"fa fa-share\"></i>" . __("PDF", 'spgfle') . "</button>\n";
                     }
                     $html .= "\t\t\t\t\t</td>\n";
                 }
                 $html .= "\t\t\t\t</tr>\n";
             }
             $html .= "\t\t\t</tbody>\n";
             $html .= "\t\t</table>\n";
             if (empty($leads)) {
                 $html .= "<p>No Completed Orders Found</p>\n";
             }
             $html .= "\t</form>\n";
             $html .= "\t</div>\n";
         } else {
             $html = '<p>' . __("You must be logged in.", 'spgfle') . '</p>';
         }
     }
     return $html;
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:101,代码来源:sp-gf-list-edit.php

示例11: send_admin_notification

 public static function send_admin_notification($form, $lead)
 {
     $form_id = $form["id"];
     //handling admin notification email
     $subject = GFCommon::replace_variables(rgget("subject", $form["notification"]), $form, $lead, false, false);
     $message = GFCommon::replace_variables(rgget("message", $form["notification"]), $form, $lead, false, false, !rgget("disableAutoformat", $form["notification"]));
     $message = do_shortcode($message);
     $version_info = self::get_version_info();
     $is_expired = !rgempty("expiration_time", $version_info) && $version_info["expiration_time"] < time();
     if (!$version_info["is_valid_key"] && $is_expired) {
         $message .= "<br/><br/>Your Gravity Forms License Key has expired. In order to continue receiving support and software updates you must renew your license key. You can do so by following the renewal instructions on the Gravity Forms Settings page in your WordPress Dashboard or by <a href='http://www.gravityhelp.com/renew-license/?key=" . self::get_key() . "'>clicking here</a>.";
     }
     $from = rgempty("fromField", $form["notification"]) ? rgget("from", $form["notification"]) : rgget($form["notification"]["fromField"], $lead);
     if (rgempty("fromNameField", $form["notification"])) {
         $from_name = rgget("fromName", $form["notification"]);
     } else {
         $field = RGFormsModel::get_field($form, rgget("fromNameField", $form["notification"]));
         $value = RGFormsModel::get_lead_field_value($lead, $field);
         $from_name = GFCommon::get_lead_field_display($field, $value);
     }
     $replyTo = rgempty("replyToField", $form["notification"]) ? rgget("replyTo", $form["notification"]) : rgget($form["notification"]["replyToField"], $lead);
     if (rgempty("routing", $form["notification"])) {
         $email_to = rgget("to", $form["notification"]);
     } else {
         $email_to = array();
         foreach ($form["notification"]["routing"] as $routing) {
             $source_field = RGFormsModel::get_field($form, $routing["fieldId"]);
             $field_value = RGFormsModel::get_field_value($source_field, array());
             $is_value_match = is_array($field_value) ? in_array($routing["value"], $field_value) : $field_value == $routing["value"];
             if ($routing["operator"] == "is" && $is_value_match || $routing["operator"] == "isnot" && !$is_value_match) {
                 $email_to[] = $routing["email"];
             }
         }
         $email_to = join(",", $email_to);
     }
     //Running through variable replacement
     $email_to = GFCommon::replace_variables($email_to, $form, $lead, false, false);
     $from = GFCommon::replace_variables($from, $form, $lead, false, false);
     $bcc = GFCommon::replace_variables(rgget("bcc", $form["notification"]), $form, $lead, false, false);
     $reply_to = GFCommon::replace_variables($replyTo, $form, $lead, false, false);
     $from_name = GFCommon::replace_variables($from_name, $form, $lead, false, false);
     //Filters the admin notification email to address. Allows users to change email address before notification is sent
     $to = apply_filters("gform_notification_email_{$form_id}", apply_filters("gform_notification_email", $email_to, $lead), $lead);
     self::send_email($from, $to, $bcc, $replyTo, $subject, $message, $from_name);
 }
开发者ID:hypenotic,项目名称:slowfood,代码行数:45,代码来源:common.php

示例12: set_export_values

function set_export_values($value, $form_id, $field_id, $lead)
{
    if ($field_id == 320) {
        $form = GFAPI::get_form($form_id);
        foreach ($form['fields'] as $field) {
            if ($field->id == $field_id) {
                if (in_array($field->type, array('checkbox', 'select', 'radio'))) {
                    $value = RGFormsModel::get_lead_field_value($lead, $field);
                    return GFCommon::get_lead_field_display($field, $value, $lead["currency"], true);
                } else {
                    return $value;
                }
            }
        }
    }
    return $value;
}
开发者ID:hansstam,项目名称:makerfaire,代码行数:17,代码来源:gf-helper.php

示例13: preview_special_merge_tags

 /**
  * Adds special support for file upload, post image and multi input merge tags.
  */
 public static function preview_special_merge_tags($value, $input_id, $options, $field)
 {
     $input_type = GFFormsModel::get_input_type($field);
     $is_upload_field = in_array($input_type, array('post_image', 'fileupload'));
     $is_multi_upload_field = $is_upload_field && rgar($field, 'multipleFiles');
     // added to prevent overriding :noadmin filter (and other filters that remove fields)
     // added exception for multi upload file fields which have an empty $value at this stage
     if (!$value && !$is_multi_upload_field) {
         return $value;
     }
     $is_multi_input = is_array(rgar($field, 'inputs'));
     $is_input = intval($input_id) != $input_id;
     if (!$is_upload_field && !$is_multi_input) {
         return $value;
     }
     // if is individual input of multi-input field, return just that input value
     if ($is_input) {
         return $value;
     }
     $form = GFFormsModel::get_form_meta($field['formId']);
     $entry = self::create_lead($form);
     $currency = GFCommon::get_currency();
     if (is_array(rgar($field, 'inputs'))) {
         $value = GFFormsModel::get_lead_field_value($entry, $field);
         return GFCommon::get_lead_field_display($field, $value, $currency, true);
     }
     switch ($input_type) {
         case 'fileupload':
             $value = self::preview_image_value("input_{$field['id']}", $field, $form, $entry);
             if ($is_multi_upload_field) {
                 if (is_a($field, 'GF_Field')) {
                     $value = $field->get_value_entry_detail(json_encode(array_filter((array) $value)));
                 } else {
                     $value = GFCommon::get_lead_field_display($field, json_encode($value));
                 }
                 $input_name = "input_" . str_replace('.', '_', $field['id']);
                 $file_info = self::get_uploaded_file_info($form['id'], $input_name, $field);
                 if ($file_info) {
                     foreach ($file_info as $file) {
                         $value = str_replace('>' . $file['temp_filename'], '>' . $file['uploaded_filename'], $value);
                     }
                 }
             } else {
                 $value = $input_id == 'all_fields' || $options == 'link' ? self::preview_image_display($field, $form, $value) : $value;
             }
             break;
         default:
             $value = self::preview_image_value("input_{$field['id']}", $field, $form, $entry);
             $value = GFCommon::get_lead_field_display($field, $value, $currency);
             break;
     }
     $value = apply_filters('gpps_special_merge_tags_value', $value, $field, $input_id, $options, $form, $entry);
     $value = apply_filters(sprintf('gpps_special_merge_tags_value_%s', $form['id']), $value, $field, $input_id, $options, $form, $entry);
     $value = apply_filters(sprintf('gpps_special_merge_tags_value_%s_%s', $form['id'], $field['id']), $value, $field, $input_id, $options, $form, $entry);
     $value = apply_filters(sprintf('gpps_special_merge_tags_value_%s', $input_type), $value, $field, $input_id, $options, $form, $entry);
     $value = apply_filters(sprintf('gpps_special_merge_tags_value_%s_%s', $form['id'], $input_type), $value, $field, $input_id, $options, $form, $entry);
     return $value;
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:61,代码来源:gw-gravity-forms-preview-confirmation.php

示例14: get_entry_value

 private function get_entry_value($field_id, $entry, $name_fields)
 {
     foreach ($name_fields as $name_field) {
         if ($field_id == $name_field['id']) {
             $value = RGFormsModel::get_lead_field_value($entry, $name_field);
             return GFCommon::get_lead_field_display($name_field, $value);
         }
     }
     return rgar($entry, $field_id);
 }
开发者ID:wp-premium,项目名称:gravityformsfreshbooks,代码行数:10,代码来源:class-gf-freshbooks.php

示例15: createCSVfile

function createCSVfile()
{
    //create CSV for individual entries come as a GET request, the mass entry list is a POST request
    $form_id = isset($_POST['exportForm']) && $_POST['exportForm'] != '' ? $_POST['exportForm'] : '';
    //if the form_id is not set in the post fields, let check the get fields
    if ($form_id == '') {
        $form_id = isset($_GET['exForm']) && $_GET['exForm'] != '' ? $_GET['exForm'] : '';
    }
    if ($form_id == '') {
        die('please select a form');
    }
    $entry_id = isset($_GET['exEntry']) && $_GET['exEntry'] != '' ? $_GET['exEntry'] : '';
    //create CSV file
    $form = GFAPI::get_form($form_id);
    $fieldData = array();
    //put fieldData in a usable array
    foreach ($form['fields'] as $field) {
        if ($field->type != 'section' && $field->type != 'html' && $field->type != 'page') {
            $fieldData[$field['id']] = $field;
        }
    }
    $search_criteria['status'] = 'active';
    $entries = array();
    if ($entry_id == '') {
        $entries = GFAPI::get_entries($form_id, $search_criteria, null, array('offset' => 0, 'page_size' => 9999));
    } else {
        //use the submitted entry
        $entries[] = GFAPI::get_entry($entry_id);
    }
    $output = array('Entry ID', 'FormID');
    $list = array();
    foreach ($fieldData as $field) {
        $output[] = $field['label'];
    }
    $list[] = $output;
    foreach ($entries as $entry) {
        $fieldArray = array($entry['id'], $form_id);
        foreach ($fieldData as $field) {
            if ($field->id == 320 || $field->id == 321) {
                if (in_array($field->type, array('checkbox', 'select', 'radio'))) {
                    $currency = GFCommon::get_currency();
                    $value = RGFormsModel::get_lead_field_value($entry, $field);
                    array_push($fieldArray, GFCommon::get_lead_field_display($field, $value, $currency, true));
                }
            } else {
                array_push($fieldArray, isset($entry[$field->id]) ? $entry[$field->id] : "");
            }
        }
        $list[] = $fieldArray;
    }
    //write CSV file
    // output headers so that the file is downloaded rather than displayed
    header('Content-Type: text/csv; charset=utf-8');
    header('Content-Disposition: attachment; filename=form-' . $form_id . ($entry_id != '' ? '-' . $entry_id : '') . '.csv');
    $file = fopen('php://output', 'w');
    foreach ($list as $line) {
        fputcsv($file, $line);
    }
    fclose($file);
    //wp_redirect(  admin_url( 'admin.php?page=mf_export'));
    die;
    exit;
}
开发者ID:hansstam,项目名称:makerfaire,代码行数:63,代码来源:functions.php


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