MS_Rule_Category_View

The Membership 2 MS Rule Category View class.

Defined (1)

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

/app/rule/category/class-ms-rule-category-view.php  
  1. class MS_Rule_Category_View extends MS_View { 
  2.  
  3. public function to_html() { 
  4. $membership = MS_Model_Membership::get_base(); 
  5.  
  6. $rule = $membership->get_rule( MS_Rule_Category::RULE_ID ); 
  7. $rule_listtable = new MS_Rule_Category_ListTable( $rule ); 
  8. $rule_listtable->prepare_items(); 
  9.  
  10. $header_data = array(); 
  11. $header_data['title'] = __( 'Choose which Categories you want to protect', 'membership2' ); 
  12. $header_data['desc'] = ''; 
  13.  
  14. $header_data = apply_filters( 
  15. 'ms_view_membership_protectedcontent_header',  
  16. $header_data,  
  17. MS_Rule_Category::RULE_ID,  
  18. $this 
  19. ); 
  20.  
  21. ob_start(); 
  22. ?> 
  23. <div class="ms-settings "> 
  24. <?php 
  25. MS_Helper_Html::settings_tab_header( $header_data ); 
  26.  
  27. $rule_listtable->views(); 
  28. $rule_listtable->search_box( __( 'Categories', 'membership2' ), 'search-cat' ); 
  29. ?> 
  30. <form action="" method="post"> 
  31. <?php 
  32. $rule_listtable->display(); 
  33.  
  34. do_action( 
  35. 'ms_view_membership_protectedcontent_footer',  
  36. MS_Rule_Category::RULE_ID,  
  37. $this 
  38. ); 
  39. ?> 
  40. </form> 
  41. </div> 
  42. <?php 
  43.  
  44. MS_Helper_Html::settings_footer(); 
  45. return ob_get_clean(); 
  46.