nf_upgrades_screen

Render Upgrades Screen.

Description

nf_upgrades_screen(); 

Usage

  1. if ( !function_exists( 'nf_upgrades_screen' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/admin/upgrades/upgrades.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = nf_upgrades_screen(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/deprecated/includes/admin/upgrades/upgrades.php  
  1. function nf_upgrades_screen() { 
  2. $action = isset( $_GET['nf-upgrade'] ) ? sanitize_text_field( $_GET['nf-upgrade'] ) : ''; 
  3. $step = isset( $_GET['step'] ) ? absint( $_GET['step'] ) : 1; 
  4. $total = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false; 
  5. $custom = isset( $_GET['custom'] ) ? $_GET['custom'] : 0; 
  6. $form_id = isset( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : 0; 
  7.  
  8. if ( is_string( $custom ) ) { 
  9. $custom = urlencode( $custom ); 
  10.  
  11. ?>  
  12. <div class="wrap"> 
  13. <h2><?php _e( 'Ninja Forms - Processing', 'ninja-forms' ); ?></h2> 
  14.  
  15. <?php if( ! empty( $action ) ) : ?> 
  16.  
  17. <div id="nf-upgrade-status"> 
  18. <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> 
  19. <?php if( ! empty( $total ) ) : ?> 
  20. <p><strong><?php printf( __( 'Step %d of approximately %d running', 'ninja-forms' ), $step, $total + 1 ); ?></strong> 
  21. <span class="spinner" id="nf-upgrade-loader"/></span></p> 
  22. <?php endif; ?> 
  23. </div> 
  24. <script type="text/javascript"> 
  25. document.location.href = "index.php?nf_action=<?php echo $action; ?>&step=<?php echo $step; ?>&total=<?php echo $total; ?>&custom=<?php echo $custom; ?>&form_id=<?php echo $form_id; ?>"; 
  26. </script> 
  27.  
  28. <?php else : ?> 
  29.  
  30. <div id="nf-upgrade-status"> 
  31. <p> 
  32. <?php _e( 'The process has started, please be patient. This could take several minutes. You will be automatically redirected when the process is finished.', 'edd' ); ?> 
  33. <span class="spinner" id="nf-upgrade-loader"/></span> 
  34. </p> 
  35. </div> 
  36. <script type="text/javascript"> 
  37. jQuery( document ).ready( function() { 
  38. // Trigger upgrades on page load 
  39. var data = { action: 'edd_trigger_upgrades' }; 
  40. jQuery.post( ajaxurl, data, function (response) { 
  41. if( response == 'complete' ) { 
  42. jQuery('#nf-upgrade-loader').hide(); 
  43. //document.location.href = 'index.php?page=edd-about'; // Redirect to the welcome page 
  44. }); 
  45. }); 
  46. </script> 
  47.  
  48. <?php endif; ?> 
  49.  
  50. </div> 
  51. <?php