flow_css_is_http($flow_css_url); if( $flow_css_is_http ) { $aejs_url_changed = $this->match_and_change_scheme($flow_css_url, $ae_js_url); return $aejs_url_changed; } else { return $ae_js_url; } } /** * Excepts an option, loads the corresponding theme based upon the option * @param int $option integer representing which stylesheet is to be loaded * @return void */ public function load_ae_form_style($option, $version) { switch($option) { case 0: return; case 1: wp_enqueue_style('ae-signup-theme-colourful.css', plugin_dir_url(__DIR__) . 'public/css/ae-signup-theme-colourful.css', array(), $version, 'all'); return; case 2: wp_enqueue_style('ae-signup-theme-light.css', plugin_dir_url(__DIR__) . 'public/css/ae-signup-theme-light.css', array(), $version, 'all'); return; case 3: wp_enqueue_style('ae-signup-theme-dark.css', plugin_dir_url(__DIR__) . 'public/css/ae-signup-theme-dark.css', array(), $version, 'all'); return; default: return; } } /** * If the client has defined a custom flow_css URL, it will be loaded into flow_css * If the client has not defined a custom flow_css URL and also selected a css theme, the theme will be * loaded into flow_css * * @return string flow_css URL */ public function get_selected_flow_css_url() { $flow_css_url = get_option('ae_connect_flow_css'); $theme_css_option = get_option('ae_connect_flow_css_themes'); if( empty($flow_css_url) && ( $theme_css_option != 0 || empty($theme_css_option) ) ) { return $this->get_theme_stylesheet($theme_css_option); } return $flow_css_url; } /** * Excepts an option, returns the corresponding theme based upon the option * @param int $option integer representing which stylesheet is to be returned * @return string stylesheet url (empty string if case:0 or invalid option) */ public function get_theme_stylesheet($option) { $plugin_dir = plugin_dir_url(__DIR__); $theme1 = $plugin_dir . 'public/css/ae-signup-theme-colourful.css'; $theme2 = $plugin_dir . 'public/css/ae-signup-theme-light.css'; $theme3 = $plugin_dir . 'public/css/ae-signup-theme-dark.css'; switch($option) { case 0: return ''; case 1: return $theme1; case 2: return $theme2; case 3: return $theme3; default: return ''; } } }