MS_Rule_ReplaceMenu_View

The Membership 2 MS Rule ReplaceMenu View class.

Defined (1)

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

/app/rule/replacemenu/class-ms-rule-replacemenu-view.php  
  1. class MS_Rule_ReplaceMenu_View extends MS_View { 
  2.  
  3. public function to_html() { 
  4. $membership = MS_Model_Membership::get_base(); 
  5. $rule = $membership->get_rule( MS_Rule_ReplaceMenu::RULE_ID ); 
  6.  
  7. // This fixes the list-title generated by MS_Helper_ListTable_Rule. 
  8. unset( $_GET['status'] ); 
  9.  
  10. $listtable = new MS_Rule_ReplaceMenu_ListTable( $rule ); 
  11. $listtable->prepare_items(); 
  12.  
  13. $header_data = apply_filters( 
  14. 'ms_view_membership_protectedcontent_header',  
  15. array( 
  16. 'title' => __( 'Replace Menus', 'membership2' ),  
  17. 'desc' => __( 'Replace or protect WordPress menus.', 'membership2' ),  
  18. ),  
  19. MS_Rule_ReplaceMenu::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. $listtable->views(); 
  30. $listtable->search_box(); 
  31. ?> 
  32. <form action="" method="post"> 
  33. <?php 
  34. $listtable->display(); 
  35.  
  36. do_action( 
  37. 'ms_view_membership_protectedcontent_footer',  
  38. MS_Rule_ReplaceMenu::RULE_ID,  
  39. $this 
  40. ); 
  41. ?> 
  42. </form> 
  43. </div> 
  44. <?php 
  45.  
  46. MS_Helper_Html::settings_footer(); 
  47.  
  48. return ob_get_clean(); 
  49.