MS_View_Membership_Edit

Displays the membership edit page.

Defined (1)

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

/app/view/membership/class-ms-view-membership-edit.php  
  1. class MS_View_Membership_Edit extends MS_View { 
  2.  
  3. /** 
  4. * Create view output. 
  5. * @since 1.0.1.0 
  6. * @return string 
  7. */ 
  8. public function to_html() { 
  9. $this->check_simulation(); 
  10.  
  11. // Setup navigation tabs. 
  12. $tabs = $this->data['tabs']; 
  13. $membership = $this->data['membership']; 
  14. $desc = array(); 
  15.  
  16. ob_start(); 
  17. // Render tabbed interface. 
  18. ?> 
  19. <div class="ms-wrap wrap"> 
  20. <?php 
  21. MS_Helper_Html::settings_header( 
  22. array( 
  23. 'title' => $membership->get_name_tag(),  
  24. 'title_icon_class' => '',  
  25. 'desc' => __( 'Edit Membership details and define Membership specific settings.', 'membership2' ),  
  26. ); 
  27. $active_tab = MS_Helper_Html::html_admin_vertical_tabs( $tabs ); 
  28.  
  29. // Call the appropriate form to render. 
  30. $tab_name = str_replace( '-', '_', $active_tab ); 
  31. $callback_name = 'render_tab_' . $tab_name; 
  32. $render_callback = apply_filters( 
  33. 'ms_view_membership_edit_render_callback',  
  34. array( $this, $callback_name ),  
  35. $active_tab,  
  36. $this->data 
  37. ); 
  38. ?> 
  39. <div class="ms-settings ms-settings-<?php echo esc_attr( $tab_name ); ?>"> 
  40. <?php 
  41. $html = call_user_func( $render_callback ); 
  42. $html = apply_filters( 'ms_view_settings_' . $callback_name, $html ); 
  43. echo $html; 
  44. ?> 
  45. </div> 
  46. </div> 
  47. <?php 
  48. $html = ob_get_clean(); 
  49.  
  50. return $html; 
  51.  
  52. /** ====================================================================== * 
  53. * DETAILS 
  54. * ====================================================================== */ 
  55.  
  56. public function render_tab_details() { 
  57. $tab = MS_Factory::create( 'MS_View_Membership_Tab_Details' ); 
  58. $tab->data = $this->data; 
  59.  
  60. return $tab->to_html(); 
  61.  
  62. /** ====================================================================== * 
  63. * PAYMENT 
  64. * ====================================================================== */ 
  65.  
  66. public function render_tab_payment() { 
  67. $tab = MS_Factory::create( 'MS_View_Membership_Tab_Payment' ); 
  68. $tab->data = $this->data; 
  69.  
  70. return $tab->to_html(); 
  71.  
  72. /** ====================================================================== * 
  73. * UPGRADE PATHS 
  74. * ====================================================================== */ 
  75.  
  76. public function render_tab_upgrade() { 
  77. $tab = MS_Factory::create( 'MS_View_Membership_Tab_Upgrade' ); 
  78. $tab->data = $this->data; 
  79.  
  80. return $tab->to_html(); 
  81.  
  82. /** ====================================================================== * 
  83. * PAGES 
  84. * ====================================================================== */ 
  85.  
  86. public function render_tab_pages() { 
  87. $tab = MS_Factory::create( 'MS_View_Membership_Tab_Pages' ); 
  88. $tab->data = $this->data; 
  89.  
  90. return $tab->to_html(); 
  91.  
  92. /** ====================================================================== * 
  93. * PROTECTION MESSAGES 
  94. * ====================================================================== */ 
  95.  
  96. public function render_tab_messages() { 
  97. $tab = MS_Factory::create( 'MS_View_Settings_Page_Messages' ); 
  98. $tab->data = $this->data; 
  99.  
  100. return $tab->to_html(); 
  101.  
  102. /** ====================================================================== * 
  103. * AUTOMATED MESSAGES 
  104. * ====================================================================== */ 
  105.  
  106. public function render_tab_emails() { 
  107. $tab = MS_Factory::create( 'MS_View_Settings_Page_Communications' ); 
  108. $tab->data = $this->data; 
  109.  
  110. return $tab->to_html(); 
  111.  
  112. /** ====================================================================== * 
  113. * MEMBERSHIP TYPE 
  114. * ====================================================================== */ 
  115.  
  116. public function render_tab_type() { 
  117. $tab = MS_Factory::create( 'MS_View_Membership_Tab_Type' ); 
  118. $tab->data = $this->data; 
  119.  
  120. return $tab->to_html(); 
  121.