-
Notifications
You must be signed in to change notification settings - Fork 41
Lite Version: Add Format Settings #1864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
4bbb614
Add "frm-inline-flex" class and refactor "settings.php" view
shervElmi b72beba
Enhance "general.php" view
shervElmi bb34733
Fix HTML validation, and make better HTML
shervElmi 107b596
Add `.frm-my-sm` class
shervElmi 55a6149
Merge remote-tracking branch 'origin/master' into update-currency-field
shervElmi f670150
Merge branch 'master' into update-currency-field
shervElmi bc2e040
Merge remote-tracking branch 'origin/HEAD' into update-currency-field
shervElmi 5cbf051
Merge branch 'master' into update-currency-field
shervElmi dd9d3a2
Merge branch 'master' into update-currency-field
shervElmi 7afa552
Merge remote-tracking branch 'origin/master' into update-currency-field
shervElmi ce1fc48
Add is_hidden param to show_format_option method and refactor it
shervElmi cc581b1
Add print_format_number_option method to FrmFieldText class
shervElmi ca8a9e2
Add format-type view template
shervElmi a764391
Move format setting
shervElmi 0016cb2
Update text field to include format settings
shervElmi 6a31a6c
Update Paragraph field to include format settings
shervElmi 6e18e25
Remove print_format_number_option method
shervElmi 50ca0ca
Add Number option to format-type template
shervElmi eca4564
Remove frm-my-sm helper class
shervElmi f5ba756
Fix: International option selection in Lite version
shervElmi 11eb4a3
Merge remote-tracking branch 'origin/master' into update-currency-field
shervElmi f32e606
Update format input id
shervElmi 3ac1abe
Enable format settings
shervElmi d78b213
Update format-type template
shervElmi 2e491fb
Update styles and fix some issues
shervElmi 2ffcc77
Adjust maybeUpdateFormatInput function
shervElmi 6caddaf
Adjust adjustFormatInputBeforeSave function
shervElmi 2faa688
Remove format number checkboxes
shervElmi d3e6f5e
Update number option value
shervElmi a4156e6
Use "currency" value for number format
shervElmi a20cb09
Merge remote-tracking branch 'origin/master' into update-currency-field
shervElmi ad97b19
Fix JS error when searching fields
shervElmi e4a5c90
Tweak
shervElmi 05ec900
Fix adjustFormatInputBeforeSave function
shervElmi 755619c
Add format class
shervElmi 15e2621
Fix conflict between custom format and number format
shervElmi 0e6716d
Review part one
shervElmi 66bb225
Review part two
shervElmi 16eb399
Merge remote-tracking branch 'origin/master' into update-currency-field
shervElmi 43a4298
Merge remote-tracking branch 'origin/master' into update-currency-field
shervElmi 7030586
Move the format fields input class to the Pro version
shervElmi 2f45cc4
Enhance kses method to include $echo parameter
shervElmi 7dd51c6
Make format-dropdown template file echo safer
shervElmi a72422e
Improve the kses method implementation
shervElmi bcebf4a
Merge remote-tracking branch 'origin/master' into update-currency-field
shervElmi 1e23391
Fix text field validation
shervElmi d5afcdc
Merge branch 'master' into update-currency-field
shervElmi 220ef84
Normalize formatted numbers before saving
shervElmi 633fa5a
Merge remote-tracking branch 'origin/HEAD' into update-currency-field
shervElmi 6f8dce2
Merge branch 'master' into update-currency-field
Crabcyborg c34b414
Add render_currency_selector method
shervElmi 1a5e74d
Fix tooltip style issue
shervElmi fdc9864
Add frm_other_settings_form do_action
shervElmi 56dd10a
Add formidable_settings localize script
shervElmi 017ea43
Add syncCurrencyOptoins
shervElmi f0337b4
Merge branch 'update-currency-field' of https://github.com/Strategy11…
shervElmi 7383229
Add kses_echo helper method
shervElmi 3804788
Remove format settings
shervElmi 0addb4c
Refactor format-dropdown view and add options view
shervElmi 1bf735a
Use value instead of setAttribute
shervElmi 062b008
Enable in_array strict
shervElmi dae5ec6
Allow class attribute in <option> tags
shervElmi 776bc47
Add number format
shervElmi ccc302b
Add data-dependency-skip option
shervElmi 60bb212
Refactor validation logic for clarity
shervElmi 6c978aa
Fix Turkish Liras symbol_right
shervElmi 0705efc
Merge branch 'master' into update-currency-field
Crabcyborg ddafe30
Address feedback
shervElmi e484a55
Merge branch 'master' into update-currency-field
Crabcyborg 4c2324a
Fix phpdoc
shervElmi 239260a
Refine method name
shervElmi 373ae3d
Merge branch 'master' into update-currency-field
Crabcyborg 72b5bb8
Fix custom format validate issue
shervElmi bc26fe6
change validate_step visibility to protected
shervElmi 6a7a788
Merge branch 'master' into update-currency-field
Crabcyborg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
classes/views/frm-fields/back-end/format-dropdown-options.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| <?php | ||
| /** | ||
| * @package Formidable | ||
| * @since x.x | ||
| * | ||
| * @var array $field Field data. | ||
| * @var array $args Includes 'field', 'display', and 'values' settings. | ||
| * @var FrmFieldType $this Field type object. | ||
| */ | ||
|
|
||
| if ( ! defined( 'ABSPATH' ) ) { | ||
| die( 'You are not allowed to call this page directly.' ); | ||
| } | ||
|
|
||
| $field_type = $field['type']; | ||
| $format = FrmField::get_option( $field, 'format' ); | ||
|
|
||
| FrmHtmlHelper::echo_dropdown_option( __( 'None', 'formidable' ), '' === $format, array( 'value' => 'none' ) ); | ||
|
|
||
| FrmHtmlHelper::echo_dropdown_option( | ||
| in_array( $field_type, array( 'number', 'range' ), true ) ? __( 'Custom', 'formidable' ) : __( 'Number', 'formidable' ), | ||
| false, | ||
| array( | ||
| 'value' => '', | ||
| 'class' => 'frm_show_upgrade frm_noallow', | ||
| 'data-upgrade' => __( 'Format number field', 'formidable' ), | ||
| 'data-medium' => 'format-number-field', | ||
| ) | ||
| ); | ||
|
|
||
| FrmHtmlHelper::echo_dropdown_option( | ||
| __( 'Currency', 'formidable' ), | ||
| false, | ||
| array( | ||
| 'value' => '', | ||
| 'class' => 'frm_show_upgrade frm_noallow', | ||
| 'data-upgrade' => __( 'Format currency field', 'formidable' ), | ||
| 'data-medium' => 'format-currency-field', | ||
| ) | ||
| ); | ||
|
|
||
| if ( 'text' === $field_type ) { | ||
| FrmHtmlHelper::echo_dropdown_option( | ||
| __( 'Custom', 'formidable' ), | ||
| ! empty( $format ) && ! FrmCurrencyHelper::is_currency_format( $format ), | ||
| array( | ||
| 'value' => 'custom', | ||
| 'data-dependency' => '#frm-field-format-custom-' . $field_id, | ||
|
shervElmi marked this conversation as resolved.
|
||
| ) | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| <?php | ||
| /** | ||
| * @package Formidable | ||
| * @since x.x | ||
| * | ||
| * @var array $field Field data. | ||
| * @var array $args Includes 'field', 'display', and 'values' settings. | ||
| * @var FrmFieldType $this Field type object. | ||
| */ | ||
|
|
||
| if ( ! defined( 'ABSPATH' ) ) { | ||
| die( 'You are not allowed to call this page directly.' ); | ||
| } | ||
|
|
||
| $field_id = $field['id']; | ||
| ?> | ||
| <p class="frm6 frm_form_field frm-format-dropdown"> | ||
| <label for="format_dropdown_<?php echo esc_attr( $field_id ); ?>"> | ||
| <?php esc_html_e( 'Format', 'formidable' ); ?> | ||
| </label> | ||
|
|
||
| <select | ||
| name="field_options[format_dropdown_<?php echo esc_attr( $field_id ); ?>]" | ||
| id="frm_format_dropdown_<?php echo esc_attr( $field_id ); ?>" | ||
| class="frm_format_dropdown frm_select_with_upgrade frm_select_with_dependency" | ||
| data-field-id="<?php echo intval( $field_id ); ?>" | ||
| > | ||
| <?php | ||
| $options_view_path = FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/format-dropdown-options.php'; | ||
|
|
||
| /** | ||
| * Includes the formatted options view file. | ||
| * | ||
| * @since x.x | ||
| * | ||
| * @param string $options_view_path The path to the options view file. | ||
| */ | ||
| require apply_filters( 'frm_format_options_view_path', $options_view_path ); | ||
| ?> | ||
| </select> | ||
| </p> | ||
|
|
||
| <?php | ||
| /** | ||
| * Fires after the format dropdown template is rendered. | ||
| * | ||
| * @since x.x | ||
| * | ||
| * @param array $field The field array. | ||
| */ | ||
| do_action( 'frm_after_format_dropdown_template', $field ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.