本文整理匯總了PHP中GFFormDisplay::get_max_field_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFFormDisplay::get_max_field_id方法的具體用法?PHP GFFormDisplay::get_max_field_id怎麽用?PHP GFFormDisplay::get_max_field_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GFFormDisplay
的用法示例。
在下文中一共展示了GFFormDisplay::get_max_field_id方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render
public function render($form, $ajax)
{
if (!class_exists('GFFormDisplay') || self::isDisabled()) {
return $form;
}
self::enqueueScripts($form, $ajax);
self::updateRenderedCount();
$next = GFFormDisplay::get_max_field_id($form) + 1;
$template = sprintf($this->template, get_option('rg_gforms_captcha_public_key'));
$opts = array('type' => 'section', '_is_entry_detail' => NULL, 'id' => $next, 'label' => '', 'adminLabel' => '', 'isRequired' => false, 'size' => 'medium', 'errorMessage' => '', 'inputs' => NULL, 'displayOnly' => true, 'labelPlacement' => '', 'content' => '', 'formId' => $form['id'], 'pageNumber' => GFFormDisplay::get_current_page($form['id']), 'conditionalLogic' => '', 'cssClass' => $this->buCAPTCHAIdentifier . '_section');
$form['fields'][] = GF_Fields::create($opts);
$captcha_opts = array('type' => 'html', 'id' => $next + 1, 'content' => apply_filters('bu_gravityforms_global_recaptcha_div', $template), 'cssClass' => $this->buCAPTCHAIdentifier);
$form['fields'][] = GF_Fields::create(array_merge($opts, $captcha_opts));
return $form;
}
示例2: maybe_validate
/**
* Check if the rest of the form has passed validation, is the last page, and that the honeypot field has not been completed.
*
* @param array $validation_result Contains the validation result, the form object, and the failed validation page number.
*
* @return array $validation_result
*/
public function maybe_validate($validation_result)
{
$form = $validation_result['form'];
$is_last_page = GFFormDisplay::is_last_page($form);
$failed_honeypot = false;
if ($is_last_page && rgar($form, 'enableHoneypot')) {
$honeypot_id = GFFormDisplay::get_max_field_id($form) + 1;
$failed_honeypot = !rgempty("input_{$honeypot_id}");
}
if (!$validation_result['is_valid'] || !$is_last_page || $failed_honeypot) {
return $validation_result;
}
return $this->validation($validation_result);
}
示例3: maybe_validate
/**
* Check if the rest of the form has passed validation, is the last page, and that the honeypot field has not been completed.
*
* @param array $validation_result Contains the validation result, the form object, and the failed validation page number.
*
* @return array $validation_result
*/
public function maybe_validate($validation_result)
{
$form = $validation_result['form'];
$is_last_page = GFFormDisplay::is_last_page($form);
$failed_honeypot = false;
if ($is_last_page && rgar($form, 'enableHoneypot')) {
$honeypot_id = GFFormDisplay::get_max_field_id($form) + 1;
$failed_honeypot = !rgempty("input_{$honeypot_id}");
}
$is_heartbeat = rgpost('action') == 'heartbeat';
// Validation called by partial entries feature via the heartbeat API.
if (!$validation_result['is_valid'] || !$is_last_page || $failed_honeypot || $is_heartbeat) {
return $validation_result;
}
return $this->validation($validation_result);
}
示例4: is_ready_for_capture
private static function is_ready_for_capture($validation_result)
{
$form = $validation_result['form'];
$is_last_page = GFFormDisplay::is_last_page($form);
$failed_honeypot = false;
if ($is_last_page && rgar($form, 'enableHoneypot')) {
$honeypot_id = GFFormDisplay::get_max_field_id($form) + 1;
$failed_honeypot = !rgempty("input_{$honeypot_id}");
}
$is_heartbeat = rgpost('action') == 'heartbeat';
// Validation called by partial entries feature via the heartbeat API.
if (!$validation_result['is_valid'] || !$is_last_page || $failed_honeypot || $is_heartbeat) {
return false;
}
//getting config that matches condition (if conditions are enabled)
$config = self::get_config($validation_result["form"]);
if (!$config) {
return false;
}
//making sure credit card field is visible
$creditcard_field = self::get_creditcard_field($validation_result["form"]);
if (RGFormsModel::is_field_hidden($validation_result["form"], $creditcard_field, array())) {
return false;
}
return $config;
}