PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.5
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.5
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / styles / _styles-list.php

_styles-list.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.5, at classes/views/styles/_styles-list.php

89 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5 // This partial view is used in the visual styler sidebar in "list" view.
6 // It lists all styles and allows the user to select and assign a style to a target form.
7 // It is accessed from /wp-admin/admin.php?page=formidable-styles&form=782
8
9 $frm_settings = FrmAppHelper::get_settings();
10 $globally_disabled = 'none' === $frm_settings->load_style;
11 $enabled = '0' !== $form->options['custom_style'] && ! $globally_disabled;
12 $card_helper = new FrmStylesCardHelper( $active_style, $default_style, $form->id, $enabled );
13 $styles = $card_helper->get_styles();
14 $custom_styles = $card_helper->filter_custom_styles( $styles );
15 $sidebar_params = array(
16 'id' => 'frm_style_sidebar',
17 'class' => 'frm-right-panel frm-p-6 frm_wrap', // Make sure not to put .frm_wrap on the whole container because it will cause admin styles to apply to style cards.
18 );
19 $toggle_input_html = array();
20 if ( $globally_disabled ) {
21 $sidebar_params['class'] .= ' frm-styles-globally-disabled';
22 $toggle_input_html['disabled'] = 'disabled';
23 }
24 ?>
25 <div <?php FrmAppHelper::array_to_html_params( $sidebar_params, true ); ?>>
26 <?php
27 $can_create_styles = class_exists( 'FrmProStylesPreviewHelper' );
28 $trigger_params = array(
29 'id' => 'frm_new_style_trigger',
30 'href' => '#',
31 );
32 if ( $can_create_styles ) {
33 $trigger_params['data-new-style-url'] = esc_url( admin_url( 'admin.php?page=formidable-styles&frm_action=new_style' ) );
34 } else {
35 $trigger_params['class'] = 'frm_noallow';
36 $trigger_params['data-upgrade'] = __( 'You are currently limited to 1 style template', 'formidable' );
37 $trigger_params['data-message'] = __( 'Upgrade to create and manage as many form styles as you need.', 'formidable' );
38 $trigger_params['data-image'] = 'styles-upsell.svg';
39 }
40 ?>
41 <?php // This form isn't visible. It's just used for assigning the selected style id to the target form. ?>
42 <form id="frm_style_list_form" method="post" action="<?php echo esc_url( FrmStylesHelper::get_list_url( $form->id ) ); ?>">
43 <input type="hidden" name="style_id" value="<?php echo absint( $enabled ? $active_style->ID : 0 ); ?>" />
44 <input type="hidden" name="form_id" value="<?php echo absint( $form->id ); ?>" />
45 <input type="hidden" name="frm_action" value="assign_style" />
46 <?php wp_nonce_field( 'frm_save_form_style_nonce', 'frm_save_form_style' ); ?>
47 </form>
48 <div class="frm-mb-sm frm-flex-justify">
49 <?php
50 FrmHtmlHelper::toggle(
51 'frm_enable_styling',
52 'frm_enable_styling',
53 array(
54 'checked' => $enabled,
55 'on_label' => __( 'Enable Formidable styling', 'formidable' ),
56 'show_labels' => true,
57 'echo' => true,
58 'input_html' => $toggle_input_html,
59 )
60 );
61 ?>
62 <div id="frm_new_style_trigger_wrapper">
63 <a <?php FrmAppHelper::array_to_html_params( $trigger_params, true ); ?>>
64 <?php
65 FrmAppHelper::icon_by_class( 'frmfont frm_plus_icon' );
66 esc_html_e( 'New Style', 'formidable' );
67 ?>
68 </a>
69 </div>
70 </div>
71
72 <div class="frm_form_settings">
73 <h2><?php esc_html_e( 'Default Style', 'formidable' ); ?></h2>
74 </div>
75 <?php $card_helper->echo_card_wrapper( 'frm_default_style_cards_wrapper', array( $default_style ) ); ?>
76
77 <?php if ( $custom_styles ) { ?>
78 <div class="frm_form_settings">
79 <h2><?php esc_html_e( 'Custom Styles', 'formidable' ); ?></h2>
80 </div>
81 <?php $card_helper->echo_card_wrapper( 'frm_custom_style_cards_wrapper', $custom_styles ); ?>
82 <?php } ?>
83
84 <div class="frm_form_settings">
85 <h2><?php esc_html_e( 'Formidable Styles', 'formidable' ); ?></h2>
86 </div>
87 <?php $card_helper->echo_card_wrapper( 'frm_template_style_cards_wrapper', $card_helper->get_template_info() ); ?>
88 </div>
89