MS_Rule_Page_View

The Membership 2 MS Rule Page View class.

Defined (1)

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

/app/rule/page/class-ms-rule-page-view.php  
  1. class MS_Rule_Page_View extends MS_View { 
  2.  
  3. public function to_html() { 
  4. $membership = MS_Model_Membership::get_base(); 
  5. $rule = $membership->get_rule( MS_Rule_Page::RULE_ID ); 
  6. $rule_listtable = new MS_Rule_Page_ListTable( $rule ); 
  7. $rule_listtable->prepare_items(); 
  8.  
  9. $header_data = apply_filters( 
  10. 'ms_view_membership_protectedcontent_header',  
  11. array( 
  12. 'title' => __( 'Apply protection to Pages and and grant access to members', 'membership2' ),  
  13. 'desc' => __( 'All pages that do not have Content Protection applied are visible to Everyone', 'membership2' ),  
  14. ),  
  15. MS_Rule_Page::RULE_ID,  
  16. $this 
  17. ); 
  18.  
  19. ob_start(); 
  20. ?> 
  21. <div class="ms-settings"> 
  22. <?php 
  23. MS_Helper_Html::settings_tab_header( $header_data ); 
  24.  
  25. $rule_listtable->views(); 
  26. $rule_listtable->search_box( __( 'Pages', 'membership2' ) ); 
  27. ?> 
  28. <form action="" method="post"> 
  29. <?php 
  30. $rule_listtable->display(); 
  31.  
  32. do_action( 
  33. 'ms_view_membership_protectedcontent_footer',  
  34. MS_Rule_Page::RULE_ID,  
  35. $this 
  36. ); 
  37. ?> 
  38. </form> 
  39. </div> 
  40. <?php 
  41.  
  42. MS_Helper_Html::settings_footer(); 
  43. return ob_get_clean(); 
  44.