MS_Rule_MemberRoles_View

The Membership 2 MS Rule MemberRoles View class.

Defined (1)

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

/app/rule/memberroles/class-ms-rule-memberroles-view.php  
  1. class MS_Rule_MemberRoles_View extends MS_View { 
  2.  
  3. public function to_html() { 
  4. $membership = MS_Model_Membership::get_base(); 
  5. $rule = $membership->get_rule( MS_Rule_MemberRoles::RULE_ID ); 
  6.  
  7. $rule_listtable = new MS_Rule_MemberRoles_ListTable( $rule ); 
  8. $rule_listtable->prepare_items(); 
  9.  
  10. $header_data['title'] = __( 'Assign WordPress User Roles to your Members', 'membership2' ); 
  11. $header_data['desc'] = array( 
  12. __( 'When assigning a Membership to any role, then this role will be added to all members of that Membership. You can even assign multiple roles to a single Membership.', 'membership2' ),  
  13. __( 'For security reasons the Administrator role cannot be assigned to a Membership.', 'membership2' ),  
  14. ); 
  15.  
  16. $header_data = apply_filters( 
  17. 'ms_view_membership_protectedcontent_header',  
  18. $header_data,  
  19. MS_Rule_MemberRoles::RULE_ID,  
  20. $this 
  21. ); 
  22.  
  23. ob_start(); 
  24. ?> 
  25. <div class="ms-settings"> 
  26. <?php 
  27. MS_Helper_Html::settings_tab_header( $header_data ); 
  28.  
  29. $rule_listtable->views(); 
  30. $rule_listtable->search_box( __( 'Capability', 'membership2' ) ); 
  31. ?> 
  32. <form action="" method="post"> 
  33. <?php 
  34. $rule_listtable->display(); 
  35.  
  36. do_action( 
  37. 'ms_view_membership_protectedcontent_footer',  
  38. MS_Rule_MemberRoles::RULE_ID,  
  39. $this 
  40. ); 
  41. ?> 
  42. </form> 
  43. </div> 
  44. <?php 
  45.  
  46. MS_Helper_Html::settings_footer(); 
  47. return ob_get_clean(); 
  48.