MS_View_MigrationM1

Special View that is displayed to complete the migration from M1.

Defined (1)

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

/app/view/class-ms-view-migrationm1.php  
  1. class MS_View_MigrationM1 extends MS_View { 
  2.  
  3. /** 
  4. * Returns the HTML code of the view. 
  5. * @since 1.0.0 
  6. * @api 
  7. * @return string 
  8. */ 
  9. public function to_html() { 
  10. $model = MS_Factory::create( 'MS_Model_Import_Membership' ); 
  11.  
  12.  
  13. $model->prepare(); 
  14.  
  15. $view = MS_Factory::create( 'MS_View_Settings_Import' ); 
  16. $view->data = array( 'model' => $model, 'compact' => true ); 
  17. $msg = __( 
  18. 'Tip: You can also import your data later by visiting the Admin page <b>Membership2 > Settings > Import Tool</b>.',  
  19. 'membership2' 
  20. ); 
  21.  
  22. ob_start(); 
  23. // Render tabbed interface. 
  24. ?> 
  25. <div class="ms-wrap wrap"> 
  26. <h2> 
  27. <?php _e( 'Import Your Membership Data To Membership2', 'membership2' ); ?> 
  28. </h2> 
  29. <?php 
  30. if ( MS_Plugin::is_network_wide() ) { 
  31. $msg .= '<br><br>' . __( 
  32. 'You have enabled Network Wide Protection. We will import Membership data from your main blog.',  
  33. 'membership2' 
  34. ); 
  35.  
  36. lib3()->ui->admin_message( $msg, 'info' ); 
  37. ?> 
  38. <div class="ms-settings-import"> 
  39. <?php echo $view->to_html(); ?> 
  40. </div> 
  41. </div> 
  42. <?php 
  43. return ob_get_clean(); 
  44.  
  45. /** 
  46. * Enquque scripts and styles used by this special view. 
  47. * @since 1.0.0 
  48. */ 
  49. public function enqueue_scripts() { 
  50. $data = array( 
  51. 'ms_init' => array( 'view_settings_import' ),  
  52. 'close_link' => MS_Controller_Plugin::get_admin_url(),  
  53. 'lang' => array( 
  54. 'progress_title' => __( 'Importing data...', 'membership2' ),  
  55. 'close_progress' => __( 'Okay', 'membership2' ),  
  56. 'import_done' => __( 'All done!', 'membership2' ),  
  57. 'task_start' => __( 'Preparing...', 'membership2' ),  
  58. 'task_done' => __( 'Cleaning up...', 'membership2' ),  
  59. 'task_import_member' => __( 'Importing Member', 'membership2' ),  
  60. 'task_import_membership' => __( 'Importing Membership', 'membership2' ),  
  61. 'task_import_settings' => __( 'Importing Settings', 'membership2' ),  
  62. ),  
  63. ); 
  64.  
  65. lib3()->ui->data( 'ms_data', $data ); 
  66. wp_enqueue_script( 'ms-admin' ); 
  67.