PageRenderTime 225ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/form_detail.php

https://gitlab.com/level-level/gravityforms
PHP | 1098 lines | 621 code | 60 blank | 417 comment | 29 complexity | 95a766918a8593881a63cc2d954247f1 MD5 | raw file
  1. <?php
  2. if ( ! class_exists( 'GFForms' ) ) {
  3. die();
  4. }
  5. class GFFormDetail {
  6. public static function forms_page( $form_id ) {
  7. global $wpdb;
  8. if ( ! GFCommon::ensure_wp_version() ) {
  9. return;
  10. }
  11. self::update_recent_forms( $form_id );
  12. $update_result = '';
  13. if ( rgpost( 'operation' ) == 'trash' ) {
  14. check_admin_referer( 'gforms_trash_form', 'gforms_trash_form' );
  15. GFFormsModel::trash_form( $form_id );
  16. ?>
  17. <script type="text/javascript">
  18. jQuery(document).ready(
  19. function () {
  20. document.location.href = '?page=gf_edit_forms';
  21. }
  22. );
  23. </script>
  24. <?php
  25. exit;
  26. } else if ( ! rgempty( 'gform_meta' ) ) {
  27. check_admin_referer( "gforms_update_form_{$form_id}", 'gforms_update_form' );
  28. $update_result = self::save_form_info( $form_id, rgpost( 'gform_meta', false ) );
  29. }
  30. require_once( GFCommon::get_base_path() . '/currency.php' );
  31. wp_print_styles( array( 'thickbox' ) );
  32. /* @var GF_Field_Address $gf_address_field */
  33. $gf_address_field = GF_Fields::get( 'address' );
  34. $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min';
  35. ?>
  36. <link rel="stylesheet" href="<?php echo GFCommon::get_base_url() ?>/css/admin<?php echo $min; ?>.css?ver=<?php echo GFCommon::$version ?>" type="text/css" />
  37. <script type="text/javascript">
  38. <?php GFCommon::gf_global(); ?>
  39. <?php GFCommon::gf_vars(); ?>
  40. </script>
  41. <script type="text/javascript">
  42. function has_entry(fieldNumber) {
  43. var submitted_fields = [<?php echo RGFormsModel::get_submitted_fields( $form_id ); ?>];
  44. for (var i = 0; i < submitted_fields.length; i++) {
  45. if (submitted_fields[i] == fieldNumber)
  46. return true;
  47. }
  48. return false;
  49. }
  50. function InsertPostImageVariable(element_id, callback) {
  51. var variable = jQuery('#' + element_id + '_image_size_select').attr("variable");
  52. var size = jQuery('#' + element_id + '_image_size_select').val();
  53. if (size) {
  54. variable = "{" + variable + ":" + size + "}";
  55. InsertVariable(element_id, callback, variable);
  56. jQuery('#' + element_id + '_image_size_select').hide();
  57. jQuery('#' + element_id + '_image_size_select')[0].selectedIndex = 0;
  58. }
  59. }
  60. function InsertPostContentVariable(element_id, callback) {
  61. var variable = jQuery('#' + element_id + '_variable_select').val();
  62. var regex = /{([^{]*?: *(\d+\.?\d*).*?)}/;
  63. matches = regex.exec(variable);
  64. if (!matches) {
  65. InsertVariable(element_id, callback);
  66. return;
  67. }
  68. variable = matches[1];
  69. field_id = matches[2];
  70. for (var i = 0; i < form["fields"].length; i++) {
  71. if (form["fields"][i]["id"] == field_id) {
  72. if (form["fields"][i]["type"] == "post_image") {
  73. jQuery('#' + element_id + '_image_size_select').attr("variable", variable);
  74. jQuery('#' + element_id + '_image_size_select').show();
  75. return;
  76. }
  77. }
  78. }
  79. InsertVariable(element_id, callback);
  80. }
  81. function IsValidFormula(formula) {
  82. if (formula == '')
  83. return true;
  84. var patt = /{([^}]+)}/i,
  85. exprPatt = /^[0-9 -/*\(\)]+$/i,
  86. expr = formula.replace(/(\r\n|\n|\r)/gm, ''),
  87. match;
  88. while (match = patt.exec(expr)) {
  89. expr = expr.replace(match[0], 1);
  90. }
  91. if (exprPatt.test(expr)) {
  92. try {
  93. var r = eval(expr);
  94. return !isNaN(parseFloat(r)) && isFinite(r);
  95. } catch (e) {
  96. return false;
  97. }
  98. } else {
  99. return false;
  100. }
  101. }
  102. </script>
  103. <?php
  104. $form = ! rgempty( 'meta', $update_result ) ? rgar( $update_result, 'meta' ) : GFFormsModel::get_form_meta( $form_id );
  105. if ( ! isset( $form['fields'] ) || ! is_array( $form['fields'] ) ){
  106. $form['fields'] = array();
  107. }
  108. $form = gf_apply_filters( array( 'gform_admin_pre_render', $form_id ), $form );
  109. if ( isset( $form['id'] ) ) {
  110. echo "<script type=\"text/javascript\">var form = " . json_encode( $form ) . ';</script>';
  111. } else {
  112. echo "<script type=\"text/javascript\">var form = new Form();</script>";
  113. }
  114. ?>
  115. <?php echo GFCommon::get_remote_message(); ?>
  116. <div class="wrap gforms_edit_form <?php echo GFCommon::get_browser_class() ?>">
  117. <?php if ( empty( $form_id ) ) : ?>
  118. <h1><?php esc_html_e( 'New Form', 'gravityforms' ) ?></h1>
  119. <?php else : ?>
  120. <?php GFCommon::form_page_title( $form ); ?>
  121. <?php endif; ?>
  122. <?php GFCommon::display_dismissible_message(); ?>
  123. <?php RGForms::top_toolbar() ?>
  124. <?php
  125. switch ( rgar( $update_result, 'status' ) ) {
  126. case 'invalid_json' :
  127. ?>
  128. <div class="error_base gform_editor_status" id="after_update_error_dialog">
  129. <?php esc_html_e( 'There was an error while saving your form.', 'gravityforms' ) ?>
  130. <?php printf( __( 'Please %scontact our support team%s.', 'gravityforms' ), '<a href="http://www.gravityhelp.com">', '</a>' ) ?>
  131. </div>
  132. <?php
  133. break;
  134. case 'duplicate_title' :
  135. ?>
  136. <div class="error_base gform_editor_status" id="after_update_error_dialog">
  137. <?php esc_html_e( 'The form title you have entered is already taken. Please enter a unique form title.', 'gravityforms' ) ?>
  138. </div>
  139. <?php
  140. break;
  141. default :
  142. if ( ! empty( $update_result ) ) {
  143. ?>
  144. <div class="updated_base gform_editor_status" id="after_update_dialog">
  145. <strong><?php esc_html_e( 'Form updated successfully.', 'gravityforms' ); ?></strong>
  146. </div>
  147. <?php
  148. }
  149. break;
  150. }
  151. ?>
  152. <?php // link to the google webfont library ?>
  153. <style type="text/css">
  154. @import url('//fonts.googleapis.com/css?family=Shadows+Into+Light+Two');
  155. </style>
  156. <form method="post" id="form_trash">
  157. <?php wp_nonce_field( 'gforms_trash_form', 'gforms_trash_form' ); ?>
  158. <input type="hidden" value="trash" name="operation" />
  159. </form>
  160. <table width="100%">
  161. <tr>
  162. <td class="pad_top" valign="top">
  163. <?php
  164. $has_pages = GFCommon::has_pages( $form );
  165. ?>
  166. <div id="gform_pagination" class="selectable gform_settings_container" style="display:<?php echo $has_pages ? 'block' : 'none' ?>;">
  167. <div class="settings_control_container">
  168. <div class="gfield_admin_header_title"><?php esc_html_e( 'Paging: Options', 'gravityforms' ) ?></div>
  169. <a href="javascript:void(0);" class="form_edit_icon edit_icon_collapsed" title="<?php esc_attr_e( 'click to edit page options', 'gravityforms' ); ?>"><i class='fa fa-caret-down fa-lg'></i></a>
  170. </div>
  171. <div class="gf-pagebreak-first gf-pagebreak-container">
  172. <div class="gf-pagebreak-text-before"><?php esc_html_e( 'begin form', 'gravityforms' ) ?></div>
  173. <div class="gf-pagebreak-text-main"><span><?php esc_html_e( 'START PAGING', 'gravityforms' ) ?></span></div>
  174. <div class="gf-pagebreak-text-after"><?php esc_html_e( 'top of the first page', 'gravityforms' ) ?></div>
  175. </div>
  176. <div id="pagination_settings" style="display: none;">
  177. <ul>
  178. <li style="width:100px; padding:0px;">
  179. <a href="#gform_pagination_settings_tab_1"><?php esc_html_e( 'General', 'gravityforms' ); ?></a></li>
  180. <li style="width:100px; padding:0px;">
  181. <a href="#gform_pagination_settings_tab_2"><?php esc_html_e( 'Appearance', 'gravityforms' ); ?></a></li>
  182. </ul>
  183. <div id="gform_pagination_settings_tab_1">
  184. <ul class="gforms_form_settings">
  185. <li>
  186. <label for="pagination_type_container" class="section_label">
  187. <?php esc_html_e( 'Progress Indicator', 'gravityforms' ); ?>
  188. <?php gform_tooltip( 'form_progress_indicator' ) ?>
  189. </label>
  190. <div id="pagination_type_container" class="pagination_container">
  191. <input type="radio" id="pagination_type_percentage" name="pagination_type" value="percentage" onclick='InitPaginationOptions();' onkeypress='InitPaginationOptions();' />
  192. <label for="pagination_type_percentage" class="inline">
  193. <?php esc_html_e( 'Progress Bar', 'gravityforms' ); ?>
  194. </label>
  195. &nbsp;&nbsp;
  196. <input type="radio" id="pagination_type_steps" name="pagination_type" value="steps" onclick='InitPaginationOptions();' onkeypress='InitPaginationOptions();' />
  197. <label for="pagination_type_steps" class="inline">
  198. <?php esc_html_e( 'Steps', 'gravityforms' ); ?>
  199. </label>
  200. &nbsp;&nbsp;
  201. <input type="radio" id="pagination_type_none" name="pagination_type" value="none" onclick='InitPaginationOptions();' onkeypress='InitPaginationOptions();' />
  202. <label for="pagination_type_none" class="inline">
  203. <?php esc_html_e( 'None', 'gravityforms' ); ?>
  204. </label>
  205. </div>
  206. </li>
  207. <li id="percentage_style_setting">
  208. <div class="percentage_style_setting" style="float:left; z-index: 99;">
  209. <label for="percentage_style" style="display:block;" class="section_label">
  210. <?php esc_html_e( 'Progress Bar Style', 'gravityforms' ); ?>
  211. <?php gform_tooltip( 'form_percentage_style' ) ?>
  212. </label>
  213. <select id="percentage_style" onchange="TogglePercentageStyle();">
  214. <option value="blue"> <?php esc_html_e( 'Blue', 'gravityforms' ); ?> </option>
  215. <option value="gray"> <?php esc_html_e( 'Gray', 'gravityforms' ); ?> </option>
  216. <option value="green"> <?php esc_html_e( 'Green', 'gravityforms' ); ?> </option>
  217. <option value="orange"> <?php esc_html_e( 'Orange', 'gravityforms' ); ?> </option>
  218. <option value="red"> <?php esc_html_e( 'Red', 'gravityforms' ); ?> </option>
  219. <option value="custom"> <?php esc_html_e( 'Custom', 'gravityforms' ); ?> </option>
  220. </select>
  221. </div>
  222. <div class="percentage_custom_container" style="float:left; padding-left:20px;">
  223. <label for="percentage_background_color" style="display:block;">
  224. <?php esc_html_e( 'Text Color', 'gravityforms' ); ?>
  225. </label>
  226. <?php self::color_picker( 'percentage_style_custom_color', '' ) ?>
  227. </div>
  228. <div class="percentage_custom_container" style="float:left; padding-left:20px;">
  229. <label for="percentage_background_bgcolor" style="display:block;">
  230. <?php esc_html_e( 'Background Color', 'gravityforms' ); ?>
  231. </label>
  232. <?php self::color_picker( 'percentage_style_custom_bgcolor', '' ) ?>
  233. </div>
  234. </li>
  235. <li id="page_names_setting">
  236. <label for="page_names_container" class="section_label">
  237. <?php esc_html_e( 'Page Names', 'gravityforms' ); ?>
  238. <?php gform_tooltip( 'form_page_names' ) ?>
  239. </label>
  240. <div id="page_names_container" style="margin-top:5px;">
  241. <!-- Populated dynamically from js.php -->
  242. </div>
  243. </li>
  244. <li id="percentage_confirmation_display_setting">
  245. <div class="percentage_confirmation_display_setting">
  246. <input type="checkbox" id="percentage_confirmation_display" onclick="TogglePercentageConfirmationText()" onkeypress="TogglePercentageConfirmationText()">
  247. <label for="percentage_confirmation_display" class="inline">
  248. <?php esc_html_e( 'Display completed progress bar on confirmation', 'gravityforms' ); ?>
  249. <?php gform_tooltip( 'form_percentage_confirmation_display' ); ?>
  250. </label>
  251. </div>
  252. </li>
  253. <li id="percentage_confirmation_page_name_setting">
  254. <div class="percentage_confirmation_page_name_setting">
  255. <label for="percentage_confirmation_page_name" style="display:block;" class="section_label">
  256. <?php esc_html_e( 'Completion Text', 'gravityforms' ); ?> <?php gform_tooltip( 'percentage_confirmation_page_name' ); ?>
  257. </label>
  258. <input type="text" id="percentage_confirmation_page_name" class="fieldwidth-3" />
  259. </div>
  260. </li>
  261. </ul>
  262. </div>
  263. <div id="gform_pagination_settings_tab_2">
  264. <ul class="gforms_form_settings">
  265. <li>
  266. <label for="first_page_css_class" style="display:block;" class="section_label">
  267. <?php esc_html_e( 'CSS Class Name', 'gravityforms' ); ?>
  268. <?php gform_tooltip( 'form_field_css_class' ) ?>
  269. </label>
  270. <input type="text" id="first_page_css_class" size="30" />
  271. </li>
  272. </ul>
  273. </div>
  274. </div>
  275. </div>
  276. <ul id="no-fields-stash" style="display:none;">
  277. <?php // A place to store the "No Fields" placeholder when not in use. ?>
  278. </ul>
  279. <ul id="gform_fields" class="<?php echo GFCommon::get_ul_classes( $form ) ?>" style="position: relative;">
  280. <?php $no_fields_style = ! empty( $form['fields'] ) ? ' style="display:none;"' : null; ?>
  281. <?php // link to the google webfont library ?>
  282. <style type="text/css">
  283. @import url('//fonts.googleapis.com/css?family=Shadows+Into+Light+Two');
  284. </style>
  285. <li id="no-fields"<?php echo $no_fields_style; ?>>
  286. <div class="newform_notice"><?php esc_html_e( "This form doesn't have any fields yet. Follow the steps below to get started.", 'gravityforms' ); ?>
  287. <span></span></div>
  288. <?php // first step ?>
  289. <h4 class="gf_nofield_header gf_nofield_1">1. <?php esc_html_e( 'Select A Field Type', 'gravityforms' ); ?></h4>
  290. <p><?php esc_html_e( 'Start by selecting a field type from the nifty floating panels on the right.', 'gravityforms' ); ?></p>
  291. <div id="gf_nofield_1_instructions">
  292. <span class="gf_nofield_1_instructions_heading gf_tips"><?php esc_html_e( 'Start Over There', 'gravityforms' ); ?></span>
  293. <span class="gf_nofield_1_instructions_copy gf_tips"><?php esc_html_e( 'Pick a field.. any field. Don\'t be shy.', 'gravityforms' ); ?></span>
  294. </div>
  295. <?php // second step ?>
  296. <h4 class="gf_nofield_header gf_nofield_2">2. <?php esc_html_e( 'Click to Add A Field', 'gravityforms' ); ?></h4>
  297. <p><?php esc_html_e( "Once you've found the field type you want, click to add it to the form editor here on the left side of your screen.", 'gravityforms' ); ?></p>
  298. <div id="gf_nofield_2_instructions">
  299. <span class="gf_nofield_2_instructions_copy gf_tips"><?php esc_html_e( 'Now your new field magically appears over here.', 'gravityforms' ); ?></span>
  300. </div>
  301. <?php // third step ?>
  302. <h4 class="gf_nofield_header gf_nofield_3">3. <?php esc_html_e( 'Edit Field Options', 'gravityforms' ); ?></h4>
  303. <p><?php esc_html_e( 'Click on the edit link to configure the various field options', 'gravityforms' ); ?></p>
  304. <div id="gf_nofield_3_instructions">
  305. <span class="gf_nofield_3_instructions_copy_top gf_tips"><?php esc_html_e( 'Preview your changes up here.', 'gravityforms' ); ?></span>
  306. <span class="gf_nofield_3_instructions_copy_mid gf_tips"><?php esc_html_e( 'Edit the field options. Go ahead.. go crazy.', 'gravityforms' ); ?></span>
  307. <span class="gf_nofield_3_instructions_copy_bottom gf_tips"><?php esc_html_e( 'If you get stuck, mouseover the tool tips for a little help.', 'gravityforms' ); ?></span>
  308. </div>
  309. <?php // fourth step ?>
  310. <h4 class="gf_nofield_header gf_nofield_4">4. <?php esc_html_e( 'Drag to Arrange Fields', 'gravityforms' ); ?></h4>
  311. <p><?php esc_html_e( 'Drag the fields to arrange them the way you prefer', 'gravityforms' ); ?></p>
  312. <div id="gf_nofield_4_instructions">
  313. <span class="gf_nofield_4_instructions_copy_top gf_tips"><?php esc_html_e( 'Grab here with your cursor.', 'gravityforms' ); ?></span>
  314. <span class="gf_nofield_4_instructions_copy_bottom gf_tips"><?php esc_html_e( 'Drag up or down to arrange your fields.', 'gravityforms' ); ?></span>
  315. </div>
  316. <?php // fifth step ?>
  317. <h4 class="gf_nofield_header gf_nofield_5">5. <?php esc_html_e( 'Save Your Form', 'gravityforms' ); ?></h4>
  318. <p><?php esc_html_e( "Once you're happy with your form, remember to click on the 'update form' button to save all your hard work.", 'gravityforms' ); ?></p>
  319. <div id="gf_nofield_5_instructions">
  320. <span class="gf_nofield_5_instructions_heading gf_tips"><?php esc_html_e( 'Save Your New Form', 'gravityforms' ); ?></span>
  321. <span class="gf_nofield_5_instructions_copy gf_tips"><?php esc_html_e( "You're done. That's it.", 'gravityforms' ); ?></span>
  322. </div>
  323. </li>
  324. <?php
  325. if ( is_array( rgar( $form, 'fields' ) ) ) {
  326. require_once( GFCommon::get_base_path() . '/form_display.php' );
  327. foreach ( $form['fields'] as $field ) {
  328. echo GFFormDisplay::get_field( $field, '', true, $form );
  329. }
  330. }
  331. ?>
  332. </ul>
  333. <div id="gform_last_page_settings" class="selectable gform_settings_container" style="display:<?php echo $has_pages ? 'block' : 'none' ?>;">
  334. <div class="settings_control_container">
  335. <div class="gfield_admin_header_title"><?php esc_html_e( 'End Page: Options', 'gravityforms' ) ?></div>
  336. <a href="javascript:void(0);" class="form_edit_icon edit_icon_collapsed" title="<?php esc_attr_e( 'Edit Last Page', 'gravityforms' ); ?>"><i class='fa fa-caret-down fa-lg'></i></a>
  337. </div>
  338. <div class="gf-pagebreak-end gf-pagebreak-container">
  339. <div class="gf-pagebreak-text-before"><?php esc_html_e( 'end of last page', 'gravityforms' ) ?></div>
  340. <div class="gf-pagebreak-text-main"><span><?php esc_html_e( 'END PAGING', 'gravityforms' ) ?></span></div>
  341. <div class="gf-pagebreak-text-after"><?php esc_html_e( 'end of form', 'gravityforms' ) ?></div>
  342. </div>
  343. <div id="last_page_settings" style="display:none;">
  344. <ul>
  345. <li style="width:100px; padding:0px;">
  346. <a href="#gform_last_page_settings_tab_1"><?php esc_html_e( 'General', 'gravityforms' ); ?></a></li>
  347. </ul>
  348. <div id="gform_last_page_settings_tab_1">
  349. <ul class="gforms_form_settings">
  350. <li>
  351. <label for="last_page_button_container" class="section_label">
  352. <?php esc_html_e( 'Previous Button', 'gravityforms' ); ?>
  353. <?php gform_tooltip( 'form_field_last_page_button' ) ?>
  354. </label>
  355. <div class="last_page_button_options" id="last_page_button_container">
  356. <input type="radio" id="last_page_button_text" name="last_page_button" value="text" onclick="TogglePageButton('last_page');" onkeypress="TogglePageButton('last_page');" />
  357. <label for="last_page_button_text" class="inline">
  358. <?php esc_html_e( 'Default', 'gravityforms' ); ?>
  359. <?php gform_tooltip( 'previous_button_text' ) ?>
  360. </label>
  361. &nbsp;&nbsp;
  362. <input type="radio" id="last_page_button_image" name="last_page_button" value="image" onclick="TogglePageButton('last_page');" onkeypress="TogglePageButton('last_page');" />
  363. <label for="last_page_button_image" class="inline">
  364. <?php esc_html_e( 'Image', 'gravityforms' ); ?>
  365. <?php gform_tooltip( 'previous_button_image' ) ?>
  366. </label>
  367. <div id="last_page_button_text_container">
  368. <label for="last_page_button_text_input" class="section_label">
  369. <?php esc_html_e( 'Button Text:', 'gravityforms' ); ?>
  370. </label>
  371. <input type="text" id="last_page_button_text_input" class="input_size_b" size="40" />
  372. </div>
  373. <div id="last_page_button_image_container">
  374. <label for="last_page_button_image_url" class="section_label">
  375. <?php esc_html_e( 'Image Path:', 'gravityforms' ); ?>
  376. </label>
  377. <input type="text" id="last_page_button_image_url" size="45" />
  378. </div>
  379. </div>
  380. </li>
  381. </ul>
  382. </div>
  383. </div>
  384. </div>
  385. <div>
  386. <div id="after_insert_dialog" style="display:none;">
  387. <h3><?php esc_html_e( 'You have successfully saved your form!', 'gravityforms' ); ?></h3>
  388. <p><?php esc_html_e( 'What would you like to do next?', 'gravityforms' ); ?></p>
  389. <div class="new-form-option">
  390. <a title="<?php esc_attr_e( 'Preview this form', 'gravityforms' ); ?>" id="preview_form_link" href="<?php echo esc_url_raw( trailingslashit( site_url() ) ); ?>?gf_page=preview&id={formid}" target="_blank"><?php esc_html_e( 'Preview this Form', 'gravityforms' ); ?></a>
  391. </div>
  392. <?php if ( GFCommon::current_user_can_any( 'gravityforms_edit_forms' ) ) { ?>
  393. <div class="new-form-option">
  394. <a title="<?php esc_attr_e( 'Setup email notifications for this form', 'gravityforms' ); ?>" id="notification_form_link" href="#"><?php esc_html_e( 'Setup Email Notifications for this Form', 'gravityforms' ); ?></a>
  395. </div>
  396. <?php } ?>
  397. <div class="new-form-option">
  398. <a title="<?php esc_attr_e( 'Continue editing this form', 'gravityforms' ); ?>" id="edit_form_link" href="#"><?php esc_html_e( 'Continue Editing this Form', 'gravityforms' ); ?></a>
  399. </div>
  400. <div class="new-form-option">
  401. <a title="<?php esc_attr_e( 'I am done. Take me back to form list', 'gravityforms' ); ?>" href="?page=gf_edit_forms"><?php esc_html_e( 'Return to Form List', 'gravityforms' ); ?></a>
  402. </div>
  403. </div>
  404. </div>
  405. <div id="field_settings" style="display: none;">
  406. <ul>
  407. <li style="width:100px; padding:0px;">
  408. <a href="#gform_tab_1"><?php esc_html_e( 'General', 'gravityforms' ); ?></a>
  409. </li>
  410. <li style="width:100px; padding:0px; ">
  411. <a href="#gform_tab_3"><?php esc_html_e( 'Appearance', 'gravityforms' ); ?></a>
  412. </li>
  413. <li style="width:100px; padding:0px; ">
  414. <a href="#gform_tab_2"><?php esc_html_e( 'Advanced', 'gravityforms' ); ?></a>
  415. </li>
  416. </ul>
  417. <div id="gform_tab_1">
  418. <ul>
  419. <?php
  420. /**
  421. * Inserts additional content within the General field settings
  422. *
  423. * Note: This action fires multiple times. Use the first parameter to determine positioning on the list.
  424. *
  425. * @param int 0 The placement of the action being fired
  426. * @param int $form_id The current form ID
  427. */
  428. do_action( 'gform_field_standard_settings', 0, $form_id );
  429. ?>
  430. <li class="label_setting field_setting">
  431. <label for="field_label" class="section_label">
  432. <?php esc_html_e( 'Field Label', 'gravityforms' ); ?>
  433. <?php gform_tooltip( 'form_field_label' ) ?>
  434. <?php gform_tooltip( 'form_field_label_html' ) ?>
  435. </label>
  436. <input type="text" id="field_label" class="fieldwidth-3" size="35" />
  437. </li>
  438. <?php
  439. do_action( 'gform_field_standard_settings', 10, $form_id );
  440. ?>
  441. <li class="description_setting field_setting">
  442. <label for="field_description" class="section_label">
  443. <?php esc_html_e( 'Description', 'gravityforms' ); ?>
  444. <?php gform_tooltip( 'form_field_description' ) ?>
  445. </label>
  446. <textarea id="field_description" class="fieldwidth-3 fieldheight-2"></textarea>
  447. </li>
  448. <?php
  449. do_action( 'gform_field_standard_settings', 20, $form_id );
  450. ?>
  451. <li class="product_field_setting field_setting">
  452. <label for="product_field" class="section_label">
  453. <?php esc_html_e( 'Product Field Mapping', 'gravityforms' ); ?>
  454. <?php gform_tooltip( 'form_field_product' ) ?>
  455. </label>
  456. <select id="product_field" onchange="SetFieldProperty('productField', jQuery(this).val());">
  457. <!-- will be populated when field is selected (js.php) -->
  458. </select>
  459. </li>
  460. <?php
  461. do_action( 'gform_field_standard_settings', 25, $form_id );
  462. ?>
  463. <li class="product_field_type_setting field_setting">
  464. <label for="product_field_type" class="section_label">
  465. <?php esc_html_e( 'Field Type', 'gravityforms' ); ?>
  466. <?php gform_tooltip( 'form_field_type' ) ?>
  467. </label>
  468. <select id="product_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeProductType(jQuery('#product_field_type').val());});">
  469. <option value="singleproduct"><?php esc_html_e( 'Single Product', 'gravityforms' ); ?></option>
  470. <option value="select"><?php esc_html_e( 'Drop Down', 'gravityforms' ); ?></option>
  471. <option value="radio"><?php esc_html_e( 'Radio Buttons', 'gravityforms' ); ?></option>
  472. <option value="price"><?php esc_html_e( 'User Defined Price', 'gravityforms' ); ?></option>
  473. <option value="hiddenproduct"><?php esc_html_e( 'Hidden', 'gravityforms' ); ?></option>
  474. <option value="calculation"><?php esc_html_e( 'Calculation', 'gravityforms' ); ?></option>
  475. </select>
  476. </li>
  477. <?php
  478. do_action( 'gform_field_standard_settings', 37, $form_id );
  479. ?>
  480. <li class="shipping_field_type_setting field_setting">
  481. <label for="shipping_field_type" class="section_label">
  482. <?php esc_html_e( 'Field Type', 'gravityforms' ); ?>
  483. <?php gform_tooltip( 'form_field_type' ) ?>
  484. </label>
  485. <select id="shipping_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeShippingType(jQuery('#shipping_field_type').val());});">
  486. <option value="singleshipping"><?php esc_html_e( 'Single Method', 'gravityforms' ); ?></option>
  487. <option value="select"><?php esc_html_e( 'Drop Down', 'gravityforms' ); ?></option>
  488. <option value="radio"><?php esc_html_e( 'Radio Buttons', 'gravityforms' ); ?></option>
  489. </select>
  490. </li>
  491. <?php
  492. do_action( 'gform_field_standard_settings', 50, $form_id );
  493. ?>
  494. <li class="base_price_setting field_setting">
  495. <label for="field_base_price" class="section_label">
  496. <?php esc_html_e( 'Price', 'gravityforms' ); ?>
  497. <?php gform_tooltip( 'form_field_base_price' ) ?>
  498. </label>
  499. <input type="text" id="field_base_price" onchange="SetBasePrice(this.value)" />
  500. </li>
  501. <?php
  502. do_action( 'gform_field_standard_settings', 75, $form_id );
  503. ?>
  504. <li class="disable_quantity_setting field_setting">
  505. <input type="checkbox" name="field_disable_quantity" id="field_disable_quantity" onclick="SetDisableQuantity(jQuery(this).is(':checked'));" onkeypress="SetDisableQuantity(jQuery(this).is(':checked'));" />
  506. <label for="field_disable_quantity" class="inline">
  507. <?php esc_html_e( 'Disable quantity field', 'gravityforms' ); ?>
  508. <?php gform_tooltip( 'form_field_disable_quantity' ) ?>
  509. </label>
  510. </li>
  511. <?php
  512. do_action( 'gform_field_standard_settings', 100, $form_id );
  513. ?>
  514. <li class="option_field_type_setting field_setting">
  515. <label for="option_field_type" class="section_label">
  516. <?php esc_html_e( 'Field Type', 'gravityforms' ); ?>
  517. <?php gform_tooltip( 'form_field_type' ) ?>
  518. </label>
  519. <select id="option_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#option_field_type').val());});">
  520. <option value="select"><?php esc_html_e( 'Drop Down', 'gravityforms' ); ?></option>
  521. <option value="checkbox"><?php esc_html_e( 'Checkboxes', 'gravityforms' ); ?></option>
  522. <option value="radio"><?php esc_html_e( 'Radio Buttons', 'gravityforms' ); ?></option>
  523. </select>
  524. </li>
  525. <?php
  526. do_action( 'gform_field_standard_settings', 125, $form_id );
  527. ?>
  528. <li class="donation_field_type_setting field_setting">
  529. <label for="donation_field_type" class="section_label">
  530. <?php esc_html_e( 'Field Type', 'gravityforms' ); ?>
  531. <?php gform_tooltip( 'form_field_type' ) ?>
  532. </label>
  533. <select id="donation_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeDonationType(jQuery('#donation_field_type').val());});">
  534. <option value="select"><?php esc_html_e( 'Drop Down', 'gravityforms' ); ?></option>
  535. <option value="donation"><?php esc_html_e( 'User Defined Price', 'gravityforms' ); ?></option>
  536. <option value="radio"><?php esc_html_e( 'Radio Buttons', 'gravityforms' ); ?></option>
  537. </select>
  538. </li>
  539. <?php
  540. do_action( 'gform_field_standard_settings', 150, $form_id );
  541. ?>
  542. <li class="quantity_field_type_setting field_setting">
  543. <label for="quantity_field_type" class="section_label">
  544. <?php esc_html_e( 'Field Type', 'gravityforms' ); ?>
  545. <?php gform_tooltip( 'form_field_type' ) ?>
  546. </label>
  547. <select id="quantity_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#quantity_field_type').val());});">
  548. <option value="number"><?php esc_html_e( 'Number', 'gravityforms' ); ?></option>
  549. <option value="select"><?php esc_html_e( 'Drop Down', 'gravityforms' ); ?></option>
  550. <option value="hidden"><?php esc_html_e( 'Hidden', 'gravityforms' ); ?></option>
  551. </select>
  552. </li>
  553. <?php
  554. do_action( 'gform_field_standard_settings', 200, $form_id );
  555. ?>
  556. <li class="content_setting field_setting">
  557. <label for="field_content" class="section_label">
  558. <?php esc_html_e( 'Content', 'gravityforms' ); ?>
  559. <?php gform_tooltip( 'form_field_content' ) ?>
  560. </label>
  561. <textarea id="field_content" class="fieldwidth-3 fieldheight-1 merge-tag-support mt-position-right mt-prepopulate"></textarea>
  562. </li>
  563. <?php
  564. do_action( 'gform_field_standard_settings', 225, $form_id );
  565. ?>
  566. <li class="next_button_setting field_setting">
  567. <label for="next_button_container">
  568. <?php esc_html_e( 'Next Button', 'gravityforms' ); ?>
  569. </label>
  570. <div class="next_button_options" id="next_button_container">
  571. <input type="radio" id="next_button_text" name="next_button" value="text" onclick="TogglePageButton('next'); SetPageButton('next');" onkeypress="TogglePageButton('next'); SetPageButton('next');" />
  572. <label for="next_button_text" class="inline">
  573. <?php esc_html_e( 'Default', 'gravityforms' ); ?>
  574. <?php gform_tooltip( 'next_button_text' ) ?>
  575. </label>
  576. &nbsp;&nbsp;
  577. <input type="radio" id="next_button_image" name="next_button" value="image" onclick="TogglePageButton('next'); SetPageButton('next');" onkeypress="TogglePageButton('next'); SetPageButton('next');" />
  578. <label for="next_button_image" class="inline">
  579. <?php esc_html_e( 'Image', 'gravityforms' ); ?>
  580. <?php gform_tooltip( 'next_button_image' ) ?>
  581. </label>
  582. <div id="next_button_text_container" style="margin-top:5px;">
  583. <label for="next_button_text_input" class="inline">
  584. <?php esc_html_e( 'Text:', 'gravityforms' ); ?>
  585. </label>
  586. <input type="text" id="next_button_text_input" class="input_size_b" size="40" />
  587. </div>
  588. <div id="next_button_image_container" style="margin-top:5px;">
  589. <label for="next_button_image_url" class="inline">
  590. <?php esc_html_e( 'Image Path:', 'gravityforms' ); ?>
  591. </label>
  592. <input type="text" id="next_button_image_url" size="45" />
  593. </div>
  594. </div>
  595. </li>
  596. <?php
  597. do_action( 'gform_field_standard_settings', 237, $form_id );
  598. ?>
  599. <li class="previous_button_setting field_setting">
  600. <label for="previous_button_container">
  601. <?php esc_html_e( 'Previous Button', 'gravityforms' ); ?>
  602. <?php gform_tooltip( 'form_field_previous_button' ) ?>
  603. </label>
  604. <div class="previous_button_options" id="previous_button_container">
  605. <input type="radio" id="previous_button_text" name="previous_button" value="text" onclick="TogglePageButton('previous'); SetPageButton('previous');" onkeypress="TogglePageButton('previous'); SetPageButton('previous');" />
  606. <label for="previous_button_text" class="inline">
  607. <?php esc_html_e( 'Default', 'gravityforms' ); ?>
  608. <?php gform_tooltip( 'previous_button_text' ) ?>
  609. </label>
  610. &nbsp;&nbsp;
  611. <input type="radio" id="previous_button_image" name="previous_button" value="image" onclick="TogglePageButton('previous'); SetPageButton('previous');" onkeypress="TogglePageButton('previous'); SetPageButton('previous');" />
  612. <label for="previous_button_image" class="inline">
  613. <?php esc_html_e( 'Image', 'gravityforms' ); ?>
  614. <?php gform_tooltip( 'previous_button_image' ) ?>
  615. </label>
  616. <div id="previous_button_text_container" style="margin-top:5px;">
  617. <label for="previous_button_text_input" class="inline">
  618. <?php esc_html_e( 'Text:', 'gravityforms' ); ?>
  619. </label>
  620. <input type="text" id="previous_button_text_input" class="input_size_b" size="40" />
  621. </div>
  622. <div id="previous_button_image_container" style="margin-top:5px;">
  623. <label for="previous_button_image_url" class="inline">
  624. <?php esc_html_e( 'Image Path:', 'gravityforms' ); ?>
  625. </label>
  626. <input type="text" id="previous_button_image_url" size="45" />
  627. </div>
  628. </div>
  629. </li>
  630. <?php
  631. do_action( 'gform_field_standard_settings', 250, $form_id );
  632. ?>
  633. <li class="disable_margins_setting field_setting">
  634. <input type="checkbox" id="field_margins" onclick="SetFieldProperty('disableMargins', this.checked);" onkeypress="SetFieldProperty('disableMargins', this.checked);" />
  635. <label for="field_disable_margins" class="inline">
  636. <?php esc_html_e( 'Disable default margins', 'gravityforms' ); ?>
  637. <?php gform_tooltip( 'form_field_disable_margins' ) ?>
  638. </label><br />
  639. </li>
  640. <?php
  641. do_action( 'gform_field_standard_settings', 300, $form_id );
  642. ?>
  643. <li class="post_custom_field_type_setting field_setting">
  644. <label for="post_custom_field_type" class="section_label">
  645. <?php esc_html_e( 'Field Type', 'gravityforms' ); ?>
  646. <?php gform_tooltip( 'form_field_type' ) ?>
  647. </label>
  648. <select id="post_custom_field_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#post_custom_field_type').val());});">
  649. <optgroup class="option_header" label="<?php esc_attr_e( 'Standard Fields', 'gravityforms' ); ?>">
  650. <option value="text"><?php esc_html_e( 'Single line text', 'gravityforms' ); ?></option>
  651. <option value="textarea"><?php esc_html_e( 'Paragraph Text', 'gravityforms' ); ?></option>
  652. <option value="select"><?php esc_html_e( 'Drop Down', 'gravityforms' ); ?></option>
  653. <option value="multiselect"><?php esc_html_e( 'Multi Select', 'gravityforms' ); ?></option>
  654. <option value="number"><?php esc_html_e( 'Number', 'gravityforms' ); ?></option>
  655. <option value="checkbox"><?php esc_html_e( 'Checkboxes', 'gravityforms' ); ?></option>
  656. <option value="radio"><?php esc_html_e( 'Radio Buttons', 'gravityforms' ); ?></option>
  657. <option value="hidden"><?php esc_html_e( 'Hidden', 'gravityforms' ); ?></option>
  658. </optgroup>
  659. <optgroup class="option_header" label="<?php esc_html_e( 'Advanced Fields', 'gravityforms' ); ?>">
  660. <option value="date"><?php esc_html_e( 'Date', 'gravityforms' ); ?></option>
  661. <option value="time"><?php esc_html_e( 'Time', 'gravityforms' ); ?></option>
  662. <option value="phone"><?php esc_html_e( 'Phone', 'gravityforms' ); ?></option>
  663. <option value="website"><?php esc_html_e( 'Website', 'gravityforms' ); ?></option>
  664. <option value="email"><?php esc_html_e( 'Email', 'gravityforms' ); ?></option>
  665. <option value="fileupload"><?php esc_html_e( 'File Upload', 'gravityforms' ); ?></option>
  666. <option value="list"><?php esc_html_e( 'List', 'gravityforms' ); ?></option>
  667. </optgroup>
  668. </select>
  669. </li>
  670. <?php
  671. do_action( 'gform_field_standard_settings', 350, $form_id );
  672. ?>
  673. <li class="post_tag_type_setting field_setting">
  674. <label for="post_tag_type" class="section_label">
  675. <?php esc_html_e( 'Field Type', 'gravityforms' ); ?>
  676. <?php gform_tooltip( 'form_field_type' ) ?>
  677. </label>
  678. <select id="post_tag_type" onchange="if(jQuery(this).val() == '') return; jQuery('#field_settings').slideUp(function(){StartChangeInputType(jQuery('#post_tag_type').val());});">
  679. <option value="text"><?php esc_html_e( 'Single line text', 'gravityforms' ); ?></option>
  680. <option value="select"><?php esc_html_e( 'Drop Down', 'gravityforms' ); ?></option>
  681. <option value="multiselect"><?php esc_html_e( 'Multi Select', 'gravityforms' ); ?></option>
  682. <option value="checkbox"><?php esc_html_e( 'Checkboxes', 'gravityforms' ); ?></option>
  683. <option value="radio"><?php esc_html_e( 'Radio Buttons', 'gravityforms' ); ?></option>
  684. </select>
  685. </li>
  686. <?php
  687. do_action( 'gform_field_standard_settings', 400, $form_id );
  688. ?>
  689. <?php
  690. if ( class_exists( 'ReallySimpleCaptcha' ) ) {
  691. //the field_captcha_type drop down has options dynamically added in form_editor.js for the v1/v2 versions of google recaptcha
  692. ?>
  693. <li class="captcha_type_setting field_setting">
  694. <label for="field_captcha_type">
  695. <?php esc_html_e( 'Type', 'gravityforms' ); ?>
  696. <?php gform_tooltip( 'form_field_captcha_type' ) ?>
  697. </label>
  698. <select id="field_captcha_type" onchange="StartChangeCaptchaType(jQuery(this).val())">
  699. <option value="simple_captcha"><?php esc_html_e( 'Really Simple CAPTCHA', 'gravityforms' ); ?></option>
  700. <option value="math"><?php esc_html_e( 'Math Challenge', 'gravityforms' ); ?></option>
  701. </select>
  702. </li>
  703. <?php
  704. do_action( 'gform_field_standard_settings', 450, $form_id );
  705. ?>
  706. <li class="captcha_size_setting field_setting">
  707. <label for="field_captcha_size">
  708. <?php esc_html_e( 'Size', 'gravityforms' ); ?>
  709. </label>
  710. <select id="field_captcha_size" onchange="SetCaptchaSize(jQuery(this).val());">
  711. <option value="small"><?php esc_html_e( 'Small', 'gravityforms' ); ?></option>
  712. <option value="medium"><?php esc_html_e( 'Medium', 'gravityforms' ); ?></option>
  713. <option value="large"><?php esc_html_e( 'Large', 'gravityforms' ); ?></option>
  714. </select>
  715. </li>
  716. <?php
  717. do_action( 'gform_field_standard_settings', 500, $form_id );
  718. ?>
  719. <li class="captcha_fg_setting field_setting">
  720. <label for="field_captcha_fg">
  721. <?php esc_html_e( 'Font Color', 'gravityforms' ); ?>
  722. </label>
  723. <?php self::color_picker( 'field_captcha_fg', 'SetCaptchaFontColor' ) ?>
  724. </li>
  725. <?php
  726. do_action( 'gform_field_standard_settings', 550, $form_id );
  727. ?>
  728. <li class="captcha_bg_setting field_setting">
  729. <label for="field_captcha_bg">
  730. <?php esc_html_e( 'Background Color', 'gravityforms' ); ?>
  731. </label>
  732. <?php self::color_picker( 'field_captcha_bg', 'SetCaptchaBackgroundColor' ) ?>
  733. </li>
  734. <?php
  735. }
  736. do_action( 'gform_field_standard_settings', 600, $form_id );
  737. ?>
  738. <li class="captcha_theme_setting field_setting">
  739. <label for="field_captcha_theme" class="section_label">
  740. <?php esc_html_e( 'Theme', 'gravityforms' ); ?>
  741. <?php gform_tooltip( 'form_field_recaptcha_theme' ) ?>
  742. </label>
  743. <select id="field_captcha_theme" onchange="SetCaptchaTheme(this.value, '<?php echo GFCommon::get_base_url() ?>/images/captcha_' + this.value + '.jpg')">
  744. <option value="light"><?php esc_html_e( 'Light', 'gravityforms' ); ?></option>
  745. <option value="dark"><?php esc_html_e( 'Dark', 'gravityforms' ); ?></option>
  746. </select>
  747. </li>
  748. <?php
  749. do_action( 'gform_field_standard_settings', 650, $form_id );
  750. ?>
  751. <li class="post_custom_field_setting field_setting">
  752. <label for="field_custom_field_name" class="section_label">
  753. <?php esc_html_e( 'Custom Field Name', 'gravityforms' ); ?>
  754. <?php gform_tooltip( 'form_field_custom_field_name' ) ?>
  755. </label>
  756. <div style="width:100px; float:left;">
  757. <input type="radio" name="field_custom" id="field_custom_existing" size="10" onclick="ToggleCustomField();" onkeypress="ToggleCustomField();" />
  758. <label for="field_custom_existing" class="inline">
  759. <?php esc_html_e( 'Existing', 'gravityforms' ); ?>
  760. </label>
  761. </div>
  762. <div style="width:100px; float:left;">
  763. <input type="radio" name="field_custom" id="field_custom_new" size="10" onclick="ToggleCustomField();" onkeypress="ToggleCustomField();" />
  764. <label for="field_custom_new" class="inline">
  765. <?php esc_html_e( 'New', 'gravityforms' ); ?>
  766. </label>
  767. </div>
  768. <div class="clear">
  769. <input type="text" id="field_custom_field_name_text" size="35" />
  770. <select id="field_custom_field_name_select" onchange="SetFieldProperty('postCustomFieldName', jQuery(this).val());" style="max-width:100%;">
  771. <option value=""><?php esc_html_e( 'Select an existing custom field', 'gravityforms' ); ?></option>
  772. <?php
  773. $custom_field_names = RGFormsModel::get_custom_field_names();
  774. foreach ( $custom_field_names as $name ) {
  775. ?>
  776. <option value="<?php echo esc_attr( $name ); ?>"><?php echo esc_html( $name ) ?></option>
  777. <?php
  778. }
  779. ?>
  780. </select>
  781. </div>
  782. </li>
  783. <?php
  784. do_action( 'gform_field_standard_settings', 700, $form_id );
  785. ?>
  786. <li class="post_status_setting field_setting">
  787. <label for="field_post_status" class="section_label">
  788. <?php esc_html_e( 'Post Status', 'gravityforms' ); ?>
  789. <?php gform_tooltip( 'form_field_post_status' ) ?>
  790. </label>
  791. <select id="field_post_status" name="field_post_status">
  792. <?php $post_stati = apply_filters( 'gform_post_status_options', array(
  793. 'draft' => esc_html__( 'Draft', 'gravityforms' ),
  794. 'pending' => esc_html__( 'Pending Review', 'gravityforms' ),
  795. 'publish' => esc_html__( 'Published', 'gravityforms' ),
  796. )
  797. );
  798. foreach ( $post_stati as $value => $label ) {
  799. ?>
  800. <option value="<?php echo esc_attr( $value ); ?>"><?php echo esc_html( $label ); ?></option>
  801. <?php } ?>
  802. </select>
  803. </li>
  804. <?php
  805. do_action( 'gform_field_standard_settings', 750, $form_id );
  806. ?>
  807. <li class="post_author_setting field_setting">
  808. <label for="field_post_author" class="section_label">
  809. <?php esc_html_e( 'Default Post Author', 'gravityforms' ); ?>
  810. <?php gform_tooltip( 'form_field_post_author' ) ?>
  811. </label>
  812. <?php
  813. $args = array( 'name' => 'field_post_author' );
  814. $args = gf_apply_filters( array( 'gform_author_dropdown_args', rgar( $form, 'id' ) ), $args );
  815. wp_dropdown_users( $args );
  816. ?>
  817. <div>
  818. <input type="checkbox" id="gfield_current_user_as_author" />
  819. <label for="gfield_current_user_as_author" class="inline"><?php esc_html_e( 'Use logged in user as author', 'gravityforms' ); ?> <?php gform_tooltip( 'form_field_current_user_as_author' ) ?></label>
  820. </div>
  821. </li>
  822. <?php
  823. do_action( 'gform_field_standard_settings', 775, $form_id );
  824. ?>
  825. <?php if ( current_theme_supports( 'post-formats' ) ) { ?>
  826. <li class="post_format_setting field_setting">
  827. <label for="field_post_format" class="section_label">
  828. <?php esc_html_e( 'Post Format', 'gravityforms' ); ?>
  829. <?php gform_tooltip( 'form_field_post_format' ) ?>
  830. </label>
  831. <?php
  832. $post_formats = get_theme_support( 'post-formats' );
  833. $post_formats_dropdown = '<option value="0">Standard</option>';
  834. foreach ( $post_formats[0] as $post_format ) {
  835. $post_format_val = esc_attr( $post_format );
  836. $post_format_text = esc_html( $post_format );
  837. $post_formats_dropdown .= "<option value='$post_format_val'>" . ucfirst( $post_format_text ) . '</option>';
  838. }
  839. echo '<select name="field_post_format" id="field_post_format">' . $post_formats_dropdown . '</select>';
  840. ?>
  841. </li>
  842. <?php } // if theme supports post formats ?>
  843. <?php
  844. do_action( 'gform_field_standard_settings', 800, $form_id );
  845. ?>
  846. <li class="post_category_setting field_setting">
  847. <label for="field_post_category" class="section_label">
  848. <?php esc_html_e( 'Post Category', 'gravityforms' ); ?>
  849. <?php gform_tooltip( 'form_field_post_category' ) ?>
  850. </label>
  851. <?php wp_dropdown_categories( array( 'selected' => get_option( 'default_category' ), 'hide_empty' => 0, 'id' => 'field_post_category', 'name' => 'field_post_category', 'orderby' => 'name', 'selected' => 'field_post_category', 'hierarchical' => true ) ); ?>
  852. </li>
  853. <?php
  854. do_action( 'gform_field_standard_settings', 825, $form_id );
  855. ?>
  856. <li class="post_category_field_type_setting field_setting">
  857. <label for="post_category_field_type" class="section_label">
  858. <?php esc_html_e( 'Field Type', 'gravityforms' ); ?>
  859. <?php gform_tooltip( 'form_field_type' ) ?>
  860. </label>
  861. <select id="post_category_field_type" onchange="jQuery('#field_settings').slideUp(function(){StartChangeInputType( jQuery('#post_category_field_type').val() );});">
  862. <option value="select"><?php esc_html_e( 'Drop Down', 'gravityforms' ); ?></option>
  863. <option value="checkbox"><?php esc_html_e( 'Checkboxes', 'gravityforms' ); ?></option>
  864. <option value="radio"><?php esc_html_e( 'Radio Buttons', 'gravityforms' ); ?></option>
  865. <option value="multiselect"><?php esc_html_e( 'Multi Select', 'gravityforms' ); ?></option>
  866. </select>
  867. </li>
  868. <?php
  869. do_action( 'gform_field_standard_settings', 850, $form_id );
  870. ?>
  871. <li class="post_category_checkbox_setting field_setting">
  872. <label for="field_post_category">
  873. <?php esc_html_e( 'Category', 'gravityforms' ); ?>
  874. <?php gform_tooltip( 'form_field_post_category_selection' ) ?>
  875. </label>
  876. <input type="radio" id="gfield_category_all" name="gfield_category" value="all" onclick="ToggleCategory();" onkeypress="ToggleCategory();" />
  877. <label for="gfield_category_all" class="inline">
  878. <?php esc_html_e( 'All Categories', 'gravityforms' ); ?>
  879. </label>
  880. &nbsp;&nbsp;
  881. <input type="radio" id="gfield_category_select" name="gfield_category" value="select" onclick="ToggleCategory();" onkeypress="ToggleCategory();" />
  882. <label for="form_button_image" class="inline">
  883. <?php esc_html_e( 'Select Categories', 'gravityforms' ); ?>
  884. </label>
  885. <div id="gfield_settings_category_container">
  886. <table cellpadding="0" cellspacing="5">
  887. <?php
  888. $categories = get_categories( array( 'hide_empty' => 0 ) );
  889. $count = 0;
  890. $category_rows = '';
  891. self::_cat_rows( $categories, $count, $category_rows );
  892. echo $category_rows;
  893. ?>
  894. </table>
  895. </div>
  896. </li>
  897. <?php
  898. do_action( 'gform_field_standard_settings', 875, $form_id );
  899. ?>
  900. <li class="post_category_initial_item_setting field_setting">
  901. <input type="checkbox" id="gfield_post_category_initial_item_enabled" onclick="TogglePostCategoryInitialItem(); SetCategoryInitialItem();" onkeypress="TogglePostCategoryInitialItem(); SetCategoryInitialItem();" />
  902. <label for="gfield_post_category_initial_item_enabled" class="inline">
  903. <?php esc_html_e( 'Display placeholder', 'gravityforms' ); ?>
  904. <?php gform_tooltip( 'form_field_post_category_initial_item' ) ?>
  905. </label>
  906. </li>
  907. <li id="gfield_post_category_initial_item_container">
  908. <label for="field_post_category_initial_item">
  909. <?php esc_html_e( 'Placeholder Label', 'gravityforms' ); ?>
  910. </label>
  911. <input type="text" id="field_post_category_initial_item" onchange="SetCategoryInitialItem();" class="fieldwidth-3" size="35" />
  912. </li>
  913. <?php
  914. do_action( 'gform_field_standard_settings', 900, $form_id );
  915. ?>
  916. <li class="post_content_template_setting field_setting">
  917. <label class="section_label"><?php esc_html_e( 'Content Template', 'gravityforms' ) ?></label>
  918. <input type="checkbox" id="gfield_post_content_enabled" onclick="TogglePostContentTemplate();" onkeypress="TogglePostContentTemplate();" />
  919. <label for="gfield_post_content_enabled" class="inline">
  920. <?php esc_html_e( 'Create content template', 'gravityforms' ); ?>
  921. <?php gform_tooltip( 'form_field_post_content_template_enable' ) ?>
  922. </label>
  923. <div id="gfield_post_content_container">
  924. <div>
  925. <?php GFCommon::insert_post_content_variables( $form['fields'], 'field_post_content_template', '', 25 ); ?>
  926. </div>
  927. <textarea id="field_post_content_template" class="fieldwidth-3 fieldheight-1"></textarea>
  928. </div>
  929. </li>
  930. <?php
  931. do_action( 'gform_field_standard_settings', 950, $form_id );
  932. ?>
  933. <li class="post_title_template_setting field_setting">
  934. <label class="section_label"><?php esc_html_e( 'Content Template', 'gravityforms' ) ?></label>
  935. <input type="checkbox" id="gfield_post_title_enabled" onclick="TogglePostTitleTemplate();" onkeypress="TogglePostTitleTemplate();" />
  936. <label for="gfield_post_title_enabled" class="inline">
  937. <?php esc_html_e( 'Create content template', 'gravityforms' ); ?>
  938. <?php gform_tooltip( 'form_field_post_title_template_enable' ) ?>
  939. </label>
  940. <div id="gfield_post_title_container">
  941. <input type="text" id="field_post_title_template" class="fieldwidth-3 merge-tag-support mt-position-right mt-hide_all_fields mt-exclude-post_image-fileupload" />
  942. </div>
  943. </li>
  944. <?php
  945. do_action( 'gform_field_standard_settings', 975, $form_id );
  946. ?>
  947. <li class="customfield_content_template_setting field_setting">
  948. <input type="checkbox" id="gfield_customfield_content_enabled" onclick="ToggleCustomFieldTemplate(); SetCustomFieldTemplate();" onkeypress="ToggleCustomFieldTemplate(); SetCustomFieldTemplate();" />
  949. <label for="gfield_customfield_content_enabled" class="inline">
  950. <?php esc_html_e( 'Create content template', 'gravityforms' ); ?>
  951. <?php gform_tooltip( 'form_field_customfield_content_template_enable' ) ?>
  952. </label>
  953. <div id="gfield_customfield_content_container">
  954. <div>
  955. <?php GFCommon::insert_post_content_variables( $form['fields'], 'field_customfield_content_template', 'SetCustomFieldTemplate', 25 ); ?>
  956. </div>
  957. <textarea id="field_customfield_content_template" class="fieldwidth-3 fieldheight-1"></textarea>
  958. </div>
  959. </li>
  960. <?php
  961. do_action( 'gform_field_standard_settings', 1000, $form_id );
  962. ?>
  963. <li class="post_image_setting field_setting">
  964. <label class="section_label"><?php esc_html_e( 'Image Metadata', 'gravityforms' ) ?> <?php gform_tooltip( 'form_field_image_meta' ) ?></label>
  965. <input type="checkbox" id="gfield_display_title" onclick="SetPostImageMe