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


PHP RGFormsModel::set_current_lead方法代码示例

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


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

示例1: handle_submission

 public static function handle_submission($form, &$lead, $ajax = false)
 {
     //creating entry in DB
     RGFormsModel::save_lead($form, $lead);
     //reading entry that was just saved
     $lead = RGFormsModel::get_lead($lead["id"]);
     $lead = GFFormsModel::set_entry_meta($lead, $form);
     do_action('gform_entry_created', $lead, $form);
     $lead = apply_filters('gform_entry_post_save', $lead, $form);
     RGFormsModel::set_current_lead($lead);
     //if Akismet plugin is installed, run lead through Akismet and mark it as Spam when appropriate
     $is_spam = GFCommon::akismet_enabled($form['id']) && GFCommon::is_akismet_spam($form, $lead);
     if (!$is_spam) {
         GFCommon::create_post($form, $lead);
         //send notifications
         GFCommon::send_form_submission_notifications($form, $lead);
     } else {
         //marking entry as spam
         RGFormsModel::update_lead_property($lead["id"], "status", "spam", false, true);
         $lead["status"] = "spam";
     }
     //display confirmation message or redirect to confirmation page
     return self::handle_confirmation($form, $lead, $ajax);
 }
开发者ID:jonnSmith,项目名称:btforms,代码行数:24,代码来源:form_display.php

示例2: handle_submission

 public static function handle_submission($form, &$lead, $ajax = false)
 {
     $lead_id = gf_apply_filters(array('gform_entry_id_pre_save_lead', $form['id']), null, $form);
     if (!empty($lead_id)) {
         if (empty($lead)) {
             $lead = array();
         }
         $lead['id'] = $lead_id;
     }
     //creating entry in DB
     RGFormsModel::save_lead($form, $lead);
     //reading entry that was just saved
     $lead = RGFormsModel::get_lead($lead['id']);
     $lead = GFFormsModel::set_entry_meta($lead, $form);
     //if Akismet plugin is installed, run lead through Akismet and mark it as Spam when appropriate
     $is_spam = GFCommon::akismet_enabled($form['id']) && GFCommon::is_akismet_spam($form, $lead);
     /**
      * A filter to set if an entry is spam
      *
      * @param int $form['id'] The Form ID to filter through (take directly from the form object)
      * @param bool $is_spam True or false to filter if the entry is spam
      * @param array $form The Form object to filer through
      * @param array $lead The Lead object to filter through
      */
     $is_spam = gf_apply_filters(array('gform_entry_is_spam', $form['id']), $is_spam, $form, $lead);
     if (GFCommon::spam_enabled($form['id'])) {
         GFCommon::log_debug('GFFormDisplay::handle_submission(): Akismet integration enabled OR gform_entry_is_spam hook in use.');
         $log_is_spam = $is_spam ? 'Yes' : 'No';
         GFCommon::log_debug("GFFormDisplay::handle_submission(): Is entry considered spam? {$log_is_spam}.");
     }
     if ($is_spam) {
         //marking entry as spam
         RGFormsModel::update_lead_property($lead['id'], 'status', 'spam', false, true);
         $lead['status'] = 'spam';
     }
     /**
      * Fired after an entry is created
      *
      * @param array $lead The Entry object
      * @param array $form The Form object
      */
     do_action('gform_entry_created', $lead, $form);
     $lead = gf_apply_filters(array('gform_entry_post_save', $form['id']), $lead, $form);
     RGFormsModel::set_current_lead($lead);
     if (!$is_spam) {
         GFCommon::create_post($form, $lead);
         //send notifications
         GFCommon::send_form_submission_notifications($form, $lead);
     }
     self::clean_up_files($form);
     // remove incomplete submission and purge expired
     if (rgars($form, 'save/enabled')) {
         GFFormsModel::delete_incomplete_submission(rgpost('gform_resume_token'));
         GFFormsModel::purge_expired_incomplete_submissions();
     }
     //display confirmation message or redirect to confirmation page
     return self::handle_confirmation($form, $lead, $ajax);
 }
开发者ID:timk85,项目名称:DIT,代码行数:58,代码来源:form_display.php

示例3: handle_submission

 public static function handle_submission($form, &$lead, $ajax = false)
 {
     $lead_id = apply_filters("gform_entry_id_pre_save_lead{$form["id"]}", apply_filters("gform_entry_id_pre_save_lead", null, $form), $form);
     if (!empty($lead_id)) {
         if (empty($lead)) {
             $lead = array();
         }
         $lead["id"] = $lead_id;
     }
     //creating entry in DB
     RGFormsModel::save_lead($form, $lead);
     //reading entry that was just saved
     $lead = RGFormsModel::get_lead($lead["id"]);
     $lead = GFFormsModel::set_entry_meta($lead, $form);
     do_action('gform_entry_created', $lead, $form);
     $lead = apply_filters('gform_entry_post_save', $lead, $form);
     RGFormsModel::set_current_lead($lead);
     //if Akismet plugin is installed, run lead through Akismet and mark it as Spam when appropriate
     $is_spam = GFCommon::akismet_enabled($form['id']) && GFCommon::is_akismet_spam($form, $lead);
     $is_spam = apply_filters('gform_entry_is_spam', $is_spam, $form, $lead);
     $is_spam = apply_filters("gform_entry_is_spam_{$form['id']}", $is_spam, $form, $lead);
     GFCommon::log_debug("Checking for spam...");
     GFCommon::log_debug("Is entry considered spam? {$is_spam}.");
     if (!$is_spam) {
         GFCommon::create_post($form, $lead);
         //send notifications
         GFCommon::send_form_submission_notifications($form, $lead);
     } else {
         //marking entry as spam
         RGFormsModel::update_lead_property($lead["id"], "status", "spam", false, true);
         $lead["status"] = "spam";
     }
     self::clean_up_files($form);
     //display confirmation message or redirect to confirmation page
     return self::handle_confirmation($form, $lead, $ajax);
 }
开发者ID:rushabhrakholiya,项目名称:TEST,代码行数:36,代码来源:form_display.php


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