/app/rule/shortcode/class-ms-rule-shortcode-view.php

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