public static function get_form_fields($fields, $form_id, $error = false) { global $frm_vars; $page_numbers = self::get_base_page_info(compact('fields', 'form_id', 'error')); $ajax = FrmProFormsHelper::has_form_setting(array('form_id' => $form_id, 'setting_name' => 'ajax_submit', 'expected_setting' => 1)); foreach ((array) $fields as $k => $f) { // prevent sub fields from showing if ($f->form_id != $form_id) { unset($fields[$k]); } if ($ajax) { self::set_ajax_field_globals($f); } if ($f->type != 'break') { continue; } $page_numbers['page_breaks'][$f->field_order] = $f; self::get_next_and_prev_page($f, $error, $page_numbers); unset($f, $k); } unset($ajax); if (empty($page_numbers['page_breaks'])) { // there are no page breaks, so let's not check the pagination return $fields; } if (!$page_numbers['prev_page_obj'] && $page_numbers['prev_page']) { $page_numbers['prev_page'] = 0; } self::skip_conditional_pages($page_numbers); self::set_prev_page_global($form_id, $page_numbers); self::set_next_page_to_field_order($form_id, $page_numbers); self::set_page_num_global($page_numbers); unset($page_numbers['page_breaks']); self::set_fields_to_hidden($fields, $page_numbers); return $fields; }