admin-add-new-form.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <div class="wrap">
  2. <h1><?php _e( 'Add New', 'vamtam-elements-b' ); ?></h1>
  3. <p><?php _e( 'Add new builder content using the form below.', 'vamtam-elements-b' ); ?></p>
  4. <form class="fl-new-template-form" name="fl-new-template-form" method="POST">
  5. <table class="widefat">
  6. <tr>
  7. <th>
  8. <label for="fl-template[title]"><?php _e( 'Title', 'vamtam-elements-b' ); ?></label>
  9. </th>
  10. <td>
  11. <input class="fl-template-title regular-text" type="text" name="fl-template[title]" required />
  12. </td>
  13. </tr>
  14. <tr>
  15. <th>
  16. <label for="fl-template[type]"><?php _e( 'Type', 'vamtam-elements-b' ); ?></label>
  17. </th>
  18. <td>
  19. <select class="fl-template-type" name="fl-template[type]" required>
  20. <option value=""><?php _e( 'Choose...', 'vamtam-elements-b' ); ?></option>
  21. <?php foreach ( $types as $type ) : ?>
  22. <option value="<?php echo $type['key']; ?>" <?php selected( $selected_type, $type['key'] ); ?>><?php echo $type['label']; ?></option>
  23. <?php endforeach; ?>
  24. </select>
  25. </td>
  26. </tr>
  27. <tr class="fl-template-module-row">
  28. <th>
  29. <label for="fl-template[module]"><?php _e( 'Module', 'vamtam-elements-b' ); ?></label>
  30. </th>
  31. <td>
  32. <select class="fl-template-module" name="fl-template[module]" required>
  33. <option value=""><?php _e( 'Choose...', 'vamtam-elements-b' ); ?></option>
  34. <?php foreach ( $modules as $title => $group ) : ?>
  35. <?php if ( __( 'WordPress Widgets', 'vamtam-elements-b' ) == $title ) { continue;} ?>
  36. <optgroup label="<?php echo $title; ?>">
  37. <?php foreach ( $group as $module ) : ?>
  38. <option value="<?php echo $module->slug; ?>"><?php echo $module->name; ?></option>
  39. <?php endforeach; ?>
  40. </optgroup>
  41. <?php endforeach; ?>
  42. </select>
  43. </td>
  44. </tr>
  45. <tr class="fl-template-global-row">
  46. <th>
  47. <label for="fl-template[global]"><?php _e( 'Global', 'vamtam-elements-b' ); ?></label>
  48. <i class="dashicons dashicons-editor-help" title="<?php esc_html_e( 'Global rows, cols and modules can be added to multiple pages and edited in one place.', 'vamtam-elements-b' ); ?>"></i>
  49. </th>
  50. <td>
  51. <label>
  52. <input class="fl-template-global" type="checkbox" name="fl-template[global]" value="1" />
  53. <?php _e( 'Make this saved row or module global?', 'vamtam-elements-b' ); ?>
  54. </label>
  55. </td>
  56. </tr>
  57. <?php do_action( 'fl_builder_user_templates_admin_add_form' ); ?>
  58. </table>
  59. <p class="submit">
  60. <input type="submit" class="fl-template-add button button-primary button-large" value="<?php _e( 'Add', 'vamtam-elements-b' ); ?>">
  61. </p>
  62. <?php wp_nonce_field( 'fl-add-template-nonce', 'fl-add-template' ); ?>
  63. </form>
  64. </div>