FieldSettings.php 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. return apply_filters( 'ninja_forms_field_settings', array(
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Primary Settings
  6. |--------------------------------------------------------------------------
  7. |
  8. | The most commonly used settings for a field.
  9. |
  10. */
  11. /*
  12. * LABEL
  13. */
  14. 'label' => array(
  15. 'name' => 'label',
  16. 'type' => 'textbox',
  17. 'label' => __( 'Label', 'ninja-forms'),
  18. 'width' => 'one-half',
  19. 'group' => 'primary',
  20. 'value' => '',
  21. 'help' => __( 'Enter the label of the form field. This is how users will identify individual fields.', 'ninja-forms' ),
  22. ),
  23. /*
  24. * LABEL POSITION
  25. */
  26. 'label_pos' => array(
  27. 'name' => 'label_pos',
  28. 'type' => 'select',
  29. 'label' => __( 'Label Position', 'ninja-forms' ),
  30. 'options' => array(
  31. array(
  32. 'label' => __( 'Form Default', 'ninja-forms' ),
  33. 'value' => 'default'
  34. ),
  35. array(
  36. 'label' => __( 'Above Element', 'ninja-forms' ),
  37. 'value' => 'above'
  38. ),
  39. array(
  40. 'label' => __( 'Below Element', 'ninja-forms' ),
  41. 'value' => 'below'
  42. ),
  43. array(
  44. 'label' => __( 'Left of Element', 'ninja-forms' ),
  45. 'value' => 'left'
  46. ),
  47. array(
  48. 'label' => __( 'Right of Element', 'ninja-forms' ),
  49. 'value' => 'right'
  50. ),
  51. array(
  52. 'label' => __( 'Hidden', 'ninja-forms' ),
  53. 'value' => 'hidden'
  54. ),
  55. ),
  56. 'width' => 'one-half',
  57. 'group' => 'primary',
  58. 'value' => 'default',
  59. 'help' => __( 'Select the position of your label relative to the field element itself.', 'ninja-forms' ),
  60. ),
  61. /*
  62. * REQUIRED
  63. */
  64. 'required' => array(
  65. 'name' => 'required',
  66. 'type' => 'toggle',
  67. 'label' => __( 'Required Field', 'ninja-forms' ),
  68. 'width' => 'one-half',
  69. 'group' => 'primary',
  70. 'value' => FALSE,
  71. 'help' => __( 'Ensure that this field is completed before allowing the form to be submitted.', 'ninja-forms' ),
  72. ),
  73. /*
  74. * NUMBER
  75. */
  76. 'number' => array(
  77. 'name' => 'number',
  78. 'type' => 'fieldset',
  79. 'label' => __( 'Number Options', 'ninja-forms' ),
  80. 'width' => 'full',
  81. 'group' => 'primary',
  82. 'settings' => array(
  83. array(
  84. 'name' => 'num_min',
  85. 'type' => 'number',
  86. 'placeholder' => '',
  87. 'label' => __( 'Min', 'ninja-forms' ),
  88. 'width' => 'one-third',
  89. 'value' => ''
  90. ),
  91. array(
  92. 'name' => 'num_max',
  93. 'type' => 'number',
  94. 'label' => __( 'Max', 'ninja-forms' ),
  95. 'placeholder' => '',
  96. 'width' => 'one-third',
  97. 'value' => ''
  98. ),
  99. array(
  100. 'name' => 'num_step',
  101. 'type' => 'textbox',
  102. 'label' => __( 'Step', 'ninja-forms' ),
  103. 'placeholder' => '',
  104. 'width' => 'one-third',
  105. 'value' => 1
  106. ),
  107. ),
  108. ),
  109. /*
  110. * Checkbox Default Value
  111. */
  112. 'checkbox_default_value' => array(
  113. 'name' => 'default_value',
  114. 'type' => 'select',
  115. 'label' => __( 'Default Value', 'ninja-forms' ),
  116. 'options' => array(
  117. array(
  118. 'label' => __( 'Unchecked', 'ninja-forms' ),
  119. 'value' => 'unchecked'
  120. ),
  121. array(
  122. 'label' => __( 'Checked', 'ninja-forms'),
  123. 'value' => 'checked',
  124. ),
  125. ),
  126. 'width' => 'one-half',
  127. 'group' => 'primary',
  128. 'value' => 'unchecked',
  129. ),
  130. /*
  131. * Checkbox Values
  132. */
  133. 'checkbox_values' => array(
  134. 'name' => 'checkbox_values',
  135. 'type' => 'fieldset',
  136. 'label' => __( 'Checkbox Values', 'ninja-forms' ),
  137. 'width' => 'full',
  138. 'group' => 'primary',
  139. 'settings' => array(
  140. array(
  141. 'name' => 'checked_value',
  142. 'type' => 'textbox',
  143. 'label' => __( 'Checked Value', 'ninja-forms' ),
  144. 'value' => __( 'Checked', 'ninja-forms' ),
  145. 'width' => 'one-half',
  146. ),
  147. array(
  148. 'name' => 'unchecked_value',
  149. 'type' => 'textbox',
  150. 'label' => __( 'Unchecked Value', 'ninja-forms' ),
  151. 'value' => __( 'Unchecked', 'ninja-forms' ),
  152. 'width' => 'one-half',
  153. ),
  154. ),
  155. ),
  156. /*
  157. * OPTIONS
  158. */
  159. 'options' => array(
  160. 'name' => 'options',
  161. 'type' => 'option-repeater',
  162. 'label' => __( 'Options', 'ninja-forms' ) . ' <a href="#" class="nf-add-new">' . __( 'Add New', 'ninja-forms' ) . '</a> <a href="#" class="extra nf-open-import-tooltip"><i class="fa fa-sign-in" aria-hidden="true"></i> ' . __( 'Import', 'ninja-forms' ) . '</a>',
  163. 'width' => 'full',
  164. 'group' => 'primary',
  165. // 'value' => 'option-repeater',
  166. 'value' => array(
  167. array( 'label' => __( 'One', 'ninja-forms' ), 'value' => __( 'one', 'ninja-forms' ), 'calc' => '', 'selected' => 0, 'order' => 0 ),
  168. array( 'label' => __( 'Two', 'ninja-forms' ), 'value' => __( 'two', 'ninja-forms' ), 'calc' => '', 'selected' => 0, 'order' => 1 ),
  169. array( 'label' => __( 'Three', 'ninja-forms' ), 'value' => __( 'three', 'ninja-forms' ), 'calc' => '', 'selected' => 0, 'order' => 2 ),
  170. ),
  171. 'columns' => array(
  172. 'label' => array(
  173. 'header' => __( 'Label', 'ninja-forms' ),
  174. 'default' => '',
  175. ),
  176. 'value' => array(
  177. 'header' => __( 'Value', 'ninja-forms' ),
  178. 'default' => '',
  179. ),
  180. 'calc' => array(
  181. 'header' =>__( 'Calc Value', 'ninja-forms' ),
  182. 'default' => '',
  183. ),
  184. 'selected' => array(
  185. 'header' => '<span class="dashicons dashicons-yes"></span>',
  186. 'default' => 0,
  187. ),
  188. ),
  189. ),
  190. /*
  191. |--------------------------------------------------------------------------
  192. | Restriction Settings
  193. |--------------------------------------------------------------------------
  194. |
  195. | Limit the behavior or validation of an input.
  196. |
  197. */
  198. /*
  199. * MASK
  200. */
  201. 'mask' => array(
  202. 'name' => 'mask',
  203. 'type' => 'select',
  204. 'label' => __( 'Input Mask', 'ninja-forms'),
  205. 'width' => 'one-half',
  206. 'group' => 'restrictions',
  207. 'help' => __( 'Restricts the kind of input your users can put into this field.', 'ninja-forms' ),
  208. 'options' => array(
  209. array(
  210. 'label' => __( 'none', 'ninja-forms' ),
  211. 'value' => ''
  212. ),
  213. array(
  214. 'label' => __( 'US Phone', 'ninja-forms' ),
  215. 'value' => '(999) 999-9999',
  216. ),
  217. array(
  218. 'label' => __( 'Date', 'ninja-forms' ),
  219. 'value' => '99/99/9999',
  220. ),
  221. array(
  222. 'label' => __( 'Currency', 'ninja-forms' ),
  223. 'value' => 'currency',
  224. ),
  225. array(
  226. 'label' => __( 'Custom', 'ninja-forms' ),
  227. 'value' => 'custom',
  228. ),
  229. ),
  230. 'value' => '',
  231. ),
  232. /*
  233. * CUSTOM MASK
  234. */
  235. 'custom_mask' => array(
  236. 'name' => 'custom_mask',
  237. 'type' => 'textbox',
  238. 'label' => __( 'Custom Mask', 'ninja-forms'),
  239. 'width' => 'one-half',
  240. 'group' => 'restrictions',
  241. 'value' => '',
  242. 'deps' => array(
  243. 'mask' => 'custom'
  244. ),
  245. 'placeholder' => '',
  246. 'help' => __( '<ul>
  247. <li>a - Represents an alpha character (A-Z,a-z) - Only allows letters to be entered. </li>
  248. <li>9 - Represents a numeric character (0-9) - Only allows numbers to be entered.</li>
  249. <li>* - Represents an alphanumeric character (A-Z,a-z,0-9) - This allows both numbers and
  250. letters to be entered.</li>
  251. </ul>', 'ninja-forms' ),
  252. ),
  253. /*
  254. * INPUT LIMIT SET
  255. */
  256. 'input_limit_set' => array(
  257. 'name' => 'input_limit_set',
  258. 'type' => 'fieldset',
  259. 'label' => __( 'Limit Input to this Number', 'ninja-forms' ),
  260. 'width' => 'full',
  261. 'group' => 'restrictions',
  262. 'settings' => array(
  263. array(
  264. 'name' => 'input_limit',
  265. 'type' => 'textbox',
  266. 'width' => 'one-half',
  267. 'value' => '',
  268. 'label' => '',
  269. ),
  270. array(
  271. 'name' => 'input_limit_type',
  272. 'type' => 'select',
  273. 'options' => array(
  274. array(
  275. 'label' => __( 'Character(s)', 'ninja-forms' ),
  276. 'value' => 'characters'
  277. ),
  278. array(
  279. 'label' => __( 'Word(s)', 'ninja-forms' ),
  280. 'value' => 'word'
  281. ),
  282. ),
  283. 'value' => 'characters',
  284. 'label' => '',
  285. ),
  286. array(
  287. 'name' => 'input_limit_msg',
  288. 'type' => 'textbox',
  289. 'label' => __( 'Text to Appear After Counter', 'ninja-forms' ),
  290. 'placeholder' => __( 'Character(s) left', 'ninja-forms' ),
  291. 'width' => 'full',
  292. 'value' => __( 'Character(s) left', 'ninja-forms' )
  293. )
  294. ),
  295. ),
  296. /*
  297. |--------------------------------------------------------------------------
  298. | Advanced Settings
  299. |--------------------------------------------------------------------------
  300. |
  301. | The least commonly used settings for a field.
  302. | These settings should only be used for specific reasons.
  303. |
  304. */
  305. /*
  306. * Custom Name Attribute
  307. */
  308. 'custom_name_attribute' => array(
  309. 'name' => 'custom_name_attribute',
  310. 'type' => 'textbox',
  311. 'label' => __( 'Custom Name Attribute', 'ninja-forms' ),
  312. 'width' => 'full',
  313. 'group' => 'advanced',
  314. 'value' => '',
  315. 'help' => __( 'This value will be used as the HTML input "name" attribute.', 'ninja-forms' ),
  316. 'use_merge_tags' => FALSE,
  317. ),
  318. /*
  319. * INPUT PLACEHOLDER
  320. */
  321. 'placeholder' => array(
  322. 'name' => 'placeholder',
  323. 'type' => 'textbox',
  324. 'label' => __( 'Placeholder', 'ninja-forms' ),
  325. 'width' => 'full',
  326. 'group' => 'advanced',
  327. 'value' => '',
  328. 'help' => __( 'Enter text you would like displayed in the field before a user enters any data.', 'ninja-forms' ),
  329. 'use_merge_tags' => FALSE,
  330. ),
  331. /*
  332. * DEFAULT VALUE
  333. */
  334. 'default' => array(
  335. 'name' => 'default',
  336. 'label' => __( 'Default Value', 'ninja-forms' ),
  337. 'type' => 'textbox',
  338. 'width' => 'full',
  339. 'value' => '',
  340. 'group' => 'advanced',
  341. 'use_merge_tags' => array(
  342. 'exclude' => array(
  343. 'fields'
  344. )
  345. ),
  346. ),
  347. /*
  348. * CLASSES
  349. */
  350. 'classes' => array(
  351. 'name' => 'classes',
  352. 'type' => 'fieldset',
  353. 'label' => __( 'Custom Class Names', 'ninja-forms' ),
  354. 'width' => 'full',
  355. 'group' => 'display',
  356. 'settings' => array(
  357. array(
  358. 'name' => 'container_class',
  359. 'type' => 'textbox',
  360. 'placeholder' => '',
  361. 'label' => __( 'Container', 'ninja-forms' ),
  362. 'width' => 'one-half',
  363. 'value' => '',
  364. 'use_merge_tags' => FALSE,
  365. 'help' => __( 'Adds an extra class to your field wrapper.', 'ninja-forms' ),
  366. ),
  367. array(
  368. 'name' => 'element_class',
  369. 'type' => 'textbox',
  370. 'label' => __( 'Element', 'ninja-forms' ),
  371. 'placeholder' => '',
  372. 'width' => 'one-half',
  373. 'value' => '',
  374. 'use_merge_tags' => FALSE,
  375. 'help' => __( 'Adds an extra class to your field element.', 'ninja-forms' ),
  376. ),
  377. ),
  378. ),
  379. /*
  380. * DATE FORMAT
  381. */
  382. 'date_format' => array(
  383. 'name' => 'date_format',
  384. 'type' => 'select',
  385. 'label' => __( 'Format', 'ninja-forms' ),
  386. 'width' => 'full',
  387. 'group' => 'primary',
  388. 'options' => array(
  389. array(
  390. 'label' => __( 'Default', 'ninja-forms' ),
  391. 'value' => 'default',
  392. ),
  393. array(
  394. 'label' => __( 'DD/MM/YYYY', 'ninja-forms' ),
  395. 'value' => 'DD/MM/YYYY',
  396. ),
  397. array(
  398. 'label' => __( 'DD-MM-YYYY', 'ninja-forms' ),
  399. 'value' => 'DD-MM-YYYY',
  400. ),
  401. array(
  402. 'label' => __( 'DD.MM.YYYY', 'ninja-forms' ),
  403. 'value' => 'DD.MM.YYYY',
  404. ),
  405. array(
  406. 'label' => __( 'MM/DD/YYYY', 'ninja-forms' ),
  407. 'value' => 'MM/DD/YYYY',
  408. ),
  409. array(
  410. 'label' => __( 'MM-DD-YYYY', 'ninja-forms' ),
  411. 'value' => 'MM-DD-YYYY',
  412. ),
  413. array(
  414. 'label' => __( 'MM.DD.YYYY', 'ninja-forms' ),
  415. 'value' => 'MM.DD.YYYY',
  416. ),
  417. array(
  418. 'label' => __( 'YYYY-MM-DD', 'ninja-forms' ),
  419. 'value' => 'YYYY-MM-DD',
  420. ),
  421. array(
  422. 'label' => __( 'YYYY/MM/DD', 'ninja-forms' ),
  423. 'value' => 'YYYY/MM/DD',
  424. ),
  425. array(
  426. 'label' => __( 'YYYY.MM.DD', 'ninja-forms' ),
  427. 'value' => 'YYYY.MM.DD',
  428. ),
  429. array(
  430. 'label' => __( 'Friday, November 18, 2019', 'ninja-forms' ),
  431. 'value' => 'dddd, MMMM D YYYY',
  432. ),
  433. ),
  434. 'value' => 'default',
  435. ),
  436. /*
  437. * DATE DEFAULT
  438. */
  439. 'date_default' => array(
  440. 'name' => 'date_default',
  441. 'type' => 'toggle',
  442. 'label' => __( 'Default To Current Date', 'ninja-forms' ),
  443. 'width' => 'one-half',
  444. 'group' => 'primary'
  445. ),
  446. /*
  447. * Year Range
  448. */
  449. 'year_range' => array(
  450. 'name' => 'year_range',
  451. 'type' => 'fieldset',
  452. 'label' => __( 'Year Range', 'ninja-forms' ),
  453. 'width' => 'full',
  454. 'group' => 'advanced',
  455. 'settings' => array(
  456. array(
  457. 'name' => 'year_range_start',
  458. 'type' => 'number',
  459. 'label' => __( 'Start Year', 'ninja_forms' ),
  460. 'value' => ''
  461. ),
  462. array(
  463. 'name' => 'year_range_end',
  464. 'type' => 'number',
  465. 'label' => __( 'End Year', 'ninja_forms' ),
  466. 'value' => ''
  467. ),
  468. )
  469. ),
  470. /*
  471. * TIME SETTING
  472. */
  473. 'time_submit' => array(
  474. 'name' => 'time_submit',
  475. 'type' => 'textbox',
  476. 'label' => __( 'Number of seconds for timed submit.', 'ninja-forms' ),
  477. 'width' => 'full',
  478. 'group' => 'advanced',
  479. 'value' => FALSE,
  480. ),
  481. /*
  482. * KEY
  483. */
  484. 'key' => array(
  485. 'name' => 'key',
  486. 'type' => 'textbox',
  487. 'label' => __( 'Field Key', 'ninja-forms'),
  488. 'width' => 'full',
  489. 'group' => 'administration',
  490. 'value' => '',
  491. 'help' => __( 'Creates a unique key to identify and target your field for custom development.', 'ninja-forms' ),
  492. ),
  493. /*
  494. * ADMIN LABEL
  495. */
  496. 'admin_label' => array(
  497. 'name' => 'admin_label',
  498. 'type' => 'textbox',
  499. 'label' => __( 'Admin Label', 'ninja-forms' ),
  500. 'width' => 'full',
  501. 'group' => 'administration',
  502. 'value' => '',
  503. 'help' => __( 'Label used when viewing and exporting submissions.', 'ninja-forms' ),
  504. ),
  505. /*
  506. * HELP
  507. */
  508. 'help' => array(
  509. 'name' => 'help',
  510. 'type' => 'fieldset',
  511. 'label' => __( 'Help Text', 'ninja-forms' ),
  512. 'group' => 'display',
  513. 'help' => __( 'Shown to users as a hover.', 'ninja-forms' ),
  514. 'settings' => array(
  515. /*
  516. * HELP TEXT
  517. */
  518. 'help_text' => array(
  519. 'name' => 'help_text',
  520. 'type' => 'rte',
  521. 'label' => '',
  522. 'width' => 'full',
  523. 'group' => 'advanced',
  524. 'value' => '',
  525. 'use_merge_tags' => true,
  526. ),
  527. ),
  528. ),
  529. /*
  530. * DESCRIPTION
  531. */
  532. 'description' => array(
  533. 'name' => 'description',
  534. 'type' => 'fieldset',
  535. 'label' => __( 'Description', 'ninja-forms' ),
  536. 'group' => 'display',
  537. 'settings' => array(
  538. /*
  539. * DESCRIPTION TEXT
  540. */
  541. 'desc_text' => array(
  542. 'name' => 'desc_text',
  543. 'type' => 'rte',
  544. 'label' => '',
  545. 'width' => 'full',
  546. 'use_merge_tags' => true,
  547. ),
  548. /*
  549. * DESCRIPTION POSITION
  550. */
  551. // 'desc_pos' => array(
  552. // 'name' => 'desc_pos',
  553. // 'type' => 'select',
  554. // 'options' => array(
  555. // array(
  556. // 'label' => __( 'None', 'ninja-forms' ),
  557. // 'value' => 'none',
  558. // ),
  559. // array(
  560. // 'label' => __( 'Before Everything', 'ninja-forms' ),
  561. // 'value' => 'before_everything',
  562. // ),
  563. // array(
  564. // 'label' => __( 'Before Label', 'ninja-forms' ),
  565. // 'value' => 'before_label',
  566. // ),
  567. // array(
  568. // 'label' => __( 'After Label', 'ninja-forms' ),
  569. // 'value' => 'after_label',
  570. // ),
  571. // array(
  572. // 'label' => __( 'After Everything', 'ninja-forms' ),
  573. // 'value' => 'after_everything',
  574. // ),
  575. // ),
  576. // 'label' => __( 'Display Position', 'ninja-forms' ),
  577. // 'width' => 'full',
  578. // 'help' => __( 'Determines the position of the label relative to the field element.', 'ninja-forms' ),
  579. // ),
  580. ),
  581. ),
  582. /*
  583. * NUMERIC SORT
  584. */
  585. 'num_sort' => array(
  586. 'name' => 'num_sort',
  587. 'type' => 'toggle',
  588. 'label' => __( 'Sort as Numeric', 'ninja-forms'),
  589. 'width' => 'full',
  590. 'group' => 'administration',
  591. 'value' => '',
  592. 'help' => __( 'This column in the submissions table will sort by number.', 'ninja-forms' ),
  593. ),
  594. 'personally_identifiable' => array(
  595. 'name' => 'personally_identifiable',
  596. 'type' => 'toggle',
  597. 'group' => 'advanced',
  598. 'label' => __( 'This Field Is Personally Identifiable Data', 'ninja-forms' ),
  599. 'width' => 'full',
  600. 'value' => '',
  601. 'help' => __( 'This option helps with privacy regulation compliance', 'ninja-forms' ),
  602. ),
  603. /*
  604. |--------------------------------------------------------------------------
  605. | Display Settings
  606. |--------------------------------------------------------------------------
  607. */
  608. // Multi-Select List Only
  609. 'multi_size' => array(
  610. 'name' => 'multi_size',
  611. 'type' => 'number',
  612. 'label' => __( 'Multi-Select Box Size', 'ninja-forms'),
  613. 'width' => 'one-half',
  614. 'group' => 'primary',
  615. 'value' => 5,
  616. ),
  617. /*
  618. |--------------------------------------------------------------------------
  619. | Un-Grouped Settings
  620. |--------------------------------------------------------------------------
  621. |
  622. | Hidden from grouped listings, but still searchable.
  623. |
  624. */
  625. 'manual_key' => array(
  626. 'name' => 'manual_key',
  627. 'type' => 'bool',
  628. 'value' => FALSE,
  629. ),
  630. /*
  631. * Timed Submit Label
  632. */
  633. // 'timed_submit' => array(
  634. // 'name' => 'timed_submit',
  635. // 'type' => 'fieldset',
  636. // 'label' => __( 'Timed Submit', 'ninja-forms' ),
  637. // 'width' => 'full',
  638. // 'group' => 'advanced',
  639. // 'settings' => array(
  640. // array(
  641. // 'name' => 'timed_submit_countdown',
  642. // 'type' => 'number',
  643. // 'label' => __( 'Countdown', 'ninja-forms' ),
  644. // 'value' => 10,
  645. // 'placeholder' => '',
  646. // 'width' => 'one-half',
  647. //
  648. // ),
  649. // array(
  650. // 'name' => 'timed_submit_label',
  651. // 'type' => 'textbox',
  652. // 'placeholder' => '',
  653. // 'label' => __( 'Timer Label', 'ninja-forms' ),
  654. // 'value' => __( 'Please wait %n seconds', 'ninja-forms' ),
  655. // 'width' => 'one-half'
  656. //
  657. // ),
  658. // ),
  659. // ),
  660. 'timed_submit_label' => array(
  661. 'name' => 'timed_submit_label',
  662. 'type' => 'textbox',
  663. 'label' => __( 'Label', 'ninja-forms' ),
  664. //The following text appears below the element
  665. //'Submit button text after timer expires'
  666. 'width' => '',
  667. 'group' => '',
  668. 'value' => '',
  669. 'use_merge_tags' => TRUE,
  670. ),
  671. /*
  672. * Timed Submit Timer
  673. */
  674. 'timed_submit_timer' => array(
  675. 'name' => 'timed_submit_timer',
  676. 'type' => 'textbox',
  677. 'label' => __( 'Label' , 'ninja-forms' ),
  678. // This text was located below the element '%n will be used to signfify the number of seconds'
  679. 'value' => __( 'Please wait %n seconds', 'ninja-forms' ),
  680. 'width' => '',
  681. 'group' => '',
  682. ),
  683. /*
  684. * Timed Submit Countdown
  685. */
  686. 'timed_submit_countdown' => array (
  687. 'name' => 'timed_submit_countdown',
  688. 'type' => 'number',
  689. 'label' => __( 'Number of seconds for the countdown', 'ninja-forms' ),
  690. //The following text appears to the right of the element
  691. //"This is how long the user must waitin to submit the form"
  692. 'value' => 10,
  693. 'width' => '',
  694. 'group' => '',
  695. ),
  696. /*
  697. * Password Registration checkbox
  698. */
  699. 'password_registration_checkbox' => array(
  700. 'name' => 'password_registration_checkbox',
  701. 'type' => 'checkbox',
  702. 'value' => 'unchecked',
  703. 'label' => __( 'Use this as a reistration password field. If this box is check, both
  704. password and re-password textboxes will be output', 'ninja-forms' ),
  705. 'width' => '',
  706. 'group' => '',
  707. ),
  708. /*
  709. * Number of Stars Textbox
  710. */
  711. 'number_of_stars' => array(
  712. 'name' => 'number_of_stars',
  713. 'type' => 'textbox',
  714. 'value' => 5,
  715. 'label' => __( 'Number of stars', 'ninja-forms' ),
  716. 'width' => 'full',
  717. 'group' => '',
  718. ),
  719. /*
  720. * Disable Browser Autocomplete
  721. */
  722. 'disable_browser_autocomplete' => array(
  723. 'name' => 'disable_browser_autocomplete',
  724. 'type' => 'toggle',
  725. 'label' => __( 'Disable Browser Autocomplete', 'ninja-forms' ),
  726. 'width' => 'full',
  727. 'group' => 'restrictions',
  728. ),
  729. /*
  730. * Disable input
  731. */
  732. 'disable_input' => array(
  733. 'name' => 'disable_input',
  734. 'type' => 'toggle',
  735. 'label' => __( 'Disable Input', 'ninja-forms' ),
  736. 'width' => 'full',
  737. 'group' => 'restrictions',
  738. ),
  739. //TODO: Ask about the list of states and countries.
  740. /*
  741. * Country - Use Custom First Option
  742. */
  743. 'use_custom_first_option' => array(
  744. 'name' => 'use_custom_first_option',
  745. 'type' => 'checkbox',
  746. 'value' => 'unchecked',
  747. 'label' => __( 'Use a custom first option', 'ninja-forms' ),
  748. 'width' => '',
  749. 'group' => '',
  750. ),
  751. /*
  752. * Country - Custom first option
  753. */
  754. 'custom_first_option' => array(
  755. 'name' => 'custom_first_option',
  756. 'type' => 'textbox',
  757. 'label' => __( 'Custom first option', 'ninja-forms' ),
  758. 'width' => '',
  759. 'group' => '',
  760. 'value' => FALSE,
  761. ),
  762. 'type' => array(
  763. 'name' => 'type',
  764. 'type' => 'select',
  765. 'options' => array(),
  766. 'label' => __( 'Type', 'ninja-forms' ),
  767. 'width' => 'full',
  768. 'group' => 'primary',
  769. 'value' => 'single',
  770. ),
  771. 'fieldset' => array(
  772. 'name' => 'fieldset',
  773. 'type' => 'fieldset',
  774. 'label' => __( 'Settings', 'ninja-forms' ),
  775. 'width' => 'full',
  776. 'group' => 'primary',
  777. 'settings' => array(),
  778. ),
  779. 'confirm_field' => array(
  780. 'name' => 'confirm_field',
  781. 'type' => 'field-select',
  782. 'label' => __( 'Confirm', 'ninja-forms' ),
  783. 'width' => 'full',
  784. 'group' => 'primary'
  785. ),
  786. /*
  787. |--------------------------------------------------------------------------
  788. | Textarea Settings
  789. |--------------------------------------------------------------------------
  790. */
  791. 'textarea_rte' => array(
  792. 'name' => 'textarea_rte',
  793. 'type' => 'toggle',
  794. 'label' => __( 'Show Rich Text Editor', 'ninja-forms' ),
  795. 'width' => 'one-third',
  796. 'group' => 'display',
  797. 'value' => '',
  798. 'help' => __( 'Allows rich text input.', 'ninja-forms' ),
  799. ),
  800. 'textarea_media' => array(
  801. 'name' => 'textarea_media',
  802. 'type' => 'toggle',
  803. 'label' => __( 'Show Media Upload Button', 'ninja-forms' ),
  804. 'width' => 'one-third',
  805. 'group' => 'display',
  806. 'value' => '',
  807. 'deps' => array(
  808. 'textarea_rte' => 1
  809. )
  810. ),
  811. 'disable_rte_mobile' => array(
  812. 'name' => 'disable_rte_mobile',
  813. 'type' => 'toggle',
  814. 'label' => __( 'Disable Rich Text Editor on Mobile', 'ninja-forms' ),
  815. 'width' => 'one-third',
  816. 'group' => 'display',
  817. 'value' => '',
  818. 'deps' => array(
  819. 'textarea_rte' => 1
  820. )
  821. ),
  822. /*
  823. |--------------------------------------------------------------------------
  824. | Submit Button Settings
  825. |--------------------------------------------------------------------------
  826. */
  827. 'processing_label' => array(
  828. 'name' => 'processing_label',
  829. 'type' => 'textbox',
  830. 'label' => __( 'Processing Label', 'ninja-forms' ),
  831. 'width' => 'full',
  832. 'group' => 'primary',
  833. 'value' => __( 'Processing', 'ninja-forms' )
  834. ),
  835. /*
  836. |--------------------------------------------------------------------------
  837. | Calc Value that is used for checkbox fields
  838. |--------------------------------------------------------------------------
  839. */
  840. 'checked_calc_value' => array(
  841. 'name' => 'checked_calc_value',
  842. 'type' => 'textbox',
  843. 'label' => __( 'Checked Calculation Value', 'ninja-forms' ),
  844. 'width' => 'one-half',
  845. 'group' => 'advanced',
  846. 'help' => __( 'This number will be used in calculations if the box is checked.', 'ninja-forms' ),
  847. ),
  848. 'unchecked_calc_value' => array(
  849. 'name' => 'unchecked_calc_value',
  850. 'type' => 'textbox',
  851. 'label' => __( 'Unchecked Calculation Value', 'ninja-forms' ),
  852. 'width' => 'one-half',
  853. 'group' => 'advanced',
  854. 'help' => __( 'This number will be used in calculations if the box is unchecked.', 'ninja-forms' ),
  855. ),
  856. /*
  857. |--------------------------------------------------------------------------
  858. | DISPLAY CALCULATION SETTINGS
  859. |--------------------------------------------------------------------------
  860. */
  861. 'calc_var' => array(
  862. 'name' => 'calc_var',
  863. 'type' => 'select',
  864. 'label' => __( 'Display This Calculation Variable', 'ninja-forms' ),
  865. 'width' => 'full',
  866. 'group' => 'primary',
  867. 'options' => array(),
  868. 'select_product' => array(
  869. 'value' => '',
  870. 'label' => __( '- Select a Variable', 'ninja-forms' ),
  871. ),
  872. ),
  873. /*
  874. |--------------------------------------------------------------------------
  875. | Pricing Fields Settings
  876. |--------------------------------------------------------------------------
  877. */
  878. 'product_price' => array(
  879. 'name' => 'product_price',
  880. 'type' => 'textbox',
  881. 'label' => __( 'Price', 'ninja-forms' ),
  882. 'width' => 'one-half',
  883. 'group' => 'primary',
  884. 'value' => '1.00',
  885. 'mask' => array(
  886. 'type' => 'currency', // 'numeric', 'currency', 'custom'
  887. 'options' => array()
  888. )
  889. ),
  890. 'product_use_quantity' => array(
  891. 'name' => 'product_use_quantity',
  892. 'type' => 'toggle',
  893. 'label' => __( 'Use Inline Quantity', 'ninja-forms' ),
  894. 'width' => 'one-half',
  895. 'group' => 'primary',
  896. 'value' => TRUE,
  897. 'help' => __( 'Allows users to choose more than one of this product.', 'ninja-forms' ),
  898. ),
  899. 'product_type' => array(
  900. 'name' => 'product_type',
  901. 'type' => 'select',
  902. 'label' => __( 'Product Type', 'ninja-forms' ),
  903. 'width' => 'full',
  904. 'group' => '',
  905. 'options' => array(
  906. array(
  907. 'label' => __( 'Single Product (default)', 'ninja-forms' ),
  908. 'value' => 'single'
  909. ),
  910. array(
  911. 'label' => __( 'Multi Product - Dropdown', 'ninja-forms' ),
  912. 'value' => 'dropdown'
  913. ),
  914. array(
  915. 'label' => __( 'Multi Product - Choose Many', 'ninja-forms' ),
  916. 'value' => 'checkboxes'
  917. ),
  918. array(
  919. 'label' => __( 'Multi Product - Choose One', 'ninja-forms' ),
  920. 'value' => 'radiolist'
  921. ),
  922. array(
  923. 'label' => __( 'User Entry', 'ninja-forms' ),
  924. 'value' => 'user'
  925. ),
  926. array(
  927. 'label' => __( 'Hidden', 'ninja-forms' ),
  928. 'value' => 'hidden'
  929. ),
  930. ),
  931. 'value' => 'single',
  932. 'use_merge_tags' => FALSE
  933. ),
  934. 'shipping_cost' => array(
  935. 'name' => 'shipping_cost',
  936. 'type' => 'textbox',
  937. 'label' => __( 'Cost', 'ninja-forms' ),
  938. 'width' => 'full',
  939. 'group' => 'primary',
  940. 'value' => '0.00',
  941. 'mask' => array(
  942. 'type' => 'currency', // 'numeric', 'currency', 'custom'
  943. 'options' => array()
  944. ),
  945. 'deps' => array(
  946. 'shipping_type' => 'single',
  947. ),
  948. ),
  949. 'shipping_options' => array(
  950. 'name' => 'shipping_options',
  951. 'type' => 'option-repeater',
  952. 'label' => __( 'Cost Options', 'ninja-forms' ) . ' <a href="#" class="nf-add-new">' . __( 'Add New', 'ninja-forms' ) . '</a>',
  953. 'width' => 'full',
  954. 'group' => 'primary',
  955. 'value' => array(
  956. array( 'label' => __( 'One', 'ninja-forms' ), 'value' => '1.00', 'order' => 0 ),
  957. array( 'label' => __( 'Two', 'ninja-forms' ), 'value' => '2.00', 'order' => 1 ),
  958. array( 'label' => __( 'Three', 'ninja-forms' ), 'value' => '3.00', 'order' => 2 ),
  959. ),
  960. 'columns' => array(
  961. 'label' => array(
  962. 'header' => __( 'Label', 'ninja-forms' ),
  963. 'default' => '',
  964. ),
  965. 'value' => array(
  966. 'header' => __( 'Value', 'ninja-forms' ),
  967. 'default' => '',
  968. ),
  969. ),
  970. 'deps' => array(
  971. 'shipping_type' => 'select'
  972. ),
  973. ),
  974. 'shipping_type' => array(
  975. 'name' => 'shipping_type',
  976. 'type' => 'select',
  977. 'options' => array(
  978. array(
  979. 'label' => __( 'Single Cost', 'ninja-forms' ),
  980. 'value' => 'single',
  981. ),
  982. array(
  983. 'label' => __( 'Cost Dropdown', 'ninja-forms' ),
  984. 'value' => 'select',
  985. ),
  986. ),
  987. 'label' => __( 'Cost Type', 'ninja-forms' ),
  988. 'width' => 'full',
  989. 'group' => '', //'primary',
  990. 'value' => 'single',
  991. ),
  992. 'product_assignment' => array(
  993. 'name' => 'product_assignment',
  994. 'type' => 'select',
  995. 'label' => __( 'Product', 'ninja-forms' ),
  996. 'width' => 'full',
  997. 'group' => 'primary',
  998. 'options' => array(),
  999. 'select_product' => array(
  1000. 'value' => '',
  1001. 'label' => __( '- Select a Product', 'ninja-forms' ),
  1002. ),
  1003. ),
  1004. /*
  1005. |--------------------------------------------------------------------------
  1006. | Anti-Spam Field Settings
  1007. |--------------------------------------------------------------------------
  1008. */
  1009. /*
  1010. * Spam Answer
  1011. */
  1012. 'spam_answer' => array(
  1013. 'name' => 'spam_answer',
  1014. 'type' => 'textbox',
  1015. 'label' => __( 'Answer', 'ninja-forms'),
  1016. 'width' => 'full',
  1017. 'group' => 'primary',
  1018. 'value' => '',
  1019. 'help' => __( 'A case sensitive answer to help prevent spam submissions of your form.', 'ninja-forms' ),
  1020. ),
  1021. /*
  1022. |--------------------------------------------------------------------------
  1023. | Term Field Settings
  1024. |--------------------------------------------------------------------------
  1025. */
  1026. /*
  1027. * Taxonomy
  1028. */
  1029. 'taxonomy' => array(
  1030. 'name' => 'taxonomy',
  1031. 'type' => 'select',
  1032. 'label' => __( 'Taxonomy', 'ninja-forms'),
  1033. 'width' => 'full',
  1034. 'group' => 'primary',
  1035. 'options' => array(
  1036. array(
  1037. 'label' => "-",
  1038. 'value' => ''
  1039. )
  1040. )
  1041. ),
  1042. /*
  1043. * Add New Terms
  1044. */
  1045. 'add_new_terms' => array(
  1046. 'name' => 'add_new_terms',
  1047. 'type' => 'toggle',
  1048. 'label' => __( 'Add New Terms', 'ninja-forms'),
  1049. 'width' => 'full',
  1050. 'group' => 'advanced',
  1051. ),
  1052. /*
  1053. |--------------------------------------------------------------------------
  1054. | Backwards Compatibility Field Settings
  1055. |--------------------------------------------------------------------------
  1056. */
  1057. 'user_state' => array(
  1058. 'name' => 'user_state',
  1059. 'type' => 'toggle',
  1060. 'label' => __( 'This is a user\'s state.', 'ninja-forms' ),
  1061. 'width' => 'full',
  1062. 'group' => 'administration',
  1063. 'value' => FALSE,
  1064. 'help' => __( 'Used for marking a field for processing.', 'ninja-forms' ),
  1065. ),
  1066. ));
  1067. // Example of settings
  1068. // Add all core settings. Fields can unset if unneeded.
  1069. // $this->_settings = $this->load_settings(
  1070. // array( 'label', 'label_pos', 'required', 'number', 'spam_question', 'mask', 'input_limit_set','rich_text_editor', 'placeholder', 'textare_placeholder', 'default', 'checkbox_default_value', 'classes', 'timed_submit' )
  1071. // );