MS_Rule_MemberCaps_View

The Membership 2 MS Rule MemberCaps View class.

Defined (1)

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

/app/rule/membercaps/class-ms-rule-membercaps-view.php  
  1. class MS_Rule_MemberCaps_View extends MS_View { 
  2.  
  3. public function to_html() { 
  4. $membership = MS_Model_Membership::get_base(); 
  5. $rule = $membership->get_rule( MS_Rule_MemberCaps::RULE_ID ); 
  6.  
  7. $rule_listtable = new MS_Rule_MemberCaps_ListTable( $rule ); 
  8. $rule_listtable->prepare_items(); 
  9.  
  10. $header_data = array(); 
  11. $header_data['title'] = __( 'Assign WordPress Capabilities to your Members', 'membership2' ); 
  12. $header_data['desc'] = array( 
  13. __( 'Fine-tune member permissions by assigning certain Capabilities to each Membership. All Members of that Membership are granted the specified Capabilities.', 'membership2' ),  
  14. __( 'Important: All users that are not inside these Memberships will be striped of any Protected Capability!', 'membership2' ),  
  15. __( 'You should only use these rules if you know what you are doing! Granting the wrong capabilities makes your website prone to abuse. For a bit of security we already removed the most critical Capabilities from this list.', 'membership2' ),  
  16. ); 
  17.  
  18. $header_data = apply_filters( 
  19. 'ms_view_membership_protectedcontent_header',  
  20. $header_data,  
  21. MS_Rule_MemberCaps::RULE_ID,  
  22. $this 
  23. ); 
  24.  
  25. ob_start(); 
  26. ?> 
  27. <div class="ms-settings"> 
  28. <?php 
  29. MS_Helper_Html::settings_tab_header( $header_data ); 
  30.  
  31. $rule_listtable->views(); 
  32. $rule_listtable->search_box( __( 'Capability', 'membership2' ) ); 
  33. ?> 
  34. <form action="" method="post"> 
  35. <?php 
  36. $rule_listtable->display(); 
  37.  
  38. do_action( 
  39. 'ms_view_membership_protectedcontent_footer',  
  40. MS_Rule_MemberCaps::RULE_ID,  
  41. $this 
  42. ); 
  43. ?> 
  44. </form> 
  45. </div> 
  46. <?php 
  47.  
  48. MS_Helper_Html::settings_footer(); 
  49. return ob_get_clean(); 
  50.