FormRestrictionSettings.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. return apply_filters( 'ninja_forms_from_restriction_settings', array(
  3. /*
  4. * UNIQUE FIELD SET
  5. */
  6. 'unique-field-set' => array(
  7. 'name' => 'unique-field-set',
  8. 'type' => 'fieldset',
  9. 'label' => __( 'Unique Field', 'ninja-forms' ),
  10. 'width' => 'full',
  11. 'group' => 'primary',
  12. 'settings' => array(
  13. /*
  14. * SET A UNIQUE FIELD
  15. */
  16. 'unique_field' => array(
  17. 'name' => 'unique_field',
  18. 'type' => 'field-select',
  19. // 'label' => __( 'Unique Field', 'ninja-forms' ),
  20. 'width' => 'full',
  21. 'group' => 'primary',
  22. 'field_value_format' => 'key',
  23. /* Optional */
  24. 'field_types' => array(
  25. 'firstname',
  26. 'lastname',
  27. 'email',
  28. 'textbox',
  29. 'listselect',
  30. 'listradio',
  31. 'listmultiselect',
  32. 'date'
  33. ),
  34. ),
  35. /*
  36. * UNIQUE FIELD ERROR
  37. */
  38. 'unique_field_error' => array(
  39. 'name' => 'unique_field_error',
  40. 'type' => 'textbox',
  41. 'label' => __( 'Unique Field Error Message', 'ninja-forms' ),
  42. 'width' => 'full',
  43. 'group' => 'primary',
  44. 'value' => __( 'A form with this value has already been submitted.', 'ninja-forms' ),
  45. ),
  46. )
  47. ),
  48. 'logged-in-set' => array(
  49. 'name' => 'logged-in-set',
  50. 'type' => 'fieldset',
  51. 'label' => __( 'Logged In', 'ninja-forms' ),
  52. 'width' => 'full',
  53. 'group' => 'primary',
  54. 'settings' => array(
  55. /*
  56. * REQUIRE USER TO BE LOGGED IN TO VIEW FORM?
  57. */
  58. 'logged_in' => array(
  59. 'name' => 'logged_in',
  60. 'type' => 'toggle',
  61. 'label' => __( 'Require user to be logged in to view form?', 'ninja-forms' ),
  62. 'width' => 'one-half',
  63. 'group' => 'primary',
  64. 'value' => FALSE,
  65. 'help' => __( 'Does apply to form preview.', 'ninja-forms' )
  66. ),
  67. /*
  68. * NOT LOGGED-IN MESSAGE
  69. */
  70. 'not_logged_in_msg' => array(
  71. 'name' => 'not_logged_in_msg',
  72. 'type' => 'rte', //TODO: Add WYSIWYG
  73. 'label' => __( 'Not Logged-In Message', 'ninja-forms' ),
  74. 'width' => 'full',
  75. 'group' => 'primary',
  76. 'value' => '',
  77. ),
  78. )
  79. ),
  80. 'limit-submissions-set' => array(
  81. 'name' => 'limit-submissions-set',
  82. 'type' => 'fieldset',
  83. 'label' => __( 'Limit Submissions', 'ninja-forms' ),
  84. 'width' => 'full',
  85. 'group' => 'primary',
  86. 'settings' => array(
  87. /*
  88. * LIMIT SUBMISSIONS
  89. */
  90. 'sub_limit_number' => array(
  91. 'name' => 'sub_limit_number',
  92. 'type' => 'number',
  93. 'label' => __( 'Submission Limit', 'ninja-forms' ),
  94. 'width' => 'one-third',
  95. 'group' => 'primary',
  96. 'value' => NULL,
  97. 'help' => __( 'Does NOT apply to form preview.', 'ninja-forms' )
  98. //TODO: Add following text below the element.
  99. //Select the number of submissions that this form will accept. Leave empty for no limit.
  100. ),
  101. /*
  102. * LIMIT REACHED MESSAGE
  103. */
  104. 'sub_limit_msg' => array(
  105. 'name' => 'sub_limit_msg',
  106. 'type' => 'rte',//TODO: Add WYSIWYG
  107. 'label' => __( 'Limit Reached Message', 'ninja-forms' ),
  108. 'width' => 'full',
  109. 'group' => 'primary',
  110. 'value' => __( 'The form has reached its submission limit.', 'ninja-forms' )
  111. //TODO: Add following text below the WYSIWYG.
  112. //Please enter a message that you want displayed when this form has reached its submission limit and will not
  113. //accept new submissions.
  114. ),
  115. )
  116. ),
  117. ));