| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Repeater for Gravity Forms |
| 4 |
* Description: The add-on that allows specified groups of fields to be repeated by the user. |
| 5 |
* Plugin URI: https://add-ons.org/plugin/gravity-forms-repeater-fields/ |
| 6 |
* Version: 2.4.6 |
| 7 |
* Author: add-ons.org |
| 8 |
* Author URI: https://add-ons.org/ |
| 9 |
* Text Domain: repeater-for-gravity-forms |
| 10 |
* Domain Path: /languages |
| 11 |
* License: GPL v2 or later |
| 12 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 13 |
*/ |
| 14 |
global $yeeaddons_gf_repeater_settings; |
| 15 |
define('SUPERADDONS_GF_REPEATER_PLUGIN_URL', plugin_dir_url(__FILE__)); |
| 16 |
define('SUPERADDONS_GF_REPEATER_PLUGIN_PATH', plugin_dir_path(__FILE__)); |
| 17 |
add_action('gform_loaded', array('Superaddons_Grepeater_Field_AddOn_Init', 'load'), 5); |
| 18 |
class Superaddons_Grepeater_Field_AddOn_Init |
| 19 |
{ |
| 20 |
public static function load() |
| 21 |
{ |
| 22 |
if (!method_exists('GFForms', 'include_addon_framework')) { |
| 23 |
return; |
| 24 |
} |
| 25 |
include SUPERADDONS_GF_REPEATER_PLUGIN_PATH . "add_on.php"; |
| 26 |
GFAddOn::register('Superaddons_Grepeater_Field_Addon'); |
| 27 |
} |
| 28 |
|
| 29 |
} |
| 30 |
class Yeeaddons_GF_Repeater_Init |
| 31 |
{ |
| 32 |
function __construct() |
| 33 |
{ |
| 34 |
include_once SUPERADDONS_GF_REPEATER_PLUGIN_PATH . "yeekit/document.php"; |
| 35 |
add_action("yeeaddons_gf_repeater_settings", array($this, "yeeaddons_gf_repeater_settings"), 10); |
| 36 |
add_action('init', array($this, 'load_textdomain')); |
| 37 |
} |
| 38 |
function load_textdomain() |
| 39 |
{ |
| 40 |
load_plugin_textdomain('repeater-for-gravity-forms', false, dirname(plugin_basename(__FILE__)) . '/languages'); |
| 41 |
} |
| 42 |
function yeeaddons_gf_repeater_settings() |
| 43 |
{ |
| 44 |
?> |
| 45 |
<li class="field_field_repeater_initial_rows_setting field_setting"> |
| 46 |
<label class="section_label"> |
| 47 |
<?php esc_html_e('Initial Rows', 'repeater-for-gravity-forms'); ?> |
| 48 |
</label> |
| 49 |
<div class="pro_disable"> |
| 50 |
<input placeholder="1" type="text" id="repeater_initial_rows" placeholder="Upgrade to pro version" value="" |
| 51 |
readonly="true"> |
| 52 |
</div> |
| 53 |
<?php esc_html_e("The number of rows at start, if empty no rows will be created", 'repeater-for-gravity-forms') ?> |
| 54 |
</li> |
| 55 |
<li class="field_field_repeater_initial_rows_setting field_setting"> |
| 56 |
<label class="section_label"> |
| 57 |
<?php esc_html_e('Map field with Initial Rows', 'repeater-for-gravity-forms'); ?> |
| 58 |
</label> |
| 59 |
<div class="pro_disable"> |
| 60 |
<input type="text" id="repeater_initial_rows_map" placeholder="Upgrade to pro version" value="" readonly="true"> |
| 61 |
</div> |
| 62 |
<?php esc_html_e("Map field with Initial Rows (ID field)", 'repeater-for-gravity-forms') ?> |
| 63 |
</li> |
| 64 |
<li class="field_field_repeater_max_setting field_setting"> |
| 65 |
<label class="section_label"> |
| 66 |
<?php esc_html_e('Limit', 'repeater-for-gravity-forms'); ?> |
| 67 |
</label> |
| 68 |
<input type="text" id="repeater_max" placeholder="5" value="" |
| 69 |
onchange="SetFieldProperty('repeater_max', this.value);"> |
| 70 |
<?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') ?> |
| 71 |
</li> |
| 72 |
<?php |
| 73 |
} |
| 74 |
} |
| 75 |
$yeeaddons_gf_repeater_settings = new Yeeaddons_GF_Repeater_Init; |