MS_View_Settings_Page_General

The Membership 2 MS View Settings Page General class.

Defined (1)

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

/app/view/settings/page/class-ms-view-settings-page-general.php  
  1. class MS_View_Settings_Page_General extends MS_View_Settings_Edit { 
  2.  
  3. public function to_html() { 
  4. $settings = $this->data['settings']; 
  5.  
  6. $fields = array( 
  7. 'plugin_enabled' => array( 
  8. 'id' => 'plugin_enabled',  
  9. 'type' => MS_Helper_Html::INPUT_TYPE_RADIO_SLIDER,  
  10. 'title' => __( 'Content Protection', MS_TEXT_DOMAIN ),  
  11. 'desc' => __( 'This setting toggles the content protection on this site.', MS_TEXT_DOMAIN ),  
  12. 'value' => MS_Plugin::is_enabled(),  
  13. 'data_ms' => array( 
  14. 'action' => MS_Controller_Settings::AJAX_ACTION_TOGGLE_SETTINGS,  
  15. 'setting' => 'plugin_enabled',  
  16. ),  
  17. ),  
  18.  
  19. 'hide_admin_bar' => array( 
  20. 'id' => 'hide_admin_bar',  
  21. 'type' => MS_Helper_Html::INPUT_TYPE_RADIO_SLIDER,  
  22. 'title' => __( 'Hide admin toolbar', MS_TEXT_DOMAIN ),  
  23. 'desc' => __( 'Hide the admin toolbar for non administrator users.', MS_TEXT_DOMAIN ),  
  24. 'value' => $settings->hide_admin_bar,  
  25. 'data_ms' => array( 
  26. 'action' => MS_Controller_Settings::AJAX_ACTION_TOGGLE_SETTINGS,  
  27. 'setting' => 'hide_admin_bar',  
  28. ),  
  29. ),  
  30. ); 
  31.  
  32. $fields = apply_filters( 'ms_view_settings_prepare_general_fields', $fields ); 
  33. $setup = MS_Factory::create( 'MS_View_Settings_Page_Setup' ); 
  34. $action_url = esc_url_raw( remove_query_arg( array( 'msg' ) ) ); 
  35.  
  36. ob_start(); 
  37.  
  38. MS_Helper_Html::settings_tab_header(); 
  39. ?> 
  40.  
  41. <form action="<?php echo esc_url( $action_url ); ?>" method="post" class="cf"> 
  42. <div class="cf"> 
  43. <div class="ms-half"> 
  44. <?php MS_Helper_Html::html_element( $fields['plugin_enabled'] ); ?> 
  45. </div> 
  46. <div class="ms-half"> 
  47. <?php MS_Helper_Html::html_element( $fields['hide_admin_bar'] ); ?> 
  48. </div> 
  49. </div> 
  50. <?php 
  51. MS_Helper_Html::html_separator(); 
  52. MS_Helper_Html::html_element( $setup->html_full_form() ); 
  53. ?> 
  54. </form> 
  55. <?php 
  56. return ob_get_clean(); 
  57.