本文整理汇总了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);
}
示例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);
}
示例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);
}