當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GFFormDisplay::get_source_page方法代碼示例

本文整理匯總了PHP中GFFormDisplay::get_source_page方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFFormDisplay::get_source_page方法的具體用法?PHP GFFormDisplay::get_source_page怎麽用?PHP GFFormDisplay::get_source_page使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GFFormDisplay的用法示例。


在下文中一共展示了GFFormDisplay::get_source_page方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * initialise instance
  * @param array $form
  */
 public function __construct(&$form)
 {
     // check for last page
     $current_page = GFFormDisplay::get_source_page($form['id']);
     $target_page = GFFormDisplay::get_target_page($form, $current_page, rgpost('gform_field_values'));
     $this->isLastPageFlag = $target_page == 0;
     // load the form data
     $this->loadForm($form);
 }
開發者ID:Ezyva2015,項目名稱:SMSF-Academy-Wordpress,代碼行數:13,代碼來源:class.GFEwayFormData.php

示例2: is_applicable_field

 function is_applicable_field($field, $form)
 {
     if ($field['pageNumber'] != GFFormDisplay::get_source_page($form['id'])) {
         return false;
     }
     if ($field['type'] != 'list' || RGFormsModel::is_field_hidden($form, $field, array())) {
         return false;
     }
     // if the field has already failed validation, we don't need to fail it again
     if (!$field['isRequired'] || $field['failed_validation']) {
         return false;
     }
     if (empty($this->field_ids)) {
         return true;
     }
     return in_array($field['id'], $this->field_ids);
 }
開發者ID:Ezyva2015,項目名稱:SMSF-Academy-Wordpress,代碼行數:17,代碼來源:gwReqColumns.php

示例3: should_field_be_validated

 function should_field_be_validated($form, $field)
 {
     if ($field['pageNumber'] != GFFormDisplay::get_source_page($form['id'])) {
         return false;
     }
     // if no limits provided for this field
     if (!$this->get_field_limits($field['id'])) {
         return false;
     }
     // or if this field is not a checkbox
     if (RGFormsModel::get_input_type($field) != 'checkbox') {
         return false;
     }
     // or if this field is hidden
     if (RGFormsModel::is_field_hidden($form, $field, array())) {
         return false;
     }
     return true;
 }
開發者ID:hansstam,項目名稱:makerfaire,代碼行數:19,代碼來源:gf-limit-checkboxes.php

示例4: validate_credit_card

 public function validate_credit_card($validation_result)
 {
     if (!$this->has_feed($validation_result['form']['id'], true)) {
         return $validation_result;
     }
     foreach ($validation_result['form']['fields'] as &$field) {
         $current_page = GFFormDisplay::get_source_page($validation_result['form']['id']);
         $field_on_curent_page = $current_page > 0 && $field['pageNumber'] == $current_page;
         if (GFFormsModel::get_input_type($field) != 'creditcard' || !$field_on_curent_page) {
             continue;
         }
         if ($this->get_stripe_js_error()) {
             $field['failed_validation'] = true;
             $field['validation_message'] = $this->get_stripe_js_error();
         } else {
             // override validation in case user has marked field as required allowing stripe to handle cc validation
             $field['failed_validation'] = false;
         }
         // only one cc field per form, break once we've found it
         break;
     }
     // revalidate the validaiton result
     $validation_result['is_valid'] = true;
     foreach ($validation_result['form']['fields'] as &$field) {
         if ($field['failed_validation']) {
             $validation_result['is_valid'] = false;
             break;
         }
     }
     return $validation_result;
 }
開發者ID:TMBR,項目名稱:johnjohn,代碼行數:31,代碼來源:class-gf-stripe.php

示例5: is_last_page

 private static function is_last_page($form)
 {
     $current_page = GFFormDisplay::get_source_page($form["id"]);
     $target_page = GFFormDisplay::get_target_page($form, $current_page, rgpost("gform_field_values"));
     return $target_page == 0;
 }
開發者ID:macconsultinggroup,項目名稱:WordPress,代碼行數:6,代碼來源:authorizenet.php


注:本文中的GFFormDisplay::get_source_page方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。