@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | <a href="?page=formidable-styles&page-tab=default#tabs-panel-default-color" class="nav-tab-link" data-type="tabs-panel-default-color"><?php _e( 'Default', 'formidable' ) ?></a> |
| 5 | 5 | </li> |
| 6 | 6 | <li <?php echo ( 'active-color' == $current_tab ? ' class="tabs"' : '' ); ?>> |
| 7 | - <a href="<?php echo esc_url('?page=formidable-styles&page-tab=active-color#page-active-color') ?>" class="nav-tab-link" data-type="tabs-panel-active-color"><?php _e( 'Active', 'formidable' ) ?></a> |
|
| 7 | + <a href="<?php echo esc_url( '?page=formidable-styles&page-tab=active-color#page-active-color' ) ?>" class="nav-tab-link" data-type="tabs-panel-active-color"><?php _e( 'Active', 'formidable' ) ?></a> |
|
| 8 | 8 | </li> |
| 9 | 9 | <li <?php echo ( 'active-error' == $current_tab ? ' class="tabs"' : '' ); ?>> |
| 10 | 10 | <a href="?page=formidable-styles&page-tab=active-error#tabs-panel-active-error" class="nav-tab-link" data-type="tabs-panel-active-error"><?php _e( 'Error', 'formidable' ) ?></a> |
@@ -19,34 +19,34 @@ discard block |
||
| 19 | 19 | ?>"> |
| 20 | 20 | <div class="field-group field-group-border clearfix"> |
| 21 | 21 | <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label> |
| 22 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color') ) ?>" id="frm_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color'] ) ?>" /> |
|
| 22 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color' ) ) ?>" id="frm_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color'] ) ?>" /> |
|
| 23 | 23 | </div> |
| 24 | 24 | <div class="field-group clearfix"> |
| 25 | 25 | <label><?php _e( 'Text', 'formidable' ) ?></label> |
| 26 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color') ) ?>" id="frm_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['text_color'] ) ?>" /> |
|
| 26 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color' ) ) ?>" id="frm_text_color" class="hex" value="<?php echo esc_attr( $style->post_content['text_color'] ) ?>" /> |
|
| 27 | 27 | </div> |
| 28 | 28 | |
| 29 | 29 | <div class="field-group field-group-border clearfix"> |
| 30 | 30 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
| 31 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color') ) ?>" id="frm_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['border_color'] ) ?>" /> |
|
| 31 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color' ) ) ?>" id="frm_border_color" class="hex" value="<?php echo esc_attr( $style->post_content['border_color'] ) ?>" /> |
|
| 32 | 32 | </div> |
| 33 | 33 | <div class="field-group clearfix"> |
| 34 | 34 | <label><?php _e( 'Thickness', 'formidable' ) ?></label> |
| 35 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_border_width') ) ?>" id="frm_field_border_width" value="<?php echo esc_attr( $style->post_content['field_border_width'] ) ?>" size="4" /> |
|
| 35 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_border_width' ) ) ?>" id="frm_field_border_width" value="<?php echo esc_attr( $style->post_content['field_border_width'] ) ?>" size="4" /> |
|
| 36 | 36 | </div> |
| 37 | 37 | <div class="field-group clearfix"> |
| 38 | 38 | <label><?php _e( 'Style', 'formidable' ) ?></label> |
| 39 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('field_border_style') ) ?>" id="frm_field_border_style"> |
|
| 40 | - <option value="solid" <?php selected($style->post_content['field_border_style'], 'solid') ?>><?php _e( 'solid', 'formidable' ) ?></option> |
|
| 41 | - <option value="dotted" <?php selected($style->post_content['field_border_style'], 'dotted') ?>><?php _e( 'dotted', 'formidable' ) ?></option> |
|
| 42 | - <option value="dashed" <?php selected($style->post_content['field_border_style'], 'dashed') ?>><?php _e( 'dashed', 'formidable' ) ?></option> |
|
| 43 | - <option value="double" <?php selected($style->post_content['field_border_style'], 'double') ?>><?php _e( 'double', 'formidable' ) ?></option> |
|
| 39 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'field_border_style' ) ) ?>" id="frm_field_border_style"> |
|
| 40 | + <option value="solid" <?php selected( $style->post_content['field_border_style'], 'solid' ) ?>><?php _e( 'solid', 'formidable' ) ?></option> |
|
| 41 | + <option value="dotted" <?php selected( $style->post_content['field_border_style'], 'dotted' ) ?>><?php _e( 'dotted', 'formidable' ) ?></option> |
|
| 42 | + <option value="dashed" <?php selected( $style->post_content['field_border_style'], 'dashed' ) ?>><?php _e( 'dashed', 'formidable' ) ?></option> |
|
| 43 | + <option value="double" <?php selected( $style->post_content['field_border_style'], 'double' ) ?>><?php _e( 'double', 'formidable' ) ?></option> |
|
| 44 | 44 | </select> |
| 45 | 45 | </div> |
| 46 | 46 | <div class="clear"></div> |
| 47 | 47 | <p class="frm_no_bottom_margin"> |
| 48 | 48 | <label> |
| 49 | - <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('remove_box_shadow') ) ?>" id="frm_remove_box_shadow" value="1" <?php checked($style->post_content['remove_box_shadow'], 1) ?> /> |
|
| 49 | + <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'remove_box_shadow' ) ) ?>" id="frm_remove_box_shadow" value="1" <?php checked( $style->post_content['remove_box_shadow'], 1 ) ?> /> |
|
| 50 | 50 | <?php _e( 'Remove box shadow', 'formidable' ) ?> |
| 51 | 51 | </label> |
| 52 | 52 | </p> |
@@ -57,16 +57,16 @@ discard block |
||
| 57 | 57 | ?>"> |
| 58 | 58 | <div class="field-group field-group-border clearfix"> |
| 59 | 59 | <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label> |
| 60 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_active') ) ?>" id="frm_bg_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_active'] ) ?>" /> |
|
| 60 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_active' ) ) ?>" id="frm_bg_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_active'] ) ?>" /> |
|
| 61 | 61 | </div> |
| 62 | 62 | <div class="field-group clearfix"> |
| 63 | 63 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
| 64 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_active') ) ?>" id="frm_border_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_active'] ) ?>" /> |
|
| 64 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_active' ) ) ?>" id="frm_border_color_active" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_active'] ) ?>" /> |
|
| 65 | 65 | </div> |
| 66 | 66 | <div class="clear"></div> |
| 67 | 67 | <p class="frm_no_bottom_margin"> |
| 68 | 68 | <label> |
| 69 | - <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('remove_box_shadow_active') ) ?>" id="frm_remove_box_shadow_active" value="1" <?php checked($style->post_content['remove_box_shadow_active'], 1) ?> /> |
|
| 69 | + <input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'remove_box_shadow_active' ) ) ?>" id="frm_remove_box_shadow_active" value="1" <?php checked( $style->post_content['remove_box_shadow_active'], 1 ) ?> /> |
|
| 70 | 70 | <?php _e( 'Remove box shadow', 'formidable' ) ?> |
| 71 | 71 | </label> |
| 72 | 72 | </p> |
@@ -77,28 +77,28 @@ discard block |
||
| 77 | 77 | ?>"> |
| 78 | 78 | <div class="field-group field-group-border clearfix"> |
| 79 | 79 | <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label> |
| 80 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_error') ) ?>" id="frm_bg_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_error'] ) ?>" /> |
|
| 80 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_error' ) ) ?>" id="frm_bg_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_error'] ) ?>" /> |
|
| 81 | 81 | </div> |
| 82 | 82 | <div class="field-group clearfix"> |
| 83 | 83 | <label><?php _e( 'Text', 'formidable' ) ?></label> |
| 84 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color_error') ) ?>" id="frm_text_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_error'] ) ?>" /> |
|
| 84 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color_error' ) ) ?>" id="frm_text_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_error'] ) ?>" /> |
|
| 85 | 85 | </div> |
| 86 | 86 | |
| 87 | 87 | <div class="field-group field-group-border clearfix"> |
| 88 | 88 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
| 89 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_error') ) ?>" id="frm_border_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_error'] ) ?>" /> |
|
| 89 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_error' ) ) ?>" id="frm_border_color_error" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_error'] ) ?>" /> |
|
| 90 | 90 | </div> |
| 91 | 91 | <div class="field-group clearfix"> |
| 92 | 92 | <label><?php _e( 'Thickness', 'formidable' ) ?></label> |
| 93 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_width_error') ) ?>" id="frm_border_width_error" value="<?php echo esc_attr( $style->post_content['border_width_error'] ) ?>" size="4" /> |
|
| 93 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_width_error' ) ) ?>" id="frm_border_width_error" value="<?php echo esc_attr( $style->post_content['border_width_error'] ) ?>" size="4" /> |
|
| 94 | 94 | </div> |
| 95 | 95 | <div class="field-group clearfix"> |
| 96 | 96 | <label><?php _e( 'Style', 'formidable' ) ?></label> |
| 97 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('border_style_error') ) ?>" id="frm_border_style_error"> |
|
| 98 | - <option value="solid" <?php selected($style->post_content['border_style_error'], 'solid') ?>><?php _e( 'solid', 'formidable' ) ?></option> |
|
| 99 | - <option value="dotted" <?php selected($style->post_content['border_style_error'], 'dotted') ?>><?php _e( 'dotted', 'formidable' ) ?></option> |
|
| 100 | - <option value="dashed" <?php selected($style->post_content['border_style_error'], 'dashed') ?>><?php _e( 'dashed', 'formidable' ) ?></option> |
|
| 101 | - <option value="double" <?php selected($style->post_content['border_style_error'], 'double') ?>><?php _e( 'double', 'formidable' ) ?></option> |
|
| 97 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'border_style_error' ) ) ?>" id="frm_border_style_error"> |
|
| 98 | + <option value="solid" <?php selected( $style->post_content['border_style_error'], 'solid' ) ?>><?php _e( 'solid', 'formidable' ) ?></option> |
|
| 99 | + <option value="dotted" <?php selected( $style->post_content['border_style_error'], 'dotted' ) ?>><?php _e( 'dotted', 'formidable' ) ?></option> |
|
| 100 | + <option value="dashed" <?php selected( $style->post_content['border_style_error'], 'dashed' ) ?>><?php _e( 'dashed', 'formidable' ) ?></option> |
|
| 101 | + <option value="double" <?php selected( $style->post_content['border_style_error'], 'double' ) ?>><?php _e( 'double', 'formidable' ) ?></option> |
|
| 102 | 102 | </select> |
| 103 | 103 | </div> |
| 104 | 104 | |
@@ -110,16 +110,16 @@ discard block |
||
| 110 | 110 | ?>"> |
| 111 | 111 | <div class="field-group field-group-border clearfix"> |
| 112 | 112 | <label class="background"><?php _e( 'BG color', 'formidable' ) ?></label> |
| 113 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('bg_color_disabled') ) ?>" id="frm_bg_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_disabled'] ) ?>" /> |
|
| 113 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'bg_color_disabled' ) ) ?>" id="frm_bg_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['bg_color_disabled'] ) ?>" /> |
|
| 114 | 114 | </div> |
| 115 | 115 | <div class="field-group clearfix"> |
| 116 | 116 | <label><?php _e( 'Text', 'formidable' ) ?></label> |
| 117 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('text_color_disabled') ) ?>" id="frm_text_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_disabled'] ) ?>" /> |
|
| 117 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'text_color_disabled' ) ) ?>" id="frm_text_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['text_color_disabled'] ) ?>" /> |
|
| 118 | 118 | </div> |
| 119 | 119 | |
| 120 | 120 | <div class="field-group clearfix"> |
| 121 | 121 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
| 122 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('border_color_disabled') ) ?>" id="frm_border_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_disabled'] ) ?>" /> |
|
| 122 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_color_disabled' ) ) ?>" id="frm_border_color_disabled" class="hex" value="<?php echo esc_attr( $style->post_content['border_color_disabled'] ) ?>" /> |
|
| 123 | 123 | </div> |
| 124 | 124 | <div class="clear"></div> |
| 125 | 125 | </div><!-- /.tabs-panel --> |
@@ -1,42 +1,42 @@ |
||
| 1 | 1 | <div class="field-group clearfix frm-first-row"> |
| 2 | 2 | <label><?php _e( 'Size', 'formidable' ) ?></label> |
| 3 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_font_size') ) ?>" id="frm_field_font_size" value="<?php echo esc_attr( $style->post_content['field_font_size'] ) ?>" /> |
|
| 3 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_font_size' ) ) ?>" id="frm_field_font_size" value="<?php echo esc_attr( $style->post_content['field_font_size'] ) ?>" /> |
|
| 4 | 4 | </div> |
| 5 | 5 | |
| 6 | 6 | <div class="field-group clearfix frm-first-row"> |
| 7 | 7 | <label><?php _e( 'Height', 'formidable' ) ?></label> |
| 8 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_height') ) ?>" id="frm_field_height" value="<?php echo esc_attr( $style->post_content['field_height'] ) ?>" /> |
|
| 8 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_height' ) ) ?>" id="frm_field_height" value="<?php echo esc_attr( $style->post_content['field_height'] ) ?>" /> |
|
| 9 | 9 | </div> |
| 10 | 10 | |
| 11 | 11 | <div class="field-group clearfix frm-first-row"> |
| 12 | 12 | <label><?php _e( 'Width', 'formidable' ) ?></label> |
| 13 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_width') ) ?>" id="frm_field_width" value="<?php echo esc_attr( $style->post_content['field_width'] ) ?>" /> |
|
| 13 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_width' ) ) ?>" id="frm_field_width" value="<?php echo esc_attr( $style->post_content['field_width'] ) ?>" /> |
|
| 14 | 14 | </div> |
| 15 | 15 | |
| 16 | 16 | <div class="clear"></div> |
| 17 | 17 | <p class="frm_no_bottom_margin"> |
| 18 | - <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('auto_width') ) ?>" id="frm_auto_width" value="1" <?php checked( $style->post_content['auto_width'], 1 ) ?> /> |
|
| 18 | + <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'auto_width' ) ) ?>" id="frm_auto_width" value="1" <?php checked( $style->post_content['auto_width'], 1 ) ?> /> |
|
| 19 | 19 | <?php _e( 'Automatic Width for drop-down fields', 'formidable' ) ?></label> |
| 20 | 20 | </p> |
| 21 | 21 | |
| 22 | 22 | <div class="field-group clearfix"> |
| 23 | 23 | <label><?php _e( 'Padding', 'formidable' ) ?></label> |
| 24 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_pad') ) ?>" id="frm_field_pad" value="<?php echo esc_attr( $style->post_content['field_pad'] ) ?>" /> |
|
| 24 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_pad' ) ) ?>" id="frm_field_pad" value="<?php echo esc_attr( $style->post_content['field_pad'] ) ?>" /> |
|
| 25 | 25 | </div> |
| 26 | 26 | |
| 27 | 27 | <div class="field-group clearfix"> |
| 28 | 28 | <label><?php _e( 'Margin', 'formidable' ) ?></label> |
| 29 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('field_margin') ) ?>" id="frm_field_margin" value="<?php echo esc_attr( $style->post_content['field_margin'] ) ?>" /> |
|
| 29 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'field_margin' ) ) ?>" id="frm_field_margin" value="<?php echo esc_attr( $style->post_content['field_margin'] ) ?>" /> |
|
| 30 | 30 | </div> |
| 31 | 31 | |
| 32 | 32 | <div class="field-group clearfix"> |
| 33 | 33 | <label><?php _e( 'Corners', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Formidable uses CSS3 border-radius for corner rounding, which is not currently supported by Internet Explorer.', 'formidable' ) ?>" ></span></label> |
| 34 | - <input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name('border_radius') ) ?>" id="frm_border_radius" /> |
|
| 34 | + <input type="text" value="<?php echo esc_attr( $style->post_content['border_radius'] ) ?>" name="<?php echo esc_attr( $frm_style->get_field_name( 'border_radius' ) ) ?>" id="frm_border_radius" /> |
|
| 35 | 35 | </div> |
| 36 | 36 | |
| 37 | 37 | <div class="field-group clearfix frm-first-row"> |
| 38 | 38 | <label><?php _e( 'Weight', 'formidable' ) ?></label> |
| 39 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('field_weight') ) ?>" id="frm_field_weight"> |
|
| 39 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'field_weight' ) ) ?>" id="frm_field_weight"> |
|
| 40 | 40 | <?php foreach ( FrmStyle::get_bold_options() as $value => $name ) { ?> |
| 41 | 41 | <option value="<?php echo esc_attr( $value ) ?>" <?php selected( $style->post_content['field_weight'], $value ) ?>><?php echo $name ?></option> |
| 42 | 42 | <?php } ?> |
@@ -1,59 +1,59 @@ |
||
| 1 | 1 | <p> |
| 2 | - <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('center_form') ) ?>" id="frm_center_form" value="1" <?php checked($style->post_content['center_form'], 1) ?> /> |
|
| 2 | + <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'center_form' ) ) ?>" id="frm_center_form" value="1" <?php checked( $style->post_content['center_form'], 1 ) ?> /> |
|
| 3 | 3 | <?php _e( 'Center form on page', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'This will center your form on the page where it is published if the form width is less than the available width on the page.', 'formidable' ) ?>" ></span> |
| 4 | 4 | </label> |
| 5 | 5 | </p> |
| 6 | 6 | |
| 7 | 7 | <div class="field-group clearfix frm-first-row"> |
| 8 | 8 | <label><?php _e( 'Alignment', 'formidable' ) ?></label> |
| 9 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('form_align') ) ?>" id="frm_form_align"> |
|
| 10 | - <option value="left" <?php selected($style->post_content['form_align'], 'left') ?>><?php _e( 'left', 'formidable' ) ?></option> |
|
| 11 | - <option value="right" <?php selected($style->post_content['form_align'], 'right') ?>><?php _e( 'right', 'formidable' ) ?></option> |
|
| 12 | - <option value="center" <?php selected($style->post_content['form_align'], 'center') ?>><?php _e( 'center', 'formidable' ) ?></option> |
|
| 9 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'form_align' ) ) ?>" id="frm_form_align"> |
|
| 10 | + <option value="left" <?php selected( $style->post_content['form_align'], 'left' ) ?>><?php _e( 'left', 'formidable' ) ?></option> |
|
| 11 | + <option value="right" <?php selected( $style->post_content['form_align'], 'right' ) ?>><?php _e( 'right', 'formidable' ) ?></option> |
|
| 12 | + <option value="center" <?php selected( $style->post_content['form_align'], 'center' ) ?>><?php _e( 'center', 'formidable' ) ?></option> |
|
| 13 | 13 | </select> |
| 14 | 14 | </div> |
| 15 | 15 | |
| 16 | 16 | <div class="field-group clearfix frm-first-row"> |
| 17 | 17 | <label><?php _e( 'Max Width', 'formidable' ) ?></label> |
| 18 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_width') ) ?>" value="<?php echo esc_attr( $style->post_content['form_width'] ) ?>"/> |
|
| 18 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_width' ) ) ?>" value="<?php echo esc_attr( $style->post_content['form_width'] ) ?>"/> |
|
| 19 | 19 | </div> |
| 20 | 20 | |
| 21 | 21 | <div class="field-group clearfix frm-first-row"> |
| 22 | 22 | <label><?php _e( 'Background', 'formidable' ) ?></label> |
| 23 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_bg_color') ) ?>" id="frm_fieldset_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_bg_color'] ) ?>" size="4" /> |
|
| 23 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_bg_color' ) ) ?>" id="frm_fieldset_bg_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_bg_color'] ) ?>" size="4" /> |
|
| 24 | 24 | </div> |
| 25 | 25 | |
| 26 | 26 | <div class="field-group field-group-border clearfix"> |
| 27 | 27 | <label><?php _e( 'Border', 'formidable' ) ?></label> |
| 28 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset') ) ?>" id="frm_fieldset" value="<?php echo esc_attr( $style->post_content['fieldset'] ) ?>" size="4" /> |
|
| 28 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset' ) ) ?>" id="frm_fieldset" value="<?php echo esc_attr( $style->post_content['fieldset'] ) ?>" size="4" /> |
|
| 29 | 29 | </div> |
| 30 | 30 | |
| 31 | 31 | <div class="field-group clearfix"> |
| 32 | 32 | <label><?php _e( 'Color', 'formidable' ) ?></label> |
| 33 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_color') ) ?>" id="frm_fieldset_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_color'] ) ?>" /> |
|
| 33 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_color' ) ) ?>" id="frm_fieldset_color" class="hex" value="<?php echo esc_attr( $style->post_content['fieldset_color'] ) ?>" /> |
|
| 34 | 34 | </div> |
| 35 | 35 | |
| 36 | 36 | <div class="field-group clearfix"> |
| 37 | 37 | <label><?php _e( 'Padding', 'formidable' ) ?></label> |
| 38 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('fieldset_padding') ) ?>" id="frm_fieldset_padding" value="<?php echo esc_attr( $style->post_content['fieldset_padding'] ) ?>" size="4" /> |
|
| 38 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'fieldset_padding' ) ) ?>" id="frm_fieldset_padding" value="<?php echo esc_attr( $style->post_content['fieldset_padding'] ) ?>" size="4" /> |
|
| 39 | 39 | </div> |
| 40 | 40 | |
| 41 | 41 | <div id="frm_gen_font_box" class="field-group clearfix"> |
| 42 | 42 | <label><?php _e( 'Font Family', 'formidable' ) ?></label> |
| 43 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('font') ) ?>" id="frm_font" value="<?php echo esc_attr( $style->post_content['font'] ) ?>" class="frm_full_width" /> |
|
| 43 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'font' ) ) ?>" id="frm_font" value="<?php echo esc_attr( $style->post_content['font'] ) ?>" class="frm_full_width" /> |
|
| 44 | 44 | </div> |
| 45 | 45 | |
| 46 | 46 | <div class="field-group clearfix frm-half"> |
| 47 | 47 | <label><?php _e( 'Direction', 'formidable' ) ?></label> |
| 48 | - <select name="<?php echo esc_attr( $frm_style->get_field_name('direction') ) ?>" id="frm_direction"> |
|
| 49 | - <option value="ltr" <?php selected($style->post_content['direction'], 'ltr') ?>><?php _e( 'Left to Right', 'formidable' ) ?></option> |
|
| 50 | - <option value="rtl" <?php selected($style->post_content['direction'], 'rtl') ?>><?php _e( 'Right to Left', 'formidable' ) ?></option> |
|
| 48 | + <select name="<?php echo esc_attr( $frm_style->get_field_name( 'direction' ) ) ?>" id="frm_direction"> |
|
| 49 | + <option value="ltr" <?php selected( $style->post_content['direction'], 'ltr' ) ?>><?php _e( 'Left to Right', 'formidable' ) ?></option> |
|
| 50 | + <option value="rtl" <?php selected( $style->post_content['direction'], 'rtl' ) ?>><?php _e( 'Right to Left', 'formidable' ) ?></option> |
|
| 51 | 51 | </select> |
| 52 | 52 | </div> |
| 53 | 53 | |
| 54 | 54 | <div class="clear"></div> |
| 55 | 55 | <p class="frm_no_bottom_margin"> |
| 56 | - <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('important_style') ) ?>" id="frm_important_style" value="1" <?php checked($style->post_content['important_style'], 1) ?> /> |
|
| 56 | + <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name( 'important_style' ) ) ?>" id="frm_important_style" value="1" <?php checked( $style->post_content['important_style'], 1 ) ?> /> |
|
| 57 | 57 | <?php _e( 'Override theme styling', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'This will add !important to many of the lines in the Formidable styling to make sure it will be used.', 'formidable' ) ?>" ></span> |
| 58 | 58 | </label> |
| 59 | 59 | </p> |
@@ -121,6 +121,9 @@ |
||
| 121 | 121 | $stylesheet_urls['formidable'] = $url; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | + /** |
|
| 125 | + * @param string $version |
|
| 126 | + */ |
|
| 124 | 127 | private static function get_css_version( $css_key, $version ) { |
| 125 | 128 | if ( 'formidable' == $css_key ) { |
| 126 | 129 | $this_version = get_option( 'frm_last_style_update' ); |
@@ -41,23 +41,23 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public static function menu() { |
| 44 | - add_submenu_page('formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' ); |
|
| 44 | + add_submenu_page( 'formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' ); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public static function admin_init() { |
| 48 | - if ( ! FrmAppHelper::is_admin_page('formidable-styles') ) { |
|
| 48 | + if ( ! FrmAppHelper::is_admin_page( 'formidable-styles' ) ) { |
|
| 49 | 49 | return; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | self::load_pro_hooks(); |
| 53 | - wp_enqueue_script('jquery-ui-datepicker'); |
|
| 53 | + wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
| 54 | 54 | |
| 55 | 55 | $version = FrmAppHelper::plugin_version(); |
| 56 | 56 | wp_enqueue_script( 'jquery-frm-themepicker', FrmAppHelper::plugin_url() . '/js/jquery/jquery-ui-themepicker.js', array( 'jquery' ), $version ); |
| 57 | 57 | |
| 58 | - wp_enqueue_style( 'frm-custom-theme', admin_url('admin-ajax.php?action=frmpro_css' ) ); |
|
| 58 | + wp_enqueue_style( 'frm-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_css' ) ); |
|
| 59 | 59 | |
| 60 | - $style = apply_filters('frm_style_head', false); |
|
| 60 | + $style = apply_filters( 'frm_style_head', false ); |
|
| 61 | 61 | if ( $style ) { |
| 62 | 62 | wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) . '&' . http_build_query( $style->post_content ) ); |
| 63 | 63 | } |
@@ -143,17 +143,17 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | public static function new_style( $return = '' ) { |
| 146 | - self::load_styler('default'); |
|
| 146 | + self::load_styler( 'default' ); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | public static function duplicate() { |
| 150 | - self::load_styler('default'); |
|
| 150 | + self::load_styler( 'default' ); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | public static function edit( $style_id = false, $message = '' ) { |
| 154 | 154 | if ( ! $style_id ) { |
| 155 | 155 | $style_id = FrmAppHelper::get_param( 'id', '', 'get', 'absint' ); |
| 156 | - if ( empty($style_id) ) { |
|
| 156 | + if ( empty( $style_id ) ) { |
|
| 157 | 157 | $style_id = 'default'; |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -161,12 +161,12 @@ discard block |
||
| 161 | 161 | if ( 'default' == $style_id ) { |
| 162 | 162 | $style = 'default'; |
| 163 | 163 | } else { |
| 164 | - $frm_style = new FrmStyle($style_id); |
|
| 164 | + $frm_style = new FrmStyle( $style_id ); |
|
| 165 | 165 | $style = $frm_style->get_one(); |
| 166 | 166 | $style = $style->ID; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - self::load_styler($style, $message); |
|
| 169 | + self::load_styler( $style, $message ); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | public static function save() { |
@@ -176,17 +176,17 @@ discard block |
||
| 176 | 176 | $style_nonce = FrmAppHelper::get_post_param( 'frm_style', '', 'sanitize_text_field' ); |
| 177 | 177 | |
| 178 | 178 | if ( $post_id !== false && wp_verify_nonce( $style_nonce, 'frm_style_nonce' ) ) { |
| 179 | - $id = $frm_style->update($post_id); |
|
| 180 | - if ( empty($post_id) && ! empty($id) ) { |
|
| 179 | + $id = $frm_style->update( $post_id ); |
|
| 180 | + if ( empty( $post_id ) && ! empty( $id ) ) { |
|
| 181 | 181 | // set the post id to the new style so it will be loaded for editing |
| 182 | - $post_id = reset($id); |
|
| 182 | + $post_id = reset( $id ); |
|
| 183 | 183 | } |
| 184 | 184 | // include the CSS that includes this style |
| 185 | 185 | echo '<link href="' . esc_url( admin_url( 'admin-ajax.php?action=frmpro_css' ) ) . '" type="text/css" rel="Stylesheet" class="frm-custom-theme" />'; |
| 186 | 186 | $message = __( 'Your styling settings have been saved.', 'formidable' ); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - return self::edit($post_id, $message); |
|
| 189 | + return self::edit( $post_id, $message ); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | public static function load_styler( $style, $message = '' ) { |
@@ -195,10 +195,10 @@ discard block |
||
| 195 | 195 | $frm_style = new FrmStyle(); |
| 196 | 196 | $styles = $frm_style->get_all(); |
| 197 | 197 | |
| 198 | - if ( is_numeric($style) ) { |
|
| 199 | - $style = $styles[ $style ]; |
|
| 198 | + if ( is_numeric( $style ) ) { |
|
| 199 | + $style = $styles[$style]; |
|
| 200 | 200 | } else if ( 'default' == $style ) { |
| 201 | - $style = $frm_style->get_default_style($styles); |
|
| 201 | + $style = $frm_style->get_default_style( $styles ); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | self::add_meta_boxes(); |
@@ -213,9 +213,9 @@ discard block |
||
| 213 | 213 | private static function manage( $message = '', $forms = array() ) { |
| 214 | 214 | $frm_style = new FrmStyle(); |
| 215 | 215 | $styles = $frm_style->get_all(); |
| 216 | - $default_style = $frm_style->get_default_style($styles); |
|
| 216 | + $default_style = $frm_style->get_default_style( $styles ); |
|
| 217 | 217 | |
| 218 | - if ( empty($forms) ) { |
|
| 218 | + if ( empty( $forms ) ) { |
|
| 219 | 219 | $forms = FrmForm::get_published_forms(); |
| 220 | 220 | } |
| 221 | 221 | |
@@ -232,26 +232,26 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | $forms = FrmForm::get_published_forms(); |
| 234 | 234 | foreach ( $forms as $form ) { |
| 235 | - if ( $_POST['style'][ $form->id ] == $_POST['prev_style'][ $form->id ] ) { |
|
| 235 | + if ( $_POST['style'][$form->id] == $_POST['prev_style'][$form->id] ) { |
|
| 236 | 236 | continue; |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | - $form->options['custom_style'] = $_POST['style'][ $form->id ]; |
|
| 239 | + $form->options['custom_style'] = $_POST['style'][$form->id]; |
|
| 240 | 240 | |
| 241 | 241 | $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) ); |
| 242 | - unset($form); |
|
| 242 | + unset( $form ); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | $message = __( 'Your form styles have been saved.', 'formidable' ); |
| 246 | - return self::manage($message, $forms); |
|
| 246 | + return self::manage( $message, $forms ); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | public static function custom_css( $message = '', $style = null ) { |
| 250 | - wp_enqueue_style('codemirror', FrmAppHelper::plugin_url() . '/css/codemirror.css'); |
|
| 251 | - wp_enqueue_script('codemirror', FrmAppHelper::plugin_url() . '/js/codemirror/codemirror.js', array(), '4.7'); |
|
| 250 | + wp_enqueue_style( 'codemirror', FrmAppHelper::plugin_url() . '/css/codemirror.css' ); |
|
| 251 | + wp_enqueue_script( 'codemirror', FrmAppHelper::plugin_url() . '/js/codemirror/codemirror.js', array(), '4.7' ); |
|
| 252 | 252 | wp_enqueue_script( 'codemirror-css', FrmAppHelper::plugin_url() . '/js/codemirror/css.js', array( 'codemirror' ), '4.7' ); |
| 253 | 253 | |
| 254 | - if ( ! isset($style) ) { |
|
| 254 | + if ( ! isset( $style ) ) { |
|
| 255 | 255 | $frm_style = new FrmStyle(); |
| 256 | 256 | $style = $frm_style->get_default_style(); |
| 257 | 257 | } |
@@ -266,11 +266,11 @@ discard block |
||
| 266 | 266 | $post_id = FrmAppHelper::get_post_param( 'ID', false, 'sanitize_text_field' ); |
| 267 | 267 | $nonce = FrmAppHelper::get_post_param( 'frm_custom_css', '', 'sanitize_text_field' ); |
| 268 | 268 | if ( wp_verify_nonce( $nonce, 'frm_custom_css_nonce' ) ) { |
| 269 | - $frm_style->update($post_id); |
|
| 269 | + $frm_style->update( $post_id ); |
|
| 270 | 270 | $message = __( 'Your styling settings have been saved.', 'formidable' ); |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | - return self::custom_css($message); |
|
| 273 | + return self::custom_css( $message ); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | public static function route() { |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | public static function reset_styling() { |
| 302 | - FrmAppHelper::permission_check('frm_change_settings'); |
|
| 302 | + FrmAppHelper::permission_check( 'frm_change_settings' ); |
|
| 303 | 303 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 304 | 304 | |
| 305 | 305 | $frm_style = new FrmStyle(); |
@@ -317,8 +317,8 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | // remove the # from the colors |
| 319 | 319 | foreach ( $_GET['frm_style_setting']['post_content'] as $k => $v ) { |
| 320 | - if ( ! is_array($v) && strpos($v, '#') === 0 ) { |
|
| 321 | - $_GET['frm_style_setting']['post_content'][ $k ] = str_replace( '#', '', $v ); |
|
| 320 | + if ( ! is_array( $v ) && strpos( $v, '#' ) === 0 ) { |
|
| 321 | + $_GET['frm_style_setting']['post_content'][$k] = str_replace( '#', '', $v ); |
|
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | |
@@ -348,18 +348,18 @@ discard block |
||
| 348 | 348 | |
| 349 | 349 | foreach ( $meta_boxes as $nicename => $name ) { |
| 350 | 350 | add_meta_box( $nicename . '-style', $name, 'FrmStylesController::include_style_section', self::$screen, 'side', 'default', $nicename ); |
| 351 | - unset($nicename, $name); |
|
| 351 | + unset( $nicename, $name ); |
|
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | public static function include_style_section( $atts, $sec ) { |
| 356 | - extract($atts); |
|
| 356 | + extract( $atts ); |
|
| 357 | 357 | $current_tab = FrmAppHelper::simple_get( 'page-tab', 'sanitize_title', 'default' ); |
| 358 | 358 | include( FrmAppHelper::plugin_path() . '/classes/views/styles/_' . $sec['args'] . '.php' ); |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | public static function load_css() { |
| 362 | - header('Content-type: text/css'); |
|
| 362 | + header( 'Content-type: text/css' ); |
|
| 363 | 363 | |
| 364 | 364 | $frm_style = new FrmStyle(); |
| 365 | 365 | $defaults = $frm_style->get_defaults(); |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $style = 'default'; |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | - $frm_style = new FrmStyle($style); |
|
| 426 | + $frm_style = new FrmStyle( $style ); |
|
| 427 | 427 | $style = $frm_style->get_one(); |
| 428 | 428 | |
| 429 | 429 | if ( $style ) { |
@@ -437,14 +437,14 @@ discard block |
||
| 437 | 437 | * @param string $val |
| 438 | 438 | */ |
| 439 | 439 | public static function get_style_val( $val, $form = 'default' ) { |
| 440 | - $style = self::get_form_style($form); |
|
| 441 | - if ( $style && isset( $style->post_content[ $val ] ) ) { |
|
| 442 | - return $style->post_content[ $val ]; |
|
| 440 | + $style = self::get_form_style( $form ); |
|
| 441 | + if ( $style && isset( $style->post_content[$val] ) ) { |
|
| 442 | + return $style->post_content[$val]; |
|
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | public static function show_entry_styles( $default_styles ) { |
| 447 | - $frm_style = new FrmStyle('default'); |
|
| 447 | + $frm_style = new FrmStyle( 'default' ); |
|
| 448 | 448 | $style = $frm_style->get_one(); |
| 449 | 449 | |
| 450 | 450 | if ( ! $style ) { |
@@ -458,15 +458,15 @@ discard block |
||
| 458 | 458 | } else if ( 'alt_bg_color' == $name ) { |
| 459 | 459 | $setting = 'bg_color_active'; |
| 460 | 460 | } |
| 461 | - $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
| 462 | - unset($name, $val); |
|
| 461 | + $default_styles[$name] = $style->post_content[$setting]; |
|
| 462 | + unset( $name, $val ); |
|
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | return $default_styles; |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | public static function &important_style( $important, $field ) { |
| 469 | - $important = self::get_style_val('important_style', $field['form_id']); |
|
| 469 | + $important = self::get_style_val( 'important_style', $field['form_id'] ); |
|
| 470 | 470 | return $important; |
| 471 | 471 | } |
| 472 | 472 | |
@@ -492,18 +492,18 @@ discard block |
||
| 492 | 492 | $i = 0; |
| 493 | 493 | $first_open = false; |
| 494 | 494 | do { |
| 495 | - if ( ! isset( $wp_meta_boxes ) || ! isset( $wp_meta_boxes[ $page ] ) || ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) { |
|
| 495 | + if ( ! isset( $wp_meta_boxes ) || ! isset( $wp_meta_boxes[$page] ) || ! isset( $wp_meta_boxes[$page][$context] ) ) { |
|
| 496 | 496 | break; |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { |
| 500 | - if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { |
|
| 501 | - foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) { |
|
| 500 | + if ( isset( $wp_meta_boxes[$page][$context][$priority] ) ) { |
|
| 501 | + foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) { |
|
| 502 | 502 | if ( false == $box || ! $box['title'] ) { |
| 503 | 503 | continue; |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | - $i++; |
|
| 506 | + $i ++; |
|
| 507 | 507 | $hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : ''; |
| 508 | 508 | |
| 509 | 509 | if ( ! $first_open && empty( $hidden_class ) ) { |
@@ -1,21 +1,21 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class FrmStylesController { |
| 4 | - public static $post_type = 'frm_styles'; |
|
| 5 | - public static $screen = 'formidable_page_formidable-styles'; |
|
| 6 | - |
|
| 7 | - public static function load_pro_hooks() { |
|
| 8 | - if ( FrmAppHelper::pro_is_installed() ) { |
|
| 9 | - FrmProStylesController::load_pro_hooks(); |
|
| 10 | - } |
|
| 11 | - } |
|
| 12 | - |
|
| 13 | - public static function register_post_types() { |
|
| 14 | - register_post_type( self::$post_type, array( |
|
| 15 | - 'label' => __( 'Styles', 'formidable' ), |
|
| 16 | - 'public' => false, |
|
| 17 | - 'show_ui' => false, |
|
| 18 | - 'capability_type' => 'page', |
|
| 4 | + public static $post_type = 'frm_styles'; |
|
| 5 | + public static $screen = 'formidable_page_formidable-styles'; |
|
| 6 | + |
|
| 7 | + public static function load_pro_hooks() { |
|
| 8 | + if ( FrmAppHelper::pro_is_installed() ) { |
|
| 9 | + FrmProStylesController::load_pro_hooks(); |
|
| 10 | + } |
|
| 11 | + } |
|
| 12 | + |
|
| 13 | + public static function register_post_types() { |
|
| 14 | + register_post_type( self::$post_type, array( |
|
| 15 | + 'label' => __( 'Styles', 'formidable' ), |
|
| 16 | + 'public' => false, |
|
| 17 | + 'show_ui' => false, |
|
| 18 | + 'capability_type' => 'page', |
|
| 19 | 19 | 'capabilities' => array( |
| 20 | 20 | 'edit_post' => 'frm_change_settings', |
| 21 | 21 | 'edit_posts' => 'frm_change_settings', |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | 'delete_posts' => 'frm_change_settings', |
| 26 | 26 | 'read_private_posts' => 'read_private_posts', |
| 27 | 27 | ), |
| 28 | - 'supports' => array( |
|
| 28 | + 'supports' => array( |
|
| 29 | 29 | 'title', |
| 30 | - ), |
|
| 31 | - 'has_archive' => false, |
|
| 32 | - 'labels' => array( |
|
| 30 | + ), |
|
| 31 | + 'has_archive' => false, |
|
| 32 | + 'labels' => array( |
|
| 33 | 33 | 'name' => __( 'Styles', 'formidable' ), |
| 34 | 34 | 'singular_name' => __( 'Style', 'formidable' ), |
| 35 | 35 | 'menu_name' => __( 'Style', 'formidable' ), |
@@ -37,19 +37,19 @@ discard block |
||
| 37 | 37 | 'add_new_item' => __( 'Create a New Style', 'formidable' ), |
| 38 | 38 | 'edit_item' => __( 'Edit Style', 'formidable' ), |
| 39 | 39 | ), |
| 40 | - ) ); |
|
| 41 | - } |
|
| 40 | + ) ); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - public static function menu() { |
|
| 43 | + public static function menu() { |
|
| 44 | 44 | add_submenu_page('formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' ); |
| 45 | - } |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - public static function admin_init() { |
|
| 48 | - if ( ! FrmAppHelper::is_admin_page('formidable-styles') ) { |
|
| 49 | - return; |
|
| 50 | - } |
|
| 47 | + public static function admin_init() { |
|
| 48 | + if ( ! FrmAppHelper::is_admin_page('formidable-styles') ) { |
|
| 49 | + return; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - self::load_pro_hooks(); |
|
| 52 | + self::load_pro_hooks(); |
|
| 53 | 53 | |
| 54 | 54 | $style_tab = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' ); |
| 55 | 55 | if ( $style_tab == 'manage' || $style_tab == 'custom_css' ) { |
@@ -57,18 +57,18 @@ discard block |
||
| 57 | 57 | return; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - wp_enqueue_script('jquery-ui-datepicker'); |
|
| 60 | + wp_enqueue_script('jquery-ui-datepicker'); |
|
| 61 | 61 | |
| 62 | - $version = FrmAppHelper::plugin_version(); |
|
| 62 | + $version = FrmAppHelper::plugin_version(); |
|
| 63 | 63 | wp_enqueue_script( 'jquery-frm-themepicker', FrmAppHelper::plugin_url() . '/js/jquery/jquery-ui-themepicker.js', array( 'jquery' ), $version ); |
| 64 | 64 | |
| 65 | 65 | wp_enqueue_style( 'frm-custom-theme', admin_url('admin-ajax.php?action=frmpro_css' ) ); |
| 66 | 66 | |
| 67 | - $style = apply_filters('frm_style_head', false); |
|
| 68 | - if ( $style ) { |
|
| 67 | + $style = apply_filters('frm_style_head', false); |
|
| 68 | + if ( $style ) { |
|
| 69 | 69 | wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) . '&' . http_build_query( $style->post_content ) ); |
| 70 | - } |
|
| 71 | - } |
|
| 70 | + } |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | 73 | public static function enqueue_css( $register = 'enqueue' ) { |
| 74 | 74 | global $frm_vars; |
@@ -162,230 +162,230 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | public static function new_style( $return = '' ) { |
| 165 | - self::load_styler('default'); |
|
| 166 | - } |
|
| 165 | + self::load_styler('default'); |
|
| 166 | + } |
|
| 167 | 167 | |
| 168 | 168 | public static function duplicate() { |
| 169 | 169 | self::load_styler('default'); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | public static function edit( $style_id = false, $message = '' ) { |
| 173 | - if ( ! $style_id ) { |
|
| 173 | + if ( ! $style_id ) { |
|
| 174 | 174 | $style_id = FrmAppHelper::get_param( 'id', '', 'get', 'absint' ); |
| 175 | - if ( empty($style_id) ) { |
|
| 176 | - $style_id = 'default'; |
|
| 177 | - } |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - if ( 'default' == $style_id ) { |
|
| 181 | - $style = 'default'; |
|
| 182 | - } else { |
|
| 183 | - $frm_style = new FrmStyle($style_id); |
|
| 184 | - $style = $frm_style->get_one(); |
|
| 185 | - $style = $style->ID; |
|
| 186 | - } |
|
| 187 | - |
|
| 188 | - self::load_styler($style, $message); |
|
| 189 | - } |
|
| 190 | - |
|
| 191 | - public static function save() { |
|
| 192 | - $frm_style = new FrmStyle(); |
|
| 193 | - $message = ''; |
|
| 175 | + if ( empty($style_id) ) { |
|
| 176 | + $style_id = 'default'; |
|
| 177 | + } |
|
| 178 | + } |
|
| 179 | + |
|
| 180 | + if ( 'default' == $style_id ) { |
|
| 181 | + $style = 'default'; |
|
| 182 | + } else { |
|
| 183 | + $frm_style = new FrmStyle($style_id); |
|
| 184 | + $style = $frm_style->get_one(); |
|
| 185 | + $style = $style->ID; |
|
| 186 | + } |
|
| 187 | + |
|
| 188 | + self::load_styler($style, $message); |
|
| 189 | + } |
|
| 190 | + |
|
| 191 | + public static function save() { |
|
| 192 | + $frm_style = new FrmStyle(); |
|
| 193 | + $message = ''; |
|
| 194 | 194 | $post_id = FrmAppHelper::get_post_param( 'ID', false, 'sanitize_title' ); |
| 195 | 195 | $style_nonce = FrmAppHelper::get_post_param( 'frm_style', '', 'sanitize_text_field' ); |
| 196 | 196 | |
| 197 | 197 | if ( $post_id !== false && wp_verify_nonce( $style_nonce, 'frm_style_nonce' ) ) { |
| 198 | - $id = $frm_style->update($post_id); |
|
| 199 | - if ( empty($post_id) && ! empty($id) ) { |
|
| 200 | - // set the post id to the new style so it will be loaded for editing |
|
| 201 | - $post_id = reset($id); |
|
| 202 | - } |
|
| 203 | - // include the CSS that includes this style |
|
| 198 | + $id = $frm_style->update($post_id); |
|
| 199 | + if ( empty($post_id) && ! empty($id) ) { |
|
| 200 | + // set the post id to the new style so it will be loaded for editing |
|
| 201 | + $post_id = reset($id); |
|
| 202 | + } |
|
| 203 | + // include the CSS that includes this style |
|
| 204 | 204 | echo '<link href="' . esc_url( admin_url( 'admin-ajax.php?action=frmpro_css' ) ) . '" type="text/css" rel="Stylesheet" class="frm-custom-theme" />'; |
| 205 | - $message = __( 'Your styling settings have been saved.', 'formidable' ); |
|
| 206 | - } |
|
| 205 | + $message = __( 'Your styling settings have been saved.', 'formidable' ); |
|
| 206 | + } |
|
| 207 | 207 | |
| 208 | - return self::edit($post_id, $message); |
|
| 209 | - } |
|
| 208 | + return self::edit($post_id, $message); |
|
| 209 | + } |
|
| 210 | 210 | |
| 211 | 211 | public static function load_styler( $style, $message = '' ) { |
| 212 | - global $frm_settings; |
|
| 212 | + global $frm_settings; |
|
| 213 | 213 | |
| 214 | - $frm_style = new FrmStyle(); |
|
| 215 | - $styles = $frm_style->get_all(); |
|
| 214 | + $frm_style = new FrmStyle(); |
|
| 215 | + $styles = $frm_style->get_all(); |
|
| 216 | 216 | |
| 217 | - if ( is_numeric($style) ) { |
|
| 218 | - $style = $styles[ $style ]; |
|
| 219 | - } else if ( 'default' == $style ) { |
|
| 220 | - $style = $frm_style->get_default_style($styles); |
|
| 221 | - } |
|
| 217 | + if ( is_numeric($style) ) { |
|
| 218 | + $style = $styles[ $style ]; |
|
| 219 | + } else if ( 'default' == $style ) { |
|
| 220 | + $style = $frm_style->get_default_style($styles); |
|
| 221 | + } |
|
| 222 | 222 | |
| 223 | - self::add_meta_boxes(); |
|
| 223 | + self::add_meta_boxes(); |
|
| 224 | 224 | |
| 225 | 225 | include( FrmAppHelper::plugin_path() . '/classes/views/styles/show.php' ); |
| 226 | - } |
|
| 226 | + } |
|
| 227 | 227 | |
| 228 | 228 | /** |
| 229 | 229 | * @param string $message |
| 230 | 230 | * @param array|object $forms |
| 231 | 231 | */ |
| 232 | 232 | private static function manage( $message = '', $forms = array() ) { |
| 233 | - $frm_style = new FrmStyle(); |
|
| 234 | - $styles = $frm_style->get_all(); |
|
| 235 | - $default_style = $frm_style->get_default_style($styles); |
|
| 233 | + $frm_style = new FrmStyle(); |
|
| 234 | + $styles = $frm_style->get_all(); |
|
| 235 | + $default_style = $frm_style->get_default_style($styles); |
|
| 236 | 236 | |
| 237 | - if ( empty($forms) ) { |
|
| 238 | - $forms = FrmForm::get_published_forms(); |
|
| 239 | - } |
|
| 237 | + if ( empty($forms) ) { |
|
| 238 | + $forms = FrmForm::get_published_forms(); |
|
| 239 | + } |
|
| 240 | 240 | |
| 241 | 241 | include( FrmAppHelper::plugin_path() . '/classes/views/styles/manage.php' ); |
| 242 | - } |
|
| 242 | + } |
|
| 243 | 243 | |
| 244 | - private static function manage_styles() { |
|
| 244 | + private static function manage_styles() { |
|
| 245 | 245 | $style_nonce = FrmAppHelper::get_post_param( 'frm_manage_style', '', 'sanitize_text_field' ); |
| 246 | 246 | if ( ! $_POST || ! isset( $_POST['style'] ) || ! wp_verify_nonce( $style_nonce, 'frm_manage_style_nonce' ) ) { |
| 247 | - return self::manage(); |
|
| 248 | - } |
|
| 247 | + return self::manage(); |
|
| 248 | + } |
|
| 249 | 249 | |
| 250 | - global $wpdb; |
|
| 250 | + global $wpdb; |
|
| 251 | 251 | |
| 252 | 252 | $forms = FrmForm::get_published_forms(); |
| 253 | - foreach ( $forms as $form ) { |
|
| 254 | - if ( $_POST['style'][ $form->id ] == $_POST['prev_style'][ $form->id ] ) { |
|
| 255 | - continue; |
|
| 256 | - } |
|
| 253 | + foreach ( $forms as $form ) { |
|
| 254 | + if ( $_POST['style'][ $form->id ] == $_POST['prev_style'][ $form->id ] ) { |
|
| 255 | + continue; |
|
| 256 | + } |
|
| 257 | 257 | |
| 258 | - $form->options['custom_style'] = $_POST['style'][ $form->id ]; |
|
| 258 | + $form->options['custom_style'] = $_POST['style'][ $form->id ]; |
|
| 259 | 259 | |
| 260 | 260 | $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) ); |
| 261 | - unset($form); |
|
| 262 | - } |
|
| 261 | + unset($form); |
|
| 262 | + } |
|
| 263 | 263 | |
| 264 | - $message = __( 'Your form styles have been saved.', 'formidable' ); |
|
| 265 | - return self::manage($message, $forms); |
|
| 266 | - } |
|
| 264 | + $message = __( 'Your form styles have been saved.', 'formidable' ); |
|
| 265 | + return self::manage($message, $forms); |
|
| 266 | + } |
|
| 267 | 267 | |
| 268 | - public static function custom_css( $message = '', $style = null ) { |
|
| 269 | - wp_enqueue_style('codemirror', FrmAppHelper::plugin_url() . '/css/codemirror.css'); |
|
| 270 | - wp_enqueue_script('codemirror', FrmAppHelper::plugin_url() . '/js/codemirror/codemirror.js', array(), '4.7'); |
|
| 271 | - wp_enqueue_script( 'codemirror-css', FrmAppHelper::plugin_url() . '/js/codemirror/css.js', array( 'codemirror' ), '4.7' ); |
|
| 268 | + public static function custom_css( $message = '', $style = null ) { |
|
| 269 | + wp_enqueue_style('codemirror', FrmAppHelper::plugin_url() . '/css/codemirror.css'); |
|
| 270 | + wp_enqueue_script('codemirror', FrmAppHelper::plugin_url() . '/js/codemirror/codemirror.js', array(), '4.7'); |
|
| 271 | + wp_enqueue_script( 'codemirror-css', FrmAppHelper::plugin_url() . '/js/codemirror/css.js', array( 'codemirror' ), '4.7' ); |
|
| 272 | 272 | |
| 273 | - if ( ! isset($style) ) { |
|
| 274 | - $frm_style = new FrmStyle(); |
|
| 275 | - $style = $frm_style->get_default_style(); |
|
| 276 | - } |
|
| 273 | + if ( ! isset($style) ) { |
|
| 274 | + $frm_style = new FrmStyle(); |
|
| 275 | + $style = $frm_style->get_default_style(); |
|
| 276 | + } |
|
| 277 | 277 | |
| 278 | 278 | include( FrmAppHelper::plugin_path() . '/classes/views/styles/custom_css.php' ); |
| 279 | - } |
|
| 279 | + } |
|
| 280 | 280 | |
| 281 | - public static function save_css() { |
|
| 282 | - $frm_style = new FrmStyle(); |
|
| 281 | + public static function save_css() { |
|
| 282 | + $frm_style = new FrmStyle(); |
|
| 283 | 283 | |
| 284 | - $message = ''; |
|
| 284 | + $message = ''; |
|
| 285 | 285 | $post_id = FrmAppHelper::get_post_param( 'ID', false, 'sanitize_text_field' ); |
| 286 | 286 | $nonce = FrmAppHelper::get_post_param( 'frm_custom_css', '', 'sanitize_text_field' ); |
| 287 | 287 | if ( wp_verify_nonce( $nonce, 'frm_custom_css_nonce' ) ) { |
| 288 | - $frm_style->update($post_id); |
|
| 289 | - $message = __( 'Your styling settings have been saved.', 'formidable' ); |
|
| 290 | - } |
|
| 288 | + $frm_style->update($post_id); |
|
| 289 | + $message = __( 'Your styling settings have been saved.', 'formidable' ); |
|
| 290 | + } |
|
| 291 | 291 | |
| 292 | - return self::custom_css($message); |
|
| 293 | - } |
|
| 292 | + return self::custom_css($message); |
|
| 293 | + } |
|
| 294 | 294 | |
| 295 | - public static function route() { |
|
| 295 | + public static function route() { |
|
| 296 | 296 | $action = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' ); |
| 297 | 297 | |
| 298 | - switch ( $action ) { |
|
| 299 | - case 'edit': |
|
| 300 | - case 'save': |
|
| 301 | - case 'manage': |
|
| 302 | - case 'manage_styles': |
|
| 303 | - case 'custom_css': |
|
| 304 | - case 'save_css': |
|
| 298 | + switch ( $action ) { |
|
| 299 | + case 'edit': |
|
| 300 | + case 'save': |
|
| 301 | + case 'manage': |
|
| 302 | + case 'manage_styles': |
|
| 303 | + case 'custom_css': |
|
| 304 | + case 'save_css': |
|
| 305 | 305 | return self::$action(); |
| 306 | - default: |
|
| 307 | - do_action( 'frm_style_action_route', $action ); |
|
| 308 | - if ( apply_filters( 'frm_style_stop_action_route', false, $action ) ) { |
|
| 309 | - return; |
|
| 310 | - } |
|
| 306 | + default: |
|
| 307 | + do_action( 'frm_style_action_route', $action ); |
|
| 308 | + if ( apply_filters( 'frm_style_stop_action_route', false, $action ) ) { |
|
| 309 | + return; |
|
| 310 | + } |
|
| 311 | 311 | |
| 312 | - if ( 'new_style' == $action || 'duplicate' == $action ) { |
|
| 313 | - return self::$action(); |
|
| 314 | - } |
|
| 312 | + if ( 'new_style' == $action || 'duplicate' == $action ) { |
|
| 313 | + return self::$action(); |
|
| 314 | + } |
|
| 315 | 315 | |
| 316 | - return self::edit(); |
|
| 317 | - } |
|
| 318 | - } |
|
| 316 | + return self::edit(); |
|
| 317 | + } |
|
| 318 | + } |
|
| 319 | 319 | |
| 320 | - public static function reset_styling() { |
|
| 320 | + public static function reset_styling() { |
|
| 321 | 321 | FrmAppHelper::permission_check('frm_change_settings'); |
| 322 | - check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 322 | + check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 323 | 323 | |
| 324 | - $frm_style = new FrmStyle(); |
|
| 325 | - $defaults = $frm_style->get_defaults(); |
|
| 324 | + $frm_style = new FrmStyle(); |
|
| 325 | + $defaults = $frm_style->get_defaults(); |
|
| 326 | 326 | |
| 327 | - echo json_encode( $defaults ); |
|
| 328 | - wp_die(); |
|
| 329 | - } |
|
| 327 | + echo json_encode( $defaults ); |
|
| 328 | + wp_die(); |
|
| 329 | + } |
|
| 330 | 330 | |
| 331 | - public static function change_styling() { |
|
| 332 | - check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 331 | + public static function change_styling() { |
|
| 332 | + check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 333 | 333 | |
| 334 | - $frm_style = new FrmStyle(); |
|
| 335 | - $defaults = $frm_style->get_defaults(); |
|
| 334 | + $frm_style = new FrmStyle(); |
|
| 335 | + $defaults = $frm_style->get_defaults(); |
|
| 336 | 336 | |
| 337 | - // remove the # from the colors |
|
| 338 | - foreach ( $_GET['frm_style_setting']['post_content'] as $k => $v ) { |
|
| 339 | - if ( ! is_array($v) && strpos($v, '#') === 0 ) { |
|
| 340 | - $_GET['frm_style_setting']['post_content'][ $k ] = str_replace( '#', '', $v ); |
|
| 341 | - } |
|
| 342 | - } |
|
| 337 | + // remove the # from the colors |
|
| 338 | + foreach ( $_GET['frm_style_setting']['post_content'] as $k => $v ) { |
|
| 339 | + if ( ! is_array($v) && strpos($v, '#') === 0 ) { |
|
| 340 | + $_GET['frm_style_setting']['post_content'][ $k ] = str_replace( '#', '', $v ); |
|
| 341 | + } |
|
| 342 | + } |
|
| 343 | 343 | |
| 344 | - echo '<style type="text/css">'; |
|
| 344 | + echo '<style type="text/css">'; |
|
| 345 | 345 | include( FrmAppHelper::plugin_path() . '/css/_single_theme.css.php' ); |
| 346 | - echo '</style>'; |
|
| 347 | - wp_die(); |
|
| 348 | - } |
|
| 349 | - |
|
| 350 | - private static function add_meta_boxes() { |
|
| 351 | - |
|
| 352 | - // setup meta boxes |
|
| 353 | - $meta_boxes = array( |
|
| 354 | - 'general' => __( 'General', 'formidable' ), |
|
| 355 | - 'form-title' => __( 'Form Title', 'formidable' ), |
|
| 356 | - 'form-description' => __( 'Form Description', 'formidable' ), |
|
| 357 | - 'field-labels' => __( 'Field Labels', 'formidable' ), |
|
| 358 | - 'field-description' => __( 'Field Description', 'formidable' ), |
|
| 359 | - 'field-colors' => __( 'Field Colors', 'formidable' ), |
|
| 360 | - 'field-sizes' => __( 'Field Settings', 'formidable' ), |
|
| 361 | - 'check-box-radio-fields' => __( 'Check Box & Radio Fields', 'formidable' ), |
|
| 362 | - 'section-fields' => __( 'Section Fields', 'formidable' ), |
|
| 363 | - 'date-fields' => __( 'Date Fields', 'formidable' ), |
|
| 364 | - 'buttons' => __( 'Buttons', 'formidable' ), |
|
| 365 | - 'form-messages' => __( 'Form Messages', 'formidable' ), |
|
| 366 | - ); |
|
| 367 | - |
|
| 368 | - foreach ( $meta_boxes as $nicename => $name ) { |
|
| 346 | + echo '</style>'; |
|
| 347 | + wp_die(); |
|
| 348 | + } |
|
| 349 | + |
|
| 350 | + private static function add_meta_boxes() { |
|
| 351 | + |
|
| 352 | + // setup meta boxes |
|
| 353 | + $meta_boxes = array( |
|
| 354 | + 'general' => __( 'General', 'formidable' ), |
|
| 355 | + 'form-title' => __( 'Form Title', 'formidable' ), |
|
| 356 | + 'form-description' => __( 'Form Description', 'formidable' ), |
|
| 357 | + 'field-labels' => __( 'Field Labels', 'formidable' ), |
|
| 358 | + 'field-description' => __( 'Field Description', 'formidable' ), |
|
| 359 | + 'field-colors' => __( 'Field Colors', 'formidable' ), |
|
| 360 | + 'field-sizes' => __( 'Field Settings', 'formidable' ), |
|
| 361 | + 'check-box-radio-fields' => __( 'Check Box & Radio Fields', 'formidable' ), |
|
| 362 | + 'section-fields' => __( 'Section Fields', 'formidable' ), |
|
| 363 | + 'date-fields' => __( 'Date Fields', 'formidable' ), |
|
| 364 | + 'buttons' => __( 'Buttons', 'formidable' ), |
|
| 365 | + 'form-messages' => __( 'Form Messages', 'formidable' ), |
|
| 366 | + ); |
|
| 367 | + |
|
| 368 | + foreach ( $meta_boxes as $nicename => $name ) { |
|
| 369 | 369 | add_meta_box( $nicename . '-style', $name, 'FrmStylesController::include_style_section', self::$screen, 'side', 'default', $nicename ); |
| 370 | - unset($nicename, $name); |
|
| 371 | - } |
|
| 372 | - } |
|
| 370 | + unset($nicename, $name); |
|
| 371 | + } |
|
| 372 | + } |
|
| 373 | 373 | |
| 374 | 374 | public static function include_style_section( $atts, $sec ) { |
| 375 | - extract($atts); |
|
| 375 | + extract($atts); |
|
| 376 | 376 | $current_tab = FrmAppHelper::simple_get( 'page-tab', 'sanitize_title', 'default' ); |
| 377 | 377 | include( FrmAppHelper::plugin_path() . '/classes/views/styles/_' . $sec['args'] . '.php' ); |
| 378 | - } |
|
| 378 | + } |
|
| 379 | 379 | |
| 380 | - public static function load_css() { |
|
| 381 | - header('Content-type: text/css'); |
|
| 380 | + public static function load_css() { |
|
| 381 | + header('Content-type: text/css'); |
|
| 382 | 382 | |
| 383 | - $frm_style = new FrmStyle(); |
|
| 384 | - $defaults = $frm_style->get_defaults(); |
|
| 383 | + $frm_style = new FrmStyle(); |
|
| 384 | + $defaults = $frm_style->get_defaults(); |
|
| 385 | 385 | |
| 386 | 386 | include( FrmAppHelper::plugin_path() . '/css/_single_theme.css.php' ); |
| 387 | - wp_die(); |
|
| 388 | - } |
|
| 387 | + wp_die(); |
|
| 388 | + } |
|
| 389 | 389 | |
| 390 | 390 | public static function load_saved_css() { |
| 391 | 391 | $css = get_transient( 'frmpro_css' ); |
@@ -394,142 +394,142 @@ discard block |
||
| 394 | 394 | wp_die(); |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | - /** |
|
| 398 | - * Check if the Formidable styling should be loaded, |
|
| 399 | - * then enqueue it for the footer |
|
| 400 | - * @since 2.0 |
|
| 401 | - */ |
|
| 402 | - public static function enqueue_style() { |
|
| 403 | - global $frm_vars; |
|
| 404 | - |
|
| 405 | - if ( isset( $frm_vars['css_loaded'] ) && $frm_vars['css_loaded'] ) { |
|
| 406 | - // the CSS has already been loaded |
|
| 407 | - return; |
|
| 408 | - } |
|
| 409 | - |
|
| 410 | - $frm_settings = FrmAppHelper::get_settings(); |
|
| 411 | - if ( $frm_settings->load_style != 'none' ) { |
|
| 412 | - wp_enqueue_style( 'formidable' ); |
|
| 413 | - $frm_vars['css_loaded'] = true; |
|
| 414 | - } |
|
| 415 | - } |
|
| 416 | - |
|
| 417 | - // Get the stylesheets for the form settings page |
|
| 418 | - public static function get_style_opts() { |
|
| 419 | - $frm_style = new FrmStyle(); |
|
| 420 | - $styles = $frm_style->get_all(); |
|
| 421 | - |
|
| 422 | - return $styles; |
|
| 423 | - } |
|
| 424 | - |
|
| 425 | - public static function get_form_style( $form = 'default' ) { |
|
| 426 | - $style = FrmFormsHelper::get_form_style( $form ); |
|
| 427 | - |
|
| 428 | - if ( empty( $style ) || 1 == $style ) { |
|
| 429 | - $style = 'default'; |
|
| 430 | - } |
|
| 431 | - |
|
| 432 | - $frm_style = new FrmStyle( $style ); |
|
| 433 | - return $frm_style->get_one(); |
|
| 434 | - } |
|
| 435 | - |
|
| 436 | - /** |
|
| 437 | - * @param string $class |
|
| 438 | - * @param string $style |
|
| 439 | - */ |
|
| 397 | + /** |
|
| 398 | + * Check if the Formidable styling should be loaded, |
|
| 399 | + * then enqueue it for the footer |
|
| 400 | + * @since 2.0 |
|
| 401 | + */ |
|
| 402 | + public static function enqueue_style() { |
|
| 403 | + global $frm_vars; |
|
| 404 | + |
|
| 405 | + if ( isset( $frm_vars['css_loaded'] ) && $frm_vars['css_loaded'] ) { |
|
| 406 | + // the CSS has already been loaded |
|
| 407 | + return; |
|
| 408 | + } |
|
| 409 | + |
|
| 410 | + $frm_settings = FrmAppHelper::get_settings(); |
|
| 411 | + if ( $frm_settings->load_style != 'none' ) { |
|
| 412 | + wp_enqueue_style( 'formidable' ); |
|
| 413 | + $frm_vars['css_loaded'] = true; |
|
| 414 | + } |
|
| 415 | + } |
|
| 416 | + |
|
| 417 | + // Get the stylesheets for the form settings page |
|
| 418 | + public static function get_style_opts() { |
|
| 419 | + $frm_style = new FrmStyle(); |
|
| 420 | + $styles = $frm_style->get_all(); |
|
| 421 | + |
|
| 422 | + return $styles; |
|
| 423 | + } |
|
| 424 | + |
|
| 425 | + public static function get_form_style( $form = 'default' ) { |
|
| 426 | + $style = FrmFormsHelper::get_form_style( $form ); |
|
| 427 | + |
|
| 428 | + if ( empty( $style ) || 1 == $style ) { |
|
| 429 | + $style = 'default'; |
|
| 430 | + } |
|
| 431 | + |
|
| 432 | + $frm_style = new FrmStyle( $style ); |
|
| 433 | + return $frm_style->get_one(); |
|
| 434 | + } |
|
| 435 | + |
|
| 436 | + /** |
|
| 437 | + * @param string $class |
|
| 438 | + * @param string $style |
|
| 439 | + */ |
|
| 440 | 440 | public static function get_form_style_class( $class, $style ) { |
| 441 | - if ( 1 == $style ) { |
|
| 442 | - $style = 'default'; |
|
| 443 | - } |
|
| 441 | + if ( 1 == $style ) { |
|
| 442 | + $style = 'default'; |
|
| 443 | + } |
|
| 444 | 444 | |
| 445 | - $frm_style = new FrmStyle($style); |
|
| 446 | - $style = $frm_style->get_one(); |
|
| 445 | + $frm_style = new FrmStyle($style); |
|
| 446 | + $style = $frm_style->get_one(); |
|
| 447 | 447 | |
| 448 | - if ( $style ) { |
|
| 448 | + if ( $style ) { |
|
| 449 | 449 | $class .= ' frm_style_' . $style->post_name; |
| 450 | - } |
|
| 450 | + } |
|
| 451 | 451 | |
| 452 | - return $class; |
|
| 453 | - } |
|
| 452 | + return $class; |
|
| 453 | + } |
|
| 454 | 454 | |
| 455 | - /** |
|
| 456 | - * @param string $val |
|
| 457 | - */ |
|
| 455 | + /** |
|
| 456 | + * @param string $val |
|
| 457 | + */ |
|
| 458 | 458 | public static function get_style_val( $val, $form = 'default' ) { |
| 459 | - $style = self::get_form_style($form); |
|
| 460 | - if ( $style && isset( $style->post_content[ $val ] ) ) { |
|
| 461 | - return $style->post_content[ $val ]; |
|
| 462 | - } |
|
| 463 | - } |
|
| 459 | + $style = self::get_form_style($form); |
|
| 460 | + if ( $style && isset( $style->post_content[ $val ] ) ) { |
|
| 461 | + return $style->post_content[ $val ]; |
|
| 462 | + } |
|
| 463 | + } |
|
| 464 | 464 | |
| 465 | 465 | public static function show_entry_styles( $default_styles ) { |
| 466 | - $frm_style = new FrmStyle('default'); |
|
| 467 | - $style = $frm_style->get_one(); |
|
| 468 | - |
|
| 469 | - if ( ! $style ) { |
|
| 470 | - return $default_styles; |
|
| 471 | - } |
|
| 472 | - |
|
| 473 | - foreach ( $default_styles as $name => $val ) { |
|
| 474 | - $setting = $name; |
|
| 475 | - if ( 'border_width' == $name ) { |
|
| 476 | - $setting = 'field_border_width'; |
|
| 477 | - } else if ( 'alt_bg_color' == $name ) { |
|
| 478 | - $setting = 'bg_color_active'; |
|
| 479 | - } |
|
| 480 | - $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
| 481 | - unset($name, $val); |
|
| 482 | - } |
|
| 483 | - |
|
| 484 | - return $default_styles; |
|
| 485 | - } |
|
| 466 | + $frm_style = new FrmStyle('default'); |
|
| 467 | + $style = $frm_style->get_one(); |
|
| 468 | + |
|
| 469 | + if ( ! $style ) { |
|
| 470 | + return $default_styles; |
|
| 471 | + } |
|
| 472 | + |
|
| 473 | + foreach ( $default_styles as $name => $val ) { |
|
| 474 | + $setting = $name; |
|
| 475 | + if ( 'border_width' == $name ) { |
|
| 476 | + $setting = 'field_border_width'; |
|
| 477 | + } else if ( 'alt_bg_color' == $name ) { |
|
| 478 | + $setting = 'bg_color_active'; |
|
| 479 | + } |
|
| 480 | + $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
| 481 | + unset($name, $val); |
|
| 482 | + } |
|
| 483 | + |
|
| 484 | + return $default_styles; |
|
| 485 | + } |
|
| 486 | 486 | |
| 487 | 487 | public static function &important_style( $important, $field ) { |
| 488 | - $important = self::get_style_val('important_style', $field['form_id']); |
|
| 489 | - return $important; |
|
| 490 | - } |
|
| 488 | + $important = self::get_style_val('important_style', $field['form_id']); |
|
| 489 | + return $important; |
|
| 490 | + } |
|
| 491 | 491 | |
| 492 | - /** |
|
| 493 | - * Fallback for WP < 3.6 |
|
| 494 | - */ |
|
| 495 | - public static function do_accordion_sections( $screen, $context, $object ) { |
|
| 496 | - if ( function_exists( 'do_accordion_sections' ) ) { |
|
| 497 | - return do_accordion_sections( $screen, $context, $object ); |
|
| 498 | - } |
|
| 492 | + /** |
|
| 493 | + * Fallback for WP < 3.6 |
|
| 494 | + */ |
|
| 495 | + public static function do_accordion_sections( $screen, $context, $object ) { |
|
| 496 | + if ( function_exists( 'do_accordion_sections' ) ) { |
|
| 497 | + return do_accordion_sections( $screen, $context, $object ); |
|
| 498 | + } |
|
| 499 | 499 | |
| 500 | - global $wp_meta_boxes; |
|
| 500 | + global $wp_meta_boxes; |
|
| 501 | 501 | |
| 502 | - $screen = 'formidable_page_formidable-styles'; |
|
| 503 | - $screen = convert_to_screen( $screen ); |
|
| 502 | + $screen = 'formidable_page_formidable-styles'; |
|
| 503 | + $screen = convert_to_screen( $screen ); |
|
| 504 | 504 | |
| 505 | - $page = $screen->id; |
|
| 505 | + $page = $screen->id; |
|
| 506 | 506 | |
| 507 | - $hidden = get_hidden_meta_boxes( $screen ); |
|
| 508 | - ?> |
|
| 507 | + $hidden = get_hidden_meta_boxes( $screen ); |
|
| 508 | + ?> |
|
| 509 | 509 | <div id="side-sortables" class="accordion-container"> |
| 510 | 510 | <?php |
| 511 | - $i = 0; |
|
| 512 | - $first_open = false; |
|
| 513 | - do { |
|
| 511 | + $i = 0; |
|
| 512 | + $first_open = false; |
|
| 513 | + do { |
|
| 514 | 514 | if ( ! isset( $wp_meta_boxes ) || ! isset( $wp_meta_boxes[ $page ] ) || ! isset( $wp_meta_boxes[ $page ][ $context ] ) ) { |
| 515 | 515 | break; |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | - foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { |
|
| 519 | - if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { |
|
| 520 | - foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) { |
|
| 521 | - if ( false == $box || ! $box['title'] ) { |
|
| 522 | - continue; |
|
| 518 | + foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { |
|
| 519 | + if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { |
|
| 520 | + foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) { |
|
| 521 | + if ( false == $box || ! $box['title'] ) { |
|
| 522 | + continue; |
|
| 523 | 523 | } |
| 524 | 524 | |
| 525 | - $i++; |
|
| 526 | - $hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : ''; |
|
| 525 | + $i++; |
|
| 526 | + $hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : ''; |
|
| 527 | 527 | |
| 528 | - if ( ! $first_open && empty( $hidden_class ) ) { |
|
| 529 | - $first_open = true; |
|
| 530 | - } |
|
| 528 | + if ( ! $first_open && empty( $hidden_class ) ) { |
|
| 529 | + $first_open = true; |
|
| 530 | + } |
|
| 531 | 531 | |
| 532 | - ?> |
|
| 532 | + ?> |
|
| 533 | 533 | <div class="postbox <?php echo esc_attr( $box['id'] ); ?>"> |
| 534 | 534 | <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'formidable' ) ?>"><br/></div> |
| 535 | 535 | <h3 class='hndle'><span><?php echo esc_html( $box['title'] ); ?></span></h3> |
@@ -540,13 +540,13 @@ discard block |
||
| 540 | 540 | </div><!-- .accordion-section-content --> |
| 541 | 541 | </div><!-- .postbox --> |
| 542 | 542 | <?php |
| 543 | - } |
|
| 544 | - } |
|
| 545 | - } |
|
| 546 | - } while ( 0 ); |
|
| 547 | - ?> |
|
| 543 | + } |
|
| 544 | + } |
|
| 545 | + } |
|
| 546 | + } while ( 0 ); |
|
| 547 | + ?> |
|
| 548 | 548 | </div><!-- .accordion-container --> |
| 549 | 549 | <?php |
| 550 | - return $i; |
|
| 551 | - } |
|
| 550 | + return $i; |
|
| 551 | + } |
|
| 552 | 552 | } |
@@ -7,10 +7,10 @@ |
||
| 7 | 7 | continue; |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | - if ( isset( $plugin_names[ $addon['info']['slug'] ] ) ) { |
|
| 11 | - $installed = is_dir( WP_PLUGIN_DIR . '/' . $plugin_names[ $addon['info']['slug'] ] ); |
|
| 10 | + if ( isset( $plugin_names[$addon['info']['slug']] ) ) { |
|
| 11 | + $installed = is_dir( WP_PLUGIN_DIR . '/' . $plugin_names[$addon['info']['slug']] ); |
|
| 12 | 12 | } else { |
| 13 | - $installed = isset( $installed_addons[ $addon['info']['slug'] ] ) || is_dir( WP_PLUGIN_DIR . '/formidable-' . $addon['info']['slug'] ); |
|
| 13 | + $installed = isset( $installed_addons[$addon['info']['slug']] ) || is_dir( WP_PLUGIN_DIR . '/formidable-' . $addon['info']['slug'] ); |
|
| 14 | 14 | } |
| 15 | 15 | $has_thumbnail = ! empty( $addon['info']['thumbnail'] ); |
| 16 | 16 | if ( $addon['info']['slug'] == 'formidable-pro' ) { |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | <tr> |
| 7 | 7 | <th></th> |
| 8 | 8 | <?php foreach ( $pro['pricing'] as $name => $price ) { |
| 9 | - $price_id++; |
|
| 9 | + $price_id ++; |
|
| 10 | 10 | if ( $name == 'smallbusiness' ) { |
| 11 | 11 | $name = 'Small Business'; |
| 12 | 12 | } ?> |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | <tr> |
| 51 | 51 | <th>Included AddOns</th> |
| 52 | 52 | <td>None</td> |
| 53 | - <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Basic Addons</a></td> |
|
| 54 | - <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Advanced Addons</a></td> |
|
| 55 | - <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com/pricing/#addon-lists') ) ?>" target="_blank">Enterprise Addons</a></td> |
|
| 53 | + <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/pricing/#addon-lists' ) ) ?>" target="_blank">Basic Addons</a></td> |
|
| 54 | + <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/pricing/#addon-lists' ) ) ?>" target="_blank">Advanced Addons</a></td> |
|
| 55 | + <td><a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url( 'https://formidablepro.com/pricing/#addon-lists' ) ) ?>" target="_blank">Enterprise Addons</a></td> |
|
| 56 | 56 | </tr> |
| 57 | 57 | </tbody> |
| 58 | 58 | </table> |
@@ -275,7 +275,7 @@ |
||
| 275 | 275 | return $message; |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - public function manually_queue_update() { |
|
| 279 | - set_site_transient( 'update_plugins', null ); |
|
| 280 | - } |
|
| 278 | + public function manually_queue_update() { |
|
| 279 | + set_site_transient( 'update_plugins', null ); |
|
| 280 | + } |
|
| 281 | 281 | } |
@@ -38,15 +38,15 @@ discard block |
||
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function insert_installed_addon( $plugins ) { |
| 41 | - $plugins[ $this->plugin_slug ] = $this; |
|
| 41 | + $plugins[$this->plugin_slug] = $this; |
|
| 42 | 42 | return $plugins; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public static function get_addon( $plugin_slug ) { |
| 46 | 46 | $plugins = apply_filters( 'frm_installed_addons', array() ); |
| 47 | 47 | $plugin = false; |
| 48 | - if ( isset( $plugins[ $plugin_slug ] ) ) { |
|
| 49 | - $plugin = $plugins[ $plugin_slug ]; |
|
| 48 | + if ( isset( $plugins[$plugin_slug] ) ) { |
|
| 49 | + $plugin = $plugins[$plugin_slug]; |
|
| 50 | 50 | } |
| 51 | 51 | return $plugin; |
| 52 | 52 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | public function show_license_message( $file, $plugin ) { |
| 99 | 99 | $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); |
| 100 | 100 | echo '<tr class="plugin-update-tr active"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message">'; |
| 101 | - echo sprintf( __( 'Your %1$s license key is missing. Please add it on the %2$slicenses page%3$s.', 'formidable' ), $this->plugin_name, '<a href="' . esc_url( admin_url('admin.php?page=formidable-settings&t=licenses_settings' ) ) . '">', '</a>' ); |
|
| 101 | + echo sprintf( __( 'Your %1$s license key is missing. Please add it on the %2$slicenses page%3$s.', 'formidable' ), $this->plugin_name, '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-settings&t=licenses_settings' ) ) . '">', '</a>' ); |
|
| 102 | 102 | $id = sanitize_title( $plugin['Name'] ); |
| 103 | 103 | echo '<script type="text/javascript">var d = document.getElementById("' . esc_attr( $id ) . '");if ( d !== null ){ d.className = d.className + " update"; }</script>'; |
| 104 | 104 | echo '</div></td></tr>'; |
@@ -111,14 +111,14 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | if ( $this->is_current_version( $transient ) ) { |
| 113 | 113 | //make sure it doesn't show there is an update if plugin is up-to-date |
| 114 | - if ( isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
| 115 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
| 114 | + if ( isset( $transient->response[$this->plugin_folder] ) ) { |
|
| 115 | + unset( $transient->response[$this->plugin_folder] ); |
|
| 116 | 116 | } |
| 117 | - } else if ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
| 117 | + } else if ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) { |
|
| 118 | 118 | $cache_key = 'edd_plugin_' . md5( sanitize_key( $this->license . $this->version ) . '_get_version' ); |
| 119 | 119 | $version_info = get_transient( $cache_key ); |
| 120 | 120 | if ( $version_info !== false && version_compare( $version_info->new_version, $this->version, '>' ) ) { |
| 121 | - $transient->response[ $this->plugin_folder ] = $version_info; |
|
| 121 | + $transient->response[$this->plugin_folder] = $version_info; |
|
| 122 | 122 | } else { |
| 123 | 123 | delete_transient( $cache_key ); |
| 124 | 124 | if ( ! $this->has_been_cleared() ) { |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $this->manually_queue_update(); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
| 130 | + unset( $transient->response[$this->plugin_folder] ); |
|
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | private function is_current_version( $transient ) { |
| 138 | - if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) { |
|
| 138 | + if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) { |
|
| 139 | 139 | return false; |
| 140 | 140 | } |
| 141 | 141 | |
@@ -144,20 +144,20 @@ discard block |
||
| 144 | 144 | return true; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] == $transient->response[ $this->plugin_folder ]->new_version; |
|
| 147 | + return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] == $transient->response[$this->plugin_folder]->new_version; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | private function has_been_cleared() { |
| 151 | 151 | $last_cleared = get_option( 'frm_last_cleared' ); |
| 152 | - return ( $last_cleared && $last_cleared > date( 'Y-m-d H:i:s', strtotime('-5 minutes') ) ); |
|
| 152 | + return ( $last_cleared && $last_cleared > date( 'Y-m-d H:i:s', strtotime( '-5 minutes' ) ) ); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | private function cleared_plugins() { |
| 156 | - update_option( 'frm_last_cleared', date('Y-m-d H:i:s') ); |
|
| 156 | + update_option( 'frm_last_cleared', date( 'Y-m-d H:i:s' ) ); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | public static function activate() { |
| 160 | - FrmAppHelper::permission_check('frm_change_settings'); |
|
| 160 | + FrmAppHelper::permission_check( 'frm_change_settings' ); |
|
| 161 | 161 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 162 | 162 | |
| 163 | 163 | if ( ! isset( $_POST['license'] ) || empty( $_POST['license'] ) ) { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | public static function deactivate() { |
| 208 | - FrmAppHelper::permission_check('frm_change_settings'); |
|
| 208 | + FrmAppHelper::permission_check( 'frm_change_settings' ); |
|
| 209 | 209 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 210 | 210 | |
| 211 | 211 | $plugin_slug = sanitize_text_field( $_POST['plugin'] ); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | $message = __( 'Your License Key was invalid', 'formidable' ); |
| 257 | 257 | if ( is_wp_error( $resp ) ) { |
| 258 | - $message = sprintf( __( 'You had an error communicating with Formidable Pro\'s API. %1$sClick here%2$s for more information.', 'formidable' ), '<a href="http://formidablepro.com/knowledgebase/why-cant-i-activate-formidable-pro/" target="_blank">', '</a>'); |
|
| 258 | + $message = sprintf( __( 'You had an error communicating with Formidable Pro\'s API. %1$sClick here%2$s for more information.', 'formidable' ), '<a href="http://formidablepro.com/knowledgebase/why-cant-i-activate-formidable-pro/" target="_blank">', '</a>' ); |
|
| 259 | 259 | if ( is_wp_error( $resp ) ) { |
| 260 | 260 | $message .= ' ' . $resp->get_error_message(); |
| 261 | 261 | } |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <div class="field-group clearfix frm-half frm-first-row"> |
| 2 | 2 | <label><?php _e( 'Size', 'formidable' ) ?></label> |
| 3 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_size') ) ?>" id="frm_form_desc_size" value="<?php echo esc_attr( $style->post_content['form_desc_size'] ) ?>" /> |
|
| 3 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_desc_size' ) ) ?>" id="frm_form_desc_size" value="<?php echo esc_attr( $style->post_content['form_desc_size'] ) ?>" /> |
|
| 4 | 4 | </div> |
| 5 | 5 | |
| 6 | 6 | <div class="field-group clearfix frm-half frm-first-row"> |
| 7 | 7 | <label><?php _e( 'Color', 'formidable' ) ?></label> |
| 8 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_color') ) ?>" id="frm_form_desc_color" class="hex" value="<?php echo esc_attr( $style->post_content['form_desc_color'] ) ?>" /> |
|
| 8 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_desc_color' ) ) ?>" id="frm_form_desc_color" class="hex" value="<?php echo esc_attr( $style->post_content['form_desc_color'] ) ?>" /> |
|
| 9 | 9 | </div> |
| 10 | 10 | <div class="field-group clearfix frm-half"> |
| 11 | 11 | <label><?php _e( 'Margin Top', 'formidable' ) ?></label> |
| 12 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_margin_top') ) ?>" id="frm_form_desc_margin_top" value="<?php echo esc_attr( $style->post_content['form_desc_margin_top'] ) ?>" size="4" /> |
|
| 12 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_desc_margin_top' ) ) ?>" id="frm_form_desc_margin_top" value="<?php echo esc_attr( $style->post_content['form_desc_margin_top'] ) ?>" size="4" /> |
|
| 13 | 13 | </div> |
| 14 | 14 | <div class="field-group clearfix frm-half"> |
| 15 | 15 | <label><?php _e( 'Margin Bottom', 'formidable' ) ?></label> |
| 16 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_margin_bottom') ) ?>" id="frm_form_desc_margin_bottom" value="<?php echo esc_attr( $style->post_content['form_desc_margin_bottom'] ) ?>" size="4" /> |
|
| 16 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'form_desc_margin_bottom' ) ) ?>" id="frm_form_desc_margin_bottom" value="<?php echo esc_attr( $style->post_content['form_desc_margin_bottom'] ) ?>" size="4" /> |
|
| 17 | 17 | </div> |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <div class="field-group clearfix frm-half frm-first-row"> |
| 2 | 2 | <label><?php _e( 'Size', 'formidable' ) ?></label> |
| 3 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_size') ) ?>" id="frm_title_size" value="<?php echo esc_attr( $style->post_content['title_size'] ) ?>" /> |
|
| 3 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_size' ) ) ?>" id="frm_title_size" value="<?php echo esc_attr( $style->post_content['title_size'] ) ?>" /> |
|
| 4 | 4 | </div> |
| 5 | 5 | |
| 6 | 6 | <div class="field-group clearfix frm-half frm-first-row"> |
| 7 | 7 | <label><?php _e( 'Color', 'formidable' ) ?></label> |
| 8 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_color') ) ?>" id="frm_title_color" class="hex" value="<?php echo esc_attr( $style->post_content['title_color'] ) ?>" /> |
|
| 8 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_color' ) ) ?>" id="frm_title_color" class="hex" value="<?php echo esc_attr( $style->post_content['title_color'] ) ?>" /> |
|
| 9 | 9 | </div> |
| 10 | 10 | <div class="field-group clearfix frm-half"> |
| 11 | 11 | <label><?php _e( 'Margin Top', 'formidable' ) ?></label> |
| 12 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_margin_top') ) ?>" id="frm_title_margin_top" value="<?php echo esc_attr( $style->post_content['title_margin_top'] ) ?>" size="4" /> |
|
| 12 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_margin_top' ) ) ?>" id="frm_title_margin_top" value="<?php echo esc_attr( $style->post_content['title_margin_top'] ) ?>" size="4" /> |
|
| 13 | 13 | </div> |
| 14 | 14 | <div class="field-group clearfix frm-half"> |
| 15 | 15 | <label><?php _e( 'Margin Bottom', 'formidable' ) ?></label> |
| 16 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_margin_bottom') ) ?>" id="frm_title_margin_bottom" value="<?php echo esc_attr( $style->post_content['title_margin_bottom'] ) ?>" size="4" /> |
|
| 16 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_margin_bottom' ) ) ?>" id="frm_title_margin_bottom" value="<?php echo esc_attr( $style->post_content['title_margin_bottom'] ) ?>" size="4" /> |
|
| 17 | 17 | </div> |