| @@ -2,37 +2,86 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: Repeater for Gravity Forms |
| 4 | 4 | * Description: The add-on that allows specified groups of fields to be repeated by the user. |
| 5 | 5 | * Plugin URI: https://add-ons.org/plugin/gravity-forms-repeater-fields/ |
| 6 | - * Version: 2.0.5 | |
| 6 | + * Version: 3.2.2 | |
| 7 | 7 | * Author: add-ons.org |
| 8 | - * Text Domain: repeater-for-gravityforms | |
| 9 | - * Domain Path: /languages | |
| 10 | 8 | * Author URI: https://add-ons.org/ |
| 11 | 9 | * License: GPL v2 or later |
| 12 | 10 | * License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 13 | -*/ | |
| 14 | -define( 'SUPERADDONS_GF_REPEATER_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); | |
| 15 | -define( 'SUPERADDONS_GF_REPEATER_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); | |
| 16 | -add_action( 'gform_loaded', array( 'Superaddons_Grepeater_Field_AddOn_Init', 'load' ), 5 ); | |
| 17 | -class Superaddons_Grepeater_Field_AddOn_Init { | |
| 18 | - public static function load() { | |
| 19 | - if ( ! method_exists( 'GFForms', 'include_addon_framework' ) ) { | |
| 20 | - return; | |
| 21 | - } | |
| 22 | - include SUPERADDONS_GF_REPEATER_PLUGIN_PATH."add_on.php"; | |
| 23 | - GFAddOn::register( 'Superaddons_Grepeater_Field_Addon' ); | |
| 24 | - include SUPERADDONS_GF_REPEATER_PLUGIN_PATH."superaddons/check_purchase_code.php"; | |
| 25 | - new Superaddons_Check_Purchase_Code( | |
| 26 | - array( | |
| 27 | - "plugin" => "repeater-for-gravity-forms/repeater-for-gravity-forms.php", | |
| 28 | - "id"=>"1540", | |
| 29 | - "pro"=>"https://add-ons.org/plugin/gravity-forms-repeater-fields/", | |
| 30 | - "plugin_name"=> "Repeater Field For Gravity Forms", | |
| 31 | - "document"=>"https://add-ons.org/document-gravity-forms-repeater-fields/" | |
| 32 | - ) | |
| 33 | - ); | |
| 34 | - } | |
| 11 | + */ | |
| 12 | +global $yeeaddons_gf_repeater_settings; | |
| 13 | +define('SUPERADDONS_GF_REPEATER_PLUGIN_URL', plugin_dir_url(__FILE__)); | |
| 14 | +define('SUPERADDONS_GF_REPEATER_PLUGIN_PATH', plugin_dir_path(__FILE__)); | |
| 15 | +add_action('gform_loaded', array('Superaddons_Grepeater_Field_AddOn_Init', 'load'), 5); | |
| 16 | +class Superaddons_Grepeater_Field_AddOn_Init | |
| 17 | +{ | |
| 18 | + public static function load() | |
| 19 | + { | |
| 20 | + if (!method_exists('GFForms', 'include_addon_framework')) { | |
| 21 | + return; | |
| 22 | + } | |
| 23 | + include SUPERADDONS_GF_REPEATER_PLUGIN_PATH . "add_on.php"; | |
| 24 | + GFAddOn::register('Superaddons_Grepeater_Field_Addon'); | |
| 25 | + } | |
| 26 | + | |
| 35 | 27 | } |
| 36 | -if(!class_exists('Superaddons_List_Addons')) { | |
| 37 | - include SUPERADDONS_GF_REPEATER_PLUGIN_PATH."add-ons.php"; | |
| 38 | -} | |
| 28 | +class Yeeaddons_GF_Repeater_Init | |
| 29 | +{ | |
| 30 | + function __construct() | |
| 31 | + { | |
| 32 | + include_once SUPERADDONS_GF_REPEATER_PLUGIN_PATH . "yeekit/document.php"; | |
| 33 | + add_action("yeeaddons_gf_repeater_settings", array($this, "yeeaddons_gf_repeater_settings"), 10); | |
| 34 | + add_action('init', array($this, 'load_textdomain')); | |
| 35 | + } | |
| 36 | + function load_textdomain() | |
| 37 | + { | |
| 38 | + load_plugin_textdomain('repeater-for-gravity-forms', false, dirname(plugin_basename(__FILE__)) . '/languages'); | |
| 39 | + } | |
| 40 | + function yeeaddons_gf_repeater_settings() | |
| 41 | + { | |
| 42 | + ?> | |
| 43 | + <li class="field_field_repeater_initial_rows_setting field_setting"> | |
| 44 | + <label class="section_label"> | |
| 45 | + <?php esc_html_e('Initial Rows', 'repeater-for-gravity-forms'); ?> | |
| 46 | + </label> | |
| 47 | + <div class="pro_disable"> | |
| 48 | + <input placeholder="1" type="text" id="repeater_initial_rows" placeholder="Upgrade to pro version" value="" | |
| 49 | + readonly="true"> | |
| 50 | + </div> | |
| 51 | + <?php esc_html_e("The number of rows at start, if empty no rows will be created", 'repeater-for-gravity-forms') ?> | |
| 52 | + </li> | |
| 53 | + <li class="field_field_repeater_initial_rows_setting field_setting"> | |
| 54 | + <label class="section_label"> | |
| 55 | + <?php esc_html_e('Map field with Initial Rows', 'repeater-for-gravity-forms'); ?> | |
| 56 | + </label> | |
| 57 | + <div class="pro_disable"> | |
| 58 | + <input type="text" id="repeater_initial_rows_map" placeholder="Upgrade to pro version" value="" readonly="true"> | |
| 59 | + </div> | |
| 60 | + <?php esc_html_e("Map field with Initial Rows (ID field)", 'repeater-for-gravity-forms') ?> | |
| 61 | + </li> | |
| 62 | + <li class="field_field_repeater_max_setting field_setting"> | |
| 63 | + <label class="section_label"> | |
| 64 | + <?php esc_html_e('Limit', 'repeater-for-gravity-forms'); ?> | |
| 65 | + </label> | |
| 66 | + <input type="text" id="repeater_max" placeholder="5" value="" | |
| 67 | + onchange="SetFieldProperty('repeater_max', this.value);"> | |
| 68 | + <?php esc_html_e("Max number of rows applicable by the user, leave empty for no limit (Free version limit = 5 )", 'repeater-for-gravity-forms') ?> | |
| 69 | + </li> | |
| 70 | + <li class="field_setting"> | |
| 71 | + <label class="section_label"> | |
| 72 | + <?php esc_html_e('Pricing Fields Support', 'repeater-for-gravity-forms'); ?> | |
| 73 | + </label> | |
| 74 | + <div class="pro_disable" style="opacity: 0.65; cursor: not-allowed; margin-top: 5px;"> | |
| 75 | + <label style="cursor: not-allowed; display: inline-flex; align-items: center; gap: 5px;"> | |
| 76 | + <input type="checkbox" disabled="disabled"> | |
| 77 | + <span><?php esc_html_e('Calculate Pricing in Repeater', 'repeater-for-gravity-forms'); ?></span> | |
| 78 | + <span | |
| 79 | + style="font-size: 10px; background: #d63638; color: #fff; padding: 1px 5px; border-radius: 3px; font-weight: 700; text-transform: uppercase;">PRO</span> | |
| 80 | + </label> | |
| 81 | + </div> | |
| 82 | + <?php esc_html_e("Allows Product, Option, and Quantity fields inside Repeater to calculate Total and process payments (Upgrade to Pro version)", 'repeater-for-gravity-forms') ?> | |
| 83 | + </li> | |
| 84 | + <?php | |
| 85 | + } | |
| 86 | +} | |
| 87 | +$yeeaddons_gf_repeater_settings = new Yeeaddons_GF_Repeater_Init; | |