MS_View_Membership_List

The Membership 2 MS View Membership List class.

Defined (1)

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

/app/view/membership/class-ms-view-membership-list.php  
  1. class MS_View_Membership_List extends MS_View { 
  2.  
  3. /** 
  4. * Create view output. 
  5. * @since 1.0.0 
  6. * @return string 
  7. */ 
  8. public function to_html() { 
  9. $this->check_simulation(); 
  10.  
  11. $membership = $this->data['membership']; 
  12. $admin_message = MS_Helper_Membership::get_admin_message( 
  13. array( $membership->name ),  
  14. $membership 
  15. ); 
  16. $title = MS_Helper_Membership::get_admin_title(); 
  17.  
  18. $membership_list = MS_Factory::create( 'MS_Helper_ListTable_Membership' ); 
  19. $membership_list->prepare_items(); 
  20.  
  21. $create_new_button = array( 
  22. 'id' => 'create_new_ms_button',  
  23. 'type' => MS_Helper_Html::TYPE_HTML_LINK,  
  24. 'url' => $this->data['create_new_url'],  
  25. 'value' => __( 'Create New Membership', 'membership2' ),  
  26. 'class' => 'button',  
  27. ); 
  28.  
  29. ob_start(); 
  30. ?> 
  31.  
  32. <div class="wrap ms-wrap"> 
  33. <?php 
  34. MS_Helper_Html::settings_header( 
  35. array( 
  36. 'title' => $title,  
  37. 'desc' => array( 
  38. __( 'Here you can view and edit all the Memberships you have created.', 'membership2' ),  
  39. $admin_message,  
  40. ); 
  41. ?> 
  42. <form action="" method="post"> 
  43. <div class="ms-list-table-wrapper ms-membership-list"> 
  44. <?php 
  45. MS_Helper_Html::html_element( $create_new_button ); 
  46. $membership_list->display(); 
  47. MS_Helper_Html::html_element( $create_new_button ); 
  48. ?> 
  49. </div> 
  50. </form> 
  51. </div> 
  52.  
  53. <?php 
  54. $html = ob_get_clean(); 
  55.  
  56. echo $html; 
  57.