/deprecated/includes/admin/step-processing.php

  1. <?php if ( ! defined( 'ABSPATH' ) ) exit; 
  2.  
  3. /** 
  4. * Register our step processing admin page. 
  5. *  
  6. * @since 2.7.6 
  7. * @return void 
  8. */ 
  9. function nf_register_step_processing_page() { 
  10. // Register our admin page 
  11. $admin_page = add_submenu_page( NULL, __( 'Ninja Forms Processing', 'ninja-forms' ), __( 'Processing', 'ninja-forms' ), apply_filters( 'ninja_forms_admin_menu_capabilities', 'manage_options' ), 'nf-processing', 'nf_output_step_processing_page' ); 
  12.  
  13. add_action( 'admin_print_styles-' . $admin_page, 'nf_step_processing_css' ); 
  14. add_action( 'admin_print_styles-' . $admin_page, 'nf_step_processing_js' ); 
  15.  
  16. add_action( 'admin_menu', 'nf_register_step_processing_page' ); 
  17.  
  18. /** 
  19. * Enqueue our step processing CSS. 
  20. *  
  21. * @since 2.7.6 
  22. * @return void 
  23. */ 
  24. function nf_step_processing_css() { 
  25. wp_enqueue_style( 'jquery-smoothness', NF_PLUGIN_URL .'css/smoothness/jquery-smoothness.css'); 
  26.  
  27. /** 
  28. * Enqueue our step processing JS. 
  29. *  
  30. * @since 2.7.6 
  31. * @return void 
  32. */ 
  33. function nf_step_processing_js() { 
  34. if ( defined( 'NINJA_FORMS_JS_DEBUG' ) && NINJA_FORMS_JS_DEBUG ) { 
  35. $suffix = ''; 
  36. $src = 'dev'; 
  37. } else { 
  38. $suffix = '.min'; 
  39. $src = 'min'; 
  40. wp_enqueue_script( 'nf-processing',  
  41. NF_PLUGIN_URL . 'assets/js/' . $src . '/step-processing' . $suffix . '.js',  
  42. array( 'jquery', 'jquery-ui-core', 'jquery-ui-sortable', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-progressbar' ) ); 
  43. $step_labels = apply_filters( 'nf_step_processing_labels', array( 
  44. 'Lacing Our Tabis',  
  45. 'Cleaning The Dojo',  
  46. 'Doing Splits',  
  47. 'Buffing Bo Staff',  
  48. 'Intimidating Gaze',  
  49. 'Sparring',  
  50. 'Packing Smoke Bombs',  
  51. 'Polishing Shuriken',  
  52. 'Throwing Sais',  
  53. 'Calling Our Mom',  
  54. 'Practicing Katas',  
  55. 'Swinging Nunchucks',  
  56. 'Sharpening Swords',  
  57. 'Ironing Ninja Gi',  
  58. 'Eating Breakfast',  
  59. 'Cutting Stuff',  
  60. 'Doing Dishes',  
  61. 'Climbing Walls' 
  62. ) ); 
  63.  
  64.  
  65. wp_localize_script( 'nf-processing', 'nf_processing', array( 'step_labels' => $step_labels ) ); 
  66.  
  67. /** 
  68. * Output our step processing admin page. 
  69. *  
  70. * @since 2.7.6 
  71. * @return void 
  72. */ 
  73. function nf_output_step_processing_page() { 
  74. $page_title = isset ( $_REQUEST['title'] ) ? urldecode( esc_html ( $_REQUEST['title'] ) ) : __( 'Ninja Forms - Processing', 'ninja-forms' ); 
  75. ?> 
  76. <style> 
  77. .ui-progressbar { 
  78. position: relative; 
  79. width: 800px; 
  80. max-width: 100%; 
  81. height: 20px; 
  82.  
  83.  
  84. .progress-label { 
  85. line-height: 12px; 
  86. position: absolute; 
  87. left: 40%; 
  88. top: 4px; 
  89. font-weight: bold; 
  90. text-shadow: 1px 1px 0 #fff; 
  91.  
  92.  
  93. .ui-progressbar-value { 
  94. /*background-size: 100% auto;*/ 
  95. background-color: #FFF; 
  96. background-repeat: repeat; 
  97. background-image: url(<?php echo NF_PLUGIN_URL . 'assets/images/pbar-ani.gif'; ?>); 
  98.  
  99. </style> 
  100. <script type="text/javascript"> 
  101.  
  102. <?php 
  103. if ( isset ( $_REQUEST['action'] ) && ! empty ( $_REQUEST['action'] ) ) { 
  104. $action = __( 'Loading...', 'ninja-forms' ); 
  105. ?> 
  106. var nfProcessingAction = 'nf_<?php echo esc_html( $_REQUEST['action'] ); ?>'; 
  107. <?php 
  108. } else { 
  109. $action = __( 'No Action Specified...', 'ninja-forms' ); 
  110. ?> 
  111. var nfProcessingAction = 'none'; 
  112. <?php 
  113.  
  114. $tmp_array = array(); 
  115. $url_params = parse_url( esc_url_raw( add_query_arg( array() ) ) ); 
  116. $query = $url_params['query']; 
  117. $query = parse_str( $query, $tmp_array ); 
  118. unset ( $tmp_array['action'] ); 
  119. unset ( $tmp_array['page'] ); 
  120. ?> 
  121.  
  122. var nfProcessingArgs = <?php echo json_encode( $tmp_array ); ?> 
  123.  
  124. </script> 
  125.  
  126. <?php 
  127.  
  128. ?> 
  129.  
  130. <div class="wrap"> 
  131. <h2><?php echo $page_title ?></h2> 
  132. <div id="nf-upgrade-status"> 
  133. <p><?php _e( 'The process has started, please be patient. This could take several minutes. You will be automatically redirected when the process is finished.', 'ninja-forms' ); ?></p> 
  134. <div id="progressbar"> 
  135. <div class="progress-label"> 
  136. <?php echo $action; ?> 
  137. </div> 
  138. </div> 
  139. </div> 
  140. </div> 
  141.  
  142. <!-- DISPLAY ERRORS --> 
  143. <div id="nf-upgrade-errors" class="hidden nf-upgrade-errors"> 
  144.  
  145. <h3 class="nf-upgrade-errors-header">Error Log</h3> 
  146.  
  147. <ul class="nf-upgrade-errors-list"></ul> 
  148.  
  149. </div> 
  150.  
  151. <?php 
.