/home/techb158/balacoffee.com/wp-content/plugins/wpforms/pro/includes/fields
NameSizeModeActions
class-address.php479160644editdlrm
class-content.php66250644editdlrm
class-date-time.php462600644editdlrm
class-divider.php36090644editdlrm
class-entry-preview.php286470644editdlrm
class-file-upload.php646910644editdlrm
class-hidden.php22840644editdlrm
class-html.php57580644editdlrm
class-layout.php94850644editdlrm
class-page-break.php248010644editdlrm
class-password.php193620644editdlrm
class-payment-checkbox.php165680644editdlrm
class-payment-credit-card.php189740644editdlrm
class-payment-dropdown.php170830644editdlrm
class-payment-multiple.php152940644editdlrm
class-payment-single.php114330644editdlrm
class-payment-total.php67060644editdlrm
class-phone.php96400644editdlrm
class-rating.php157670644editdlrm
class-richtext.php419060644editdlrm
class-url.php43840644editdlrm
Edit: /home/techb158/balacoffee.com/wp-content/plugins/wpforms/pro/includes/fields/class-page-break.php (24801B)
'#72b239', 'modern' => '#066aab', ]; /** * Pages information. * * @since 1.3.7 * * @var array|bool */ protected $pagebreak; /** * Primary class constructor. * * @since 1.0.0 */ public function init() { // Define field type information. $this->name = esc_html__( 'Page Break', 'wpforms' ); $this->type = 'pagebreak'; $this->icon = 'fa-files-o'; $this->order = 160; $this->group = 'fancy'; $this->hooks(); } /** * Hooks. * * @since 1.7.1 */ private function hooks() { add_filter( 'wpforms_field_preview_class', [ $this, 'preview_field_class' ], 10, 2 ); add_filter( 'wpforms_field_new_class', [ $this, 'preview_field_class' ], 10, 2 ); add_filter( 'wpforms_frontend_form_data', [ $this, 'maybe_sort_fields' ], PHP_INT_MAX ); add_action( 'wpforms_frontend_output', [ $this, 'display_page_indicator' ], 9, 5 ); add_action( 'wpforms_display_fields_before', [ $this, 'display_fields_before' ], 20, 2 ); add_action( 'wpforms_display_fields_after', [ $this, 'display_fields_after' ], 5, 2 ); add_action( 'wpforms_display_field_after', [ $this, 'display_field_after' ], 20, 2 ); add_filter( "wpforms_pro_admin_entries_edit_is_field_displayable_{$this->type}", '__return_false' ); } /** * Sort fields to make sure that bottom page break elements are in their place. * Need to correctly display existing forms with wrong page-break bottom element positioning. * * @since 1.6.0.2 * * @param array $form_data Form data. * * @return array Form data. */ public function maybe_sort_fields( $form_data ) { if ( empty( $form_data['fields'] ) ) { return $form_data; }; $bottom = []; $fields = $form_data['fields']; foreach ( $fields as $id => $field ) { // Process only pagebreak fields. if ( $field['type'] !== 'pagebreak' ) { continue; } if ( empty( $field['position'] ) ) { continue; } if ( $field['position'] === 'bottom' ) { $bottom = $field; unset( $fields[ $id ] ); } } if ( ! empty( $bottom ) ) { $form_data['fields'] = $fields + [ $bottom['id'] => $bottom ]; } return $form_data; } /** * Add class to the builder field preview. * * @since 1.2.0 * * @param string $css * @param array $field * * @return string */ public function preview_field_class( $css, $field ) { if ( 'pagebreak' === $field['type'] ) { if ( ! empty( $field['position'] ) && 'top' === $field['position'] ) { $css .= ' wpforms-field-stick wpforms-pagebreak-top'; } elseif ( ! empty( $field['position'] ) && 'bottom' === $field['position'] ) { $css .= ' wpforms-field-stick wpforms-pagebreak-bottom'; } else { $css .= ' wpforms-pagebreak-normal'; } } return $css; } /** * This displays if the form contains pagebreaks and is configured to show * a page indicator in the top pagebreak settings. * * This function was moved from class-frontend.php in v1.3.7. * * @since 1.2.1 * * @param array $form_data Form data and settings. */ public function display_page_indicator( $form_data ) { $top = ! empty( wpforms()->frontend->pages['top'] ) ? wpforms()->frontend->pages['top'] : false; if ( empty( $top['indicator'] ) ) { return; } $pagebreak = [ 'indicator' => sanitize_html_class( $top['indicator'] ), 'color' => wpforms_sanitize_hex_color( $top['indicator_color'] ), 'pages' => array_merge( [ wpforms()->frontend->pages['top'] ], wpforms()->frontend->pages['pages'] ), 'scroll' => empty( $top['scroll_disabled'] ), ]; $p = 1; $this->frontend_obj->open_page_indicator_container( $pagebreak ); if ( 'circles' === $pagebreak['indicator'] ) { // Circles theme. foreach ( $pagebreak['pages'] as $page ) { $is_first = $p === 1; $class = $is_first ? 'active' : ''; $background_color = ! empty( $pagebreak['color'] ) ? $pagebreak['color'] : ''; printf( '
', sanitize_html_class( $class ), absint( $p ) ); printf( '%d', $is_first && ! empty( $background_color ) ? ' style="background-color:' . sanitize_hex_color( $background_color ) . '"' : '', absint( $p ) ); if ( ! empty( $page['title'] ) ) { printf( '%s', esc_html( $page['title'] ) ); } echo '
'; $p ++; } } elseif ( 'connector' === $pagebreak['indicator'] ) { // Connector theme. foreach ( $pagebreak['pages'] as $page ) { $is_first = $p === 1; $class = $is_first ? 'active ' : ''; $color = ! empty( $pagebreak['color'] ) ? $pagebreak['color'] : ''; $width = 100 / ( count( $pagebreak['pages'] ) ) . '%'; printf( '
', sanitize_html_class( $class ), absint( $p ), esc_attr( $width ) ); printf( '%d', $is_first && ! empty( $color ) ? ' style="background-color:' . sanitize_hex_color( $color ) . '"' : '', absint( $p ) ); printf( '', $is_first && ! empty( $color ) ? ' style="border-top-color:' . sanitize_hex_color( $color ) . '"' : '' ); if ( ! empty( $page['title'] ) ) { printf( '%s', esc_html( $page['title'] ) ); } echo '
'; $p ++; } } elseif ( 'progress' === $pagebreak['indicator'] ) { // Progress theme. $p1 = ! empty( $pagebreak['pages'][0]['title'] ) ? $pagebreak['pages'][0]['title'] : ''; $width = 100 / count( $pagebreak['pages'] ) . '%'; $names = []; $background_color = ! empty( $pagebreak['color'] ) ? $pagebreak['color'] : ''; foreach ( $pagebreak['pages'] as $page ) { if ( ! empty( $page['title'] ) ) { $names[ sprintf( 'page-%d-title', $p ) ] = $page['title']; } $p ++; } printf( '%s', wpforms_html_attributes( '', [], $names ), esc_html( $p1 ) ); printf( ' - ', empty( $p1 ) ? 'style="display:none;"' : '' ); printf( /* translators: %1$s - current step in multi-page form; %2$d - total number of pages. */ '' . esc_html__( 'Step %1$s of %2$d', 'wpforms' ) . '', '1', count( $pagebreak['pages'] ) ); printf( '
', esc_attr( $width ), ! empty( $background_color ) ? 'background-color:' . sanitize_hex_color( $background_color ) : '' ); } do_action( 'wpforms_pagebreak_indicator', $pagebreak, $form_data ); echo '
'; } /** * Display frontend markup for the beginning of the first pagebreak. * * @since 1.3.7 * * @param array $form_data Form data and settings. */ public function display_fields_before( $form_data ) { // Check if we have an opening pagebreak, if not then bail. $field = ! empty( wpforms()->get( 'frontend' )->pages['top'] ) ? wpforms()->get( 'frontend' )->pages['top'] : false; if ( ! $field ) { return; } $css = ! empty( $field['css'] ) ? $field['css'] : ''; echo '
'; /** * Fires before all fields on the page. * * @since 1.7.8 * * @param array $field Field data and settings. * @param array $form_data Form data and settings. */ do_action( 'wpforms_field_page_break_page_fields_before', $field, $form_data ); } /** * Display frontend markup for the end of the last pagebreak. * * @since 1.3.7 * * @param array $form_data Form data and settings. */ public function display_fields_after( $form_data ) { if ( empty( wpforms()->get( 'frontend' )->pages ) ) { return; } // If we don't have a bottom pagebreak, the form is pre-v1.2.1 and // this is for backwards compatibility. $bottom = ! empty( wpforms()->get( 'frontend' )->pages['bottom'] ) ? wpforms()->get( 'frontend' )->pages['top'] : false; if ( ! $bottom ) { $prev = ! empty( $form_data['settings']['pagebreak_prev'] ) ? $form_data['settings']['pagebreak_prev'] : esc_html__( 'Previous', 'wpforms' ); echo '
'; printf( '', absint( wpforms()->get( 'frontend' )->pages['current'] + 1 ), absint( $form_data['id'] ), esc_html( $prev ) ); echo '
'; } $field = ! empty( wpforms()->get( 'frontend' )->pages['bottom'] ) ? wpforms()->get( 'frontend' )->pages['bottom'] : $bottom; /** * Fires after all fields on the page. * * @since 1.7.8 * * @param array $field Field data and settings. * @param array $form_data Form data and settings. */ do_action( 'wpforms_field_page_break_page_fields_after', $field, $form_data ); echo '
'; } /** * Display frontend markup to end current page and begin the next. * * @since 1.3.7 * * @param array $field Field data and settings. * @param array $form_data Form data and settings. */ public function display_field_after( $field, $form_data ) { if ( $field['type'] !== 'pagebreak' ) { return; } $total = wpforms()->get( 'frontend' )->pages['total']; $current = wpforms()->get( 'frontend' )->pages['current']; if ( ( empty( $field['position'] ) || $field['position'] !== 'top' ) && $current !== $total ) { $next = $current + 1; $last = $next === $total ? 'last' : ''; $css = ! empty( $field['css'] ) ? $field['css'] : ''; /** * Fires after all fields on the page. * * @since 1.7.8 * * @param array $field Field data and settings. * @param array $form_data Form data and settings. */ do_action( 'wpforms_field_page_break_page_fields_after', $field, $form_data ); printf( '