PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.8.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.8.2
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.8.2, at classes/views/styles/_styles-list.php

92 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 !== (int) $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 // Make sure not to put .frm_wrap on the whole container because it will cause admin styles to apply to style cards.
18 'class' => 'frm-right-panel frm-p-6 frm_wrap',
19 );
20 $toggle_input_html = array();
21 if ( $globally_disabled ) {
22 $sidebar_params['class'] .= ' frm-styles-globally-disabled';
23 $toggle_input_html['disabled'] = 'disabled';
24 }
25 ?>
26 <div <?php FrmAppHelper::array_to_html_params( $sidebar_params, true ); ?>>
27 <?php
28 $can_create_styles = class_exists( 'FrmProStylesPreviewHelper' );
29 $trigger_params = array(
30 'id' => 'frm_new_style_trigger',
31 'href' => '#',
32 );
33 if ( $can_create_styles ) {
34 $trigger_params['data-new-style-url'] = esc_url( admin_url( 'admin.php?page=formidable-styles&frm_action=new_style' ) );
35 } else {
36 $trigger_params['class'] = 'frm_noallow';
37 $trigger_params['data-upgrade'] = __( 'You are currently limited to 1 style template', 'formidable' );
38 $trigger_params['data-message'] = __( 'Upgrade to create and manage as many form styles as you need.', 'formidable' );
39 $trigger_params['data-image'] = 'styles-upsell.svg';
40 }
41 ?>
42 <?php
43 // This form isn't visible. It's just used for assigning the selected style id to the target form.
44 ?>
45 <form id="frm_style_list_form" method="post" action="<?php echo esc_url( FrmStylesHelper::get_list_url( $form->id ) ); ?>">
46 <input type="hidden" name="style_id" value="<?php echo absint( $enabled ? $active_style->ID : 0 ); ?>" />
47 <input type="hidden" name="form_id" value="<?php echo absint( $form->id ); ?>" />
48 <input type="hidden" name="frm_action" value="assign_style" />
49 <?php wp_nonce_field( 'frm_save_form_style_nonce', 'frm_save_form_style' ); ?>
50 </form>
51 <div class="frm-mb-sm frm-flex-justify">
52 <?php
53 FrmHtmlHelper::toggle(
54 'frm_enable_styling',
55 'frm_enable_styling',
56 array(
57 'checked' => $enabled,
58 'on_label' => __( 'Enable Formidable styling', 'formidable' ),
59 'show_labels' => true,
60 'echo' => true,
61 'input_html' => $toggle_input_html,
62 )
63 );
64 ?>
65 <div id="frm_new_style_trigger_wrapper">
66 <a <?php FrmAppHelper::array_to_html_params( $trigger_params, true ); ?>>
67 <?php
68 FrmAppHelper::icon_by_class( 'frmfont frm_plus_icon' );
69 esc_html_e( 'New Style', 'formidable' );
70 ?>
71 </a>
72 </div>
73 </div>
74
75 <div class="frm_form_settings">
76 <h2><?php esc_html_e( 'Default Style', 'formidable' ); ?></h2>
77 </div>
78 <?php $card_helper->echo_card_wrapper( 'frm_default_style_cards_wrapper', array( $default_style ) ); ?>
79
80 <?php if ( $custom_styles ) { ?>
81 <div class="frm_form_settings">
82 <h2><?php esc_html_e( 'Custom Styles', 'formidable' ); ?></h2>
83 </div>
84 <?php $card_helper->echo_card_wrapper( 'frm_custom_style_cards_wrapper', $custom_styles ); ?>
85 <?php } ?>
86
87 <div class="frm_form_settings">
88 <h2><?php esc_html_e( 'Formidable Styles', 'formidable' ); ?></h2>
89 </div>
90 <?php $card_helper->echo_card_wrapper( 'frm_template_style_cards_wrapper', $card_helper->get_template_info() ); ?>
91 </div>
92