Gravity_Forms_Survey_Funnel_Admin

This class handles the admin part of the plugin.

Defined (1)

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

/classes/class-gravity-forms-survey-funnel-admin.php  
  1. class Gravity_Forms_Survey_Funnel_Admin { 
  2.  
  3. /** 
  4. * Initializes the admin pages. 
  5. */ 
  6. static function init() { 
  7. add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) ); 
  8.  
  9. // Register settings 
  10. add_action( 'admin_init', array( __CLASS__, 'register_settings' ) ); 
  11.  
  12. /** 
  13. * Should be called on admin_menu hook. Adds settings pages to the admin menu. 
  14. */ 
  15. static function admin_menu() { 
  16. add_submenu_page( 
  17. 'options-general.php',  
  18. __('Gravity Forms Survey Settings', 'gravity-forms-survey-funnel-plugin'),  
  19. __('Survey Settings', 'gravity-forms-survey-funnel-plugin'),  
  20. 'manage_options',  
  21. 'gravityforms-surveyfunnel-survey-settings',  
  22. array( __CLASS__, 'survey_settings_page' ) 
  23. ); 
  24.  
  25. /** 
  26. * Register settings 
  27. */ 
  28. static function register_settings() { 
  29. register_setting( 'gravity-forms-survey-funnel-survey-settings', 'gravity-forms-survey-funnel-survey-id' ); 
  30. register_setting( 'gravity-forms-survey-funnel-survey-settings', 'gravity-forms-survey-funnel-survey-position' ); 
  31. register_setting( 'gravity-forms-survey-funnel-survey-settings', 'gravity-forms-survey-funnel-survey-minimalized' ); 
  32.  
  33. /** 
  34. * Shows the survey settings page 
  35. */ 
  36. static function survey_settings_page() { 
  37. // Get all active surveys, if Gravity Forms is active 
  38. if ( method_exists('RGFormsModel', 'get_forms') ) 
  39. $surveys = RGFormsModel::get_forms( true ); 
  40.  
  41. // Include settings page 
  42. include_once( Gravity_Forms_Survey_Funnel::getPluginPath() . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'survey-settings.php' );