/** * Helper function to return the settings fields, their descriptions, and * help setup their callbacks for rendering. * * @return array */ public static function get_settings_fields() { // Authentication settings $settings_fields = array('connectivity' => array('title' => esc_html__('Service Connectivity', 'pushup'), 'callback' => array(__CLASS__, '_render_account_connectivity_field'), 'section' => 'default'), 'username' => array('title' => esc_html__('PushUp Username', 'pushup'), 'callback' => array(__CLASS__, '_render_account_username_field'), 'section' => 'default'), 'api-key' => array('title' => esc_html__('PushUp API Key', 'pushup'), 'callback' => array(__CLASS__, '_render_account_api_key_field'), 'section' => 'default')); // The following fields are only for authenticated users if (PushUp_Notifications_Authentication::is_authenticated() && PushUp_Notifications_JSON_API::is_domain_enabled()) { /** Analytics *****************************************************/ // Skip if we can't get any analytics if (PushUp_Notifications_JSON_API::get_analytics()) { // Subscribers chart $settings_fields['subscribers'] = array('title' => esc_html__('Subscribers', 'pushup'), 'callback' => array(__CLASS__, '_render_analytics_pie_field'), 'section' => 'analytics', 'args' => array('canvas_id' => 'conversion', 'desc' => esc_html__('Number of Subscribers', 'pushup'), 'data_points' => array(esc_html('Declined', 'pushup') => array('color' => '#63bde4', 'path' => array('total_declined')), esc_html('Accepted', 'pushup') => array('color' => 'rgba(74,198,143,1)', 'path' => array('total_granted'))))); // Pushes chart $settings_fields['pushes'] = array('title' => esc_html__('Push Requests', 'pushup'), 'callback' => array(__CLASS__, '_render_analytics_pie_field'), 'section' => 'analytics', 'desc' => '', 'args' => array('canvas_id' => 'requests', 'desc' => esc_html__('Total Number of Posted Items Pushed to Subscribers', 'pushup'), 'data_points' => array(esc_html('This Month', 'pushup') => array('color' => '#63bde4', 'path' => array('total_monthly_pushes', 'total_push_requests')), esc_html('All Time', 'pushup') => array('color' => 'rgba(74,198,143,1)', 'path' => array('total_all_time_pushes', 'total_push_requests'))))); // Notifications chart $settings_fields['notifications'] = array('title' => esc_html__('Notifications', 'pushup'), 'callback' => array(__CLASS__, '_render_analytics_pie_field'), 'section' => 'analytics', 'args' => array('canvas_id' => 'recipients', 'desc' => esc_html__('Total Number of Notifications Sent to Subscribers', 'pushup'), 'data_points' => array(esc_html__('This Month', 'pushup') => array('color' => '#63bde4', 'path' => array('total_monthly_pushes', 'total_push_recipients')), esc_html__('All Time', 'pushup') => array('color' => 'rgba(74,198,143,1)', 'path' => array('total_all_time_pushes', 'total_push_recipients'))))); } /** Display *******************************************************/ // Website Name $settings_fields['website_name'] = array('title' => esc_html__('Website Name', 'pushup'), 'callback' => array(__CLASS__, '_render_display_website_name_field'), 'section' => 'display'); // Notification Title $settings_fields['post_title'] = array('title' => esc_html__('Notification Title', 'pushup'), 'callback' => array(__CLASS__, '_render_display_post_title_field'), 'section' => 'display'); // Icons if (PushUp_Notifications_JSON_API::get_icon_data()) { $settings_fields['icon'] = array('title' => esc_html__('Icon(s)', 'pushup'), 'callback' => array(__CLASS__, '_render_display_icon_field'), 'section' => 'display'); } // Prompt Visitor $settings_fields['prompt'] = array('title' => esc_html__('Offer Notifications', 'pushup'), 'callback' => array(__CLASS__, '_render_display_prompt_field'), 'section' => 'display'); } return $settings_fields; }