public function show_forms_overview_page() { if (!empty($_GET['view'])) { return; } $table = new MC4WP_Forms_Table(new MC4WP_MailChimp()); include $this->plugin->dir('/views/forms-overview.php'); }
/** * Maybe load form preview for Styles Builder */ public function maybe_load_preview() { // make sure form_id is set and current user has required capabilities if (!isset($_GET['_mc4wp_styles_builder_preview']) || empty($_GET['form_id']) || !current_user_can('edit_posts')) { return; } // disable all other stylesheets add_filter('mc4wp_form_stylesheets', '__return_empty_array'); require $this->plugin->dir('/views/form-preview.php'); exit; }
/** * Run upgrade routines, if necessary. */ public function run_upgrade_routines() { $from_version = get_option('mc4wp_styles_builder_version', 0); $to_version = $this->plugin->version(); // we're at the specified version already if (version_compare($from_version, $to_version, '>=')) { return; } $upgrade_routines = new MC4WP_Upgrade_Routines($from_version, $to_version, $this->plugin->dir('/includes/migrations')); $upgrade_routines->run(); update_option('mc4wp_styles_builder_version', $to_version); }
/** * Show reports (stats) page */ public function show_statistics_page() { $current_tab = 'statistics'; $graph = new MC4WP_Graph($_GET); $graph->init(); $settings = array('ticksize' => array(1, $graph->step_size)); // add scripts wp_localize_script('mc4wp-statistics', 'mc4wp_statistics_data', $graph->datasets); wp_localize_script('mc4wp-statistics', 'mc4wp_statistics_settings', $settings); $start_day = isset($_GET['start_day']) ? $_GET['start_day'] : 0; $start_month = isset($_GET['start_month']) ? $_GET['start_month'] : 0; $start_year = isset($_GET['start_year']) ? $_GET['start_year'] : 0; $end_day = isset($_GET['end_day']) ? $_GET['end_day'] : date('d'); $end_month = isset($_GET['end_month']) ? $_GET['end_month'] : date('m'); $end_year = isset($_GET['end_year']) ? $_GET['end_year'] : date('Y'); include $this->plugin->dir('/views/admin-reports.php'); }
/** * Add settings rows * * @param array $opts * @param MC4WP_Form $form */ public function add_settings_rows($opts, MC4WP_Form $form) { include $this->plugin->dir('/views/setting.php'); }