settings->get_default_title_text( "aghai_ac_toolbar_button_{$button_type}_title" ); return '' . $this->get_toolbar_svg( $button_type ) . '' . $title . ''; } //public function get_statement_text() { //$text = Aghai_Accessibility::$instance->settings->get_default_title_text( "aghai_ac_statement" ); //return $text; //} public function enqueue_scripts() { wp_register_script( 'aghai-ac', AGHAI_AC_ASSETS_URL . 'js/app.min.js', array( 'jquery', ), '1.0.0', true ); wp_register_style( 'aghai-ac', AGHAI_AC_ASSETS_URL . 'css/style.min.css', array(), '1.0.0' ); wp_enqueue_script( 'aghai-ac' ); wp_enqueue_style( 'aghai-ac' ); wp_localize_script( 'aghai-ac', 'AghaiACOptions', array( 'focusable' => ( 'enable' === get_option( 'aghai_ac_focusable' ) ), 'remove_link_target' => ( 'enable' === get_option( 'aghai_ac_remove_link_target' ) ), 'add_role_links' => ( 'enable' === get_option( 'aghai_ac_add_role_links' ) ), 'enable_save' => ( 'enable' === get_option( 'aghai_ac_save' ) ), 'save_expiration' => get_option( 'aghai_ac_save_expiration' ), ) ); } public function print_skip_to_content_link() { $skip_to_content_link = get_option( 'aghai_ac_skip_to_content_link' ); if ( 'disable' === $skip_to_content_link ) { return; } ?> is_toolbar_active() ) { return; } $customizer_options = get_option( AGHAI_AC_CUSTOMIZER_OPTIONS ); $toolbar_position = $customizer_options['ac_toolbar_position']; if ( empty( $toolbar_position ) || ! in_array( $toolbar_position, array( 'right', 'left' ) ) ) { $toolbar_position = 'left'; } $toolbar_title = Aghai_Accessibility::$instance->settings->get_default_title_text( 'aghai_ac_toolbar_title' ); $toolbar_visibility = get_option( 'aghai_ac_toolbar' ); $wrapper_classes = array( 'aghai-ac-toolbar-' . $toolbar_position, ); if ( 'enable' !== $toolbar_visibility ) { $wrapper_classes[] = 'aghai-ac-' . $toolbar_visibility; } $sitemap_link = get_option( 'aghai_ac_toolbar_button_sitemap_link' ); $help_link = get_option( 'aghai_ac_toolbar_button_help_link' ); $feedback_link = get_option( 'aghai_ac_toolbar_button_feedback_link' ); $has_custom_links = ( ! empty( $sitemap_link ) || ! empty( $help_link ) || ! empty( $feedback_link ) ); $icon = isset( $customizer_options['ac_toolbar_icon'] ) ? $customizer_options['ac_toolbar_icon'] : 'wheelchair'; ?>
'', 'resize_font_less' => '', 'grayscale' => '', 'high_contrast' => '', 'negative_contrast' => '', 'light_bg' => '', 'links_underline' => '', 'readable_font' => '', 'reset' => '', 'sitemap' => '', 'help' => '', 'feedback' => '', ); } if ( isset( $icons[ $icon ] ) ) { return sprintf( '%s', $icons[ $icon ] ); } return ''; } private function get_svg_icon( $icon ) { if ( null === $this->svg_icons ) { $this->svg_icons = array( 'wheelchair' => '', 'one-click' => '', 'accessibility' => '', ); } if ( isset( $this->svg_icons[ $icon ] ) ) { return $this->svg_icons[ $icon ]; } return $this->svg_icons['accessibility']; } public function __construct() { add_action( 'wp_enqueue_scripts', array( &$this, 'enqueue_scripts' ) ); add_action( 'wp_footer', array( &$this, 'print_skip_to_content_link' ), 20 ); add_action( 'wp_footer', array( &$this, 'print_toolbar' ), 30 ); } }