SimpleCalendarAdminPagesAdvanced

General settings.

Defined (1)

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

/includes/admin/pages/advanced.php  
  1. class Advanced extends Admin_Page { 
  2.  
  3. /** 
  4. * Constructor. 
  5. * @since 3.0.0 
  6. */ 
  7. public function __construct() { 
  8. $this->id = 'advanced'; 
  9. $this->option_group = 'settings'; 
  10. $this->label = __( 'Advanced', 'google-calendar-events' ); 
  11. //$this->description = __( 'Advanced settings.', 'google-calendar-events' ); 
  12. $this->sections = $this->add_sections(); 
  13. $this->fields = $this->add_fields(); 
  14.  
  15. /** 
  16. * Add sections. 
  17. * @since 3.0.0 
  18. * @return array 
  19. */ 
  20. public function add_sections() { 
  21. return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id .'_sections', array( 
  22. 'assets' => array( 
  23. 'title' => __( 'Styles', 'google-calendar-events' ),  
  24. 'description' => __( 'Manage front end assets that handle the calendars appearance.', 'google-calendar-events' ) 
  25. ),  
  26. 'installation' => array( 
  27. 'title' => __( 'Installation', 'google-calendar-events' ),  
  28. 'description' => __( 'Manage your data (plugin settings and saved calendars).', 'google-calendar-events' ) 
  29. ) ); 
  30.  
  31. /** 
  32. * Add fields. 
  33. * @since 3.0.0 
  34. * @return array 
  35. */ 
  36. public function add_fields() { 
  37.  
  38. $fields = array(); 
  39. $this->values = get_option( 'simple-calendar_' . $this->option_group . '_' . $this->id ); 
  40.  
  41. foreach ( $this->sections as $section => $a ) : 
  42.  
  43. if ( 'assets' == $section ) { 
  44.  
  45. $fields[ $section ] = array( 
  46. 'disable_css' => array( 
  47. 'title' => __( 'Disable CSS', 'google-calendar-events' ),  
  48. 'tooltip' => __( 'If ticked, this option will prevent all front end stylesheets to load. This also includes all add-on stylesheets.', 'google-calendar-events' ),  
  49. 'type' => 'checkbox',  
  50. 'name' => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][disable_css]',  
  51. 'id' => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-' . $section . '-disable-css',  
  52. 'value' => $this->get_option_value( $section, 'disable_css' ) 
  53. ),  
  54. ); 
  55.  
  56. } elseif ( 'installation' == $section ) { 
  57.  
  58. $fields[ $section ] = array( 
  59. 'delete_settings' => array( 
  60. 'title' => __( 'Delete settings', 'google-calendar-events' ),  
  61. 'tooltip' => __( 'Tick this option if you want to wipe this plugin settings from database when uninstalling.', 'google-calendar-events' ),  
  62. 'type' => 'checkbox',  
  63. 'name' => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][delete_settings]',  
  64. 'id' => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-' . $section . '-delete-settings',  
  65. 'value' => $this->get_option_value( $section, 'delete_settings' ),  
  66. ),  
  67. 'erase_data' => array( 
  68. 'title' => __( 'Erase calendar data', 'google-calendar-events' ),  
  69. 'tooltip' => __( 'By default your data will be retained in database even after uninstall. Tick this option if you want to delete all your calendar data when uninstalling.', 'google-calendar-events' ),  
  70. 'type' => 'checkbox',  
  71. 'name' => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][erase_data]',  
  72. 'id' => 'simple-calendar_' . $this->option_group . '_' . $this->id . '-delete-data',  
  73. 'value' => $this->get_option_value( $section, 'erase_data' ),  
  74. ); 
  75.  
  76.  
  77. endforeach; 
  78.  
  79. return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id . '_fields', $fields ); 
  80.