options = get_option( 'sitelinx' ); ?>
__('General', 'accessibility-light'), 'sitelinx_toolbar' => __('Toolbar', 'accessibility-light'), // 'sitelinx_skiplinks' => __('Skiplinks', 'accessibility-light'), ); foreach ($sections as $section_key => $section_name) { add_settings_section($section_key, $section_name, array($this, 'empty_section_info'), 'accessible-sitelinx'); } $fields = array( 'accessibility_enable' => 'sitelinx_general', 'focus' => 'sitelinx_general', 'link_underline' => 'sitelinx_general', 'empty_alt' => 'sitelinx_general', 'toolbar' => 'sitelinx_toolbar', 'toolbar_customization' => 'sitelinx_toolbar', 'toolbar_visibility' => 'sitelinx_toolbar', 'toolbar_skin' => 'sitelinx_toolbar', 'toolbar_fontsizer' => 'sitelinx_toolbar', 'toolbar_additional_buttons' => 'sitelinx_toolbar', 'toolbar_important' => 'sitelinx_toolbar', // 'skiplinks' => 'sitelinx_skiplinks', // 'skiplinks_action' => 'sitelinx_skiplinks', // 'skiplinks_side' => 'sitelinx_skiplinks', ); foreach ($fields as $field_key => $field_section) { add_settings_field($field_key, '', array( $this, $field_key . '_callback' ), 'accessible-sitelinx', $field_section); } } public function sanitize($input) { $new_input = array(); foreach ($input as $key => $value) { $new_input[$key] = $value; } return $new_input; } /********** SECTIONS CALLBACKS **********/ public function empty_section_info() {} /********** FIELDS CALLBACKS ***********/ /* * Add alt attribute to images without alt * * @type checkbox * @id empty_alt */ public function empty_alt_callback() { $field = '
'; $field .= '

' . __('Images', 'accessibility-light') . '

'; $field .= ''; $field .= '
'; printf($field,isset( $this->options['image_alt'] ) ? esc_attr( $this->options['image_alt']) : ''); } /* * General Settings */ public function accessibility_enable_callback() { $field = '

' . __('Disable the Accessibility', 'accessibility-light') . '

'; $field .= '
'; $field .= ''; $field .= '

'; $field .= '
' . __('Enable/Disable', 'accessibility-light') . '
'; $field .= '
' . __('Activate the Accessibility', 'accessibility-light') . '
'; printf($field,isset( $this->options['accessibility_enable'] ) ? esc_attr( $this->options['accessibility_enable'] ) : ''); } /* * Add effect to all focusable items */ public function focus_callback() { $focus = isset($this->options['focus']) ? $this->options['focus'] : ''; $focus_type = isset($this->options['focus_type']) ? $this->options['focus_type'] : ''; $customColor = isset($this->options['outline_color']) ? $this->options['outline_color'] : ''; $field = '

' . __('Focus', 'accessibility-light') . '

'; $field .= '
'; $field .= '
'; $field .= '
'; printf($field,isset($focus) ? esc_attr($focus) : ''); $field = '
'; $field .= '
'; $field .= '
'; $field .= '
'; printf($field,isset( $focus_type ) ? esc_attr( $focus_type ) : ''); $outline_color_class = ( $focus_type === 'custom' ) ? ' open' : ''; $field = '
'; //code for custom colorpicker printf($field,isset( $this->options['outline_color'] ) ? esc_attr( $this->options['outline_color']) : ''); $field = '
'; $field .= '
'; $field .= '
'; printf($field,isset( $this->options['outline_important'] ) ? esc_attr( $this->options['outline_important']) : ''); } public function link_underline_callback() { $tbs_focus_only = isset($this->options['link_underline']) ? $this->options['link_underline'] : ''; $focus_only = ( $tbs_focus_only == 'focus') ? ' selected' : ''; $focus_hover = ( $tbs_focus_only == 'hover') ? ' selected' : ''; $on_all = ( $tbs_focus_only == 'all') ? ' selected' : ''; $field = '
'; $field .= '

' . __('Links', 'accessibility-light') . '

'; $field .= ''; $field .= ''; $field .= '
'; printf($field,isset( $this->options['link_underline'] ) ? esc_attr( $this->options['link_underline']) : ''); $field = '
'; $field .= ''; $field .= '
'; $field .= '
'; printf($field,isset( $this->options['underline_important'] ) ? esc_attr( $this->options['underline_important']) : ''); } /* * Toolbar Settings */ public function toolbar_callback() { $get_toolbar_side = isset($this->options['toolbar_side']) ? $this->options['toolbar_side'] : ''; $right = ($get_toolbar_side == 'right') ? ' selected' : ''; $left = ( $get_toolbar_side == 'left') ? ' selected' : ''; $lower_right = ($get_toolbar_side == 'lower-right') ? ' selected' : ''; $lower_left = ( $get_toolbar_side == 'lower-left') ? ' selected' : ''; $toolbar_icon = (isset($this->options['toolbar_icon'])) ? $this->options['toolbar_icon'] : ''; $color_icon = (isset($this->options['color_icon'])) ? $this->options['color_icon'] : '#0a76be'; $fields = array( 'disable_blackscreen' => __("Disable the black screen", 'accessibility-light'), 'hide_toolbar_mobile' => __("Show the toolbar for mobile users", 'accessibility-light'), ); $i = 0; foreach($fields as $key => $value) { $output = ''; if($i == 0) { $output .= '

' . __('Toolbar Settings', 'accessibility-light') . '

'; $output .= '
'; } $output .= '
'; $output .= ''; $output .= '
'; printf($output,isset( $this->options[$key] ) ? esc_attr( $this->options[$key]) : ''); $i++; } $field = '
'; $field .= '
'; $field .= '
'; $field .= ''; $field .= '
'; printf($field,isset( $this->options['toolbar_side'] ) ? esc_attr( $this->options['toolbar_side']) : ''); $field = '
'; $field .= ''; $field .= ''; $field .= '' . __("Max size", "accessibility-light") . ': 300px × 300px ' . __("proporsional", "accessibility-light") . ': 64px × 64px'; $field .= '
'; printf($field,isset( $this->options['toolbar_icon'] ) ? esc_attr( $this->options['toolbar_icon']) : ''); $field = '
'; $field .= ''; $field .= '
'; $field .= '

'; ?> options['color_icon'] ) ? esc_attr( $this->options['color_icon']) : ''); } /* * Show/Hide Toolbar List */ public function toolbar_visibility_callback() { $fields = array( 'hide_flashes' => __("Hide the button to disable flashes", 'accessibility-light'), 'hide_headingmarks' => __("Hide the button to to mark heading", 'accessibility-light'), 'hide_background' => __("Hide the button to change background color", 'accessibility-light'), 'disable_zoom' => __("Hide the screen zoom buttons", 'accessibility-light'), 'disable_fontzoom' => __("Hide the font resize buttons", 'accessibility-light'), 'hide_readable' => __("Hide the button that change to readable font", 'accessibility-light'), 'hide_contrast' => __("Hide the contrast buttons", 'accessibility-light'), 'hide_underline' => __("Hide the underline button", 'accessibility-light'), 'hide_linkmarks' => __("Hide the button to mark links", 'accessibility-light'), 'remove_link' => __("Remove promotional link", 'accessibility-light'), ); $i = 0; foreach($fields as $key => $value) { $i++; $output = ''; if($i == 1) { $output .= '

' . __('Toolbar Menu', 'accessibility-light') . '

'; $output .= '
'; } $output .= ''; if($i == 10) { $output .= '

'; } printf($output,isset( $this->options[$key] ) ? esc_attr( $this->options[$key]) : ''); } } public function toolbar_important_callback() { $fields = array( 'mheading_important' => __("Mark headings mode", 'accessibility-light'), 'readable_important' => __("Readable font mode", 'accessibility-light'), 'contrast_important' => __("Contrast modes", 'accessibility-light'), 'underline_important' => __("Underline mode", 'accessibility-light'), 'mlinks_important' => __("Mark links mode", 'accessibility-light'), ); $i = 0; foreach($fields as $key => $value) { $i++; $field_output = ''; if($i == 1) { $field_output .= '

' . __('CSS Important (Advanced)', 'accessibility-light') . '

'; $field_output .= '

' . __('You can hardened the effect of some toolbar button with the use of CSS important. this is not the best way, the best way is to implement a better CSS by yourself with Accessible sitelinx set of classes.', 'accessibility-light') . '

'; $field_output .= '
'; } $field_output .= ''; if($i == count($fields)) { $field_output .= '
'; } printf($field_output,isset( $this->options[$key] ) ? esc_attr( $this->options[$key]) : ''); } } public function toolbar_customization_callback() { /// icon size $icon_size = isset( $this->options['icon_size'] ) ? $this->options['icon_size'] : ''; $small = ($icon_size == 'small') ? ' selected' : ''; $normal = ($icon_size == 'normal') ? ' selected' : ''; $big = ($icon_size == 'big') ? ' selected' : ''; $field = '

' . __('Customization', 'accessibility-light') . '

'; $field .= '

' . __('Customize Toolbar Icon', 'accessibility-light') . '

'; $field .= '
'; $field .= '
'; $field .= ''; $field .= ''; $field .= '
'; $field .= '
'; printf($field, isset( $this->options['icon_size'] ) ? esc_attr( $this->options['icon_size']) : ''); $icon_shape = isset( $this->options['icon_shape'] ) ? $this->options['icon_shape'] : ''; $circle = ($icon_shape == 'circle') ? ' selected' : ''; $square = ($icon_shape == 'square') ? ' selected' : ''; $field = '
'; $field .= '
'; $field .= ''; $field .= ''; $field .= '
'; $field .= '
'; printf($field, isset( $this->options['icon_shape'] ) ? esc_attr( $this->options['icon_shape']) : ''); /// toolbar position $field = '
'; $field .= ''; $field .= 'px'; $field .= '
'; printf($field, isset( $this->options['toolbar_position'] ) ? esc_attr( $this->options['toolbar_position']) : ''); $field = '
'; $field .= ''; $field .= 'px'; $field .= '

'; printf($field, isset( $this->options['toolbar_position_side'] ) ? esc_attr( $this->options['toolbar_position_side']) : ''); $fiel = ""; $img_size = isset( $this->options['img_size'] ) ? $this->options['img_size'] : ''; $x1 = ($img_size == '1') ? ' selected' : ''; $x2 = ($img_size == '2') ? ' selected' : ''; $x3 = ($img_size == '3') ? ' selected' : ''; $fiel .= '
'; $fiel .= '
'; $fiel .= ''; $fiel .= ''; $fiel .= '
'; $fiel .= '

'; // /printf($fiel, isset( $this->options['img_size'] ) ? esc_attr( $this->options['img_size']) : ''); } /* * Additional Buttons */ public function toolbar_additional_buttons_callback() { $sitelinx_statement = ( isset($this->options['sitelinx_statement']) ) ? $this->options['sitelinx_statement'] : ''; $field = '

' . __('Additional Buttons', 'accessibility-light') . '

'; $field .= '
'; $field .= '
'; $field .= ''; $field .= ''; $field .= '
'; printf($field,isset( $this->options['toolbar_statement'] ) ? esc_attr( $this->options['toolbar_statement']) : ''); $sitelinx_feedback = ( isset($this->options['sitelinx_feedback']) ) ? $this->options['sitelinx_feedback'] : ''; $field = '
'; $field .= ''; $field .= ''; $field .= '
'; $field .= '
'; $field .= '
'; printf($field,isset( $this->options['sitelinx_feedback'] ) ? esc_attr( $this->options['sitelinx_feedback']) : ''); } /* * Font Sizer */ public function toolbar_fontsizer_callback() { $fontsizer_inc = (isset($this->options['fontsizer_inc'])) ? $this->options['fontsizer_inc'] : ''; $field = '
'; $field .= '

' . __('Font Size Modifier', 'accessibility-light') . '

'; $field .= ''; $field .= ''; $field .= '
'; printf($field,isset( $this->options['fontsizer_inc'] ) ? esc_attr( $this->options['fontsizer_inc']) : ''); $fontsizer_exc = (isset($this->options['fontsizer_exc'])) ? $this->options['fontsizer_exc'] : ''; $field = '
'; $field .= ''; $field .= ''; $field .= '

'; printf($field,isset( $this->options['fontsizer_exc'] ) ? esc_attr( $this->options['fontsizer_exc']) : ''); } public function toolbar_skin_callback(){} /* * Activate Skiplinks */ public function skiplinks_callback() { $field = '

' . __('Skiplinks', 'accessibility-light') . '

'; $field .= '
'; $field .= ''; $field .= '
'; printf($field,isset( $this->options['skiplinks'] ) ? esc_attr( $this->options['skiplinks']) : ''); } /* * Skiplinks side */ public function skiplinks_side_callback() { $left = ($this->options['skiplinks_side'] == 'left') ? ' selected' : ''; $right = ($this->options['skiplinks_side'] == 'right') ? ' selected' : ''; $field = '
'; $field .= ''; $field .= ' '; $field .= '
'; printf($field,isset( $this->options['skiplinks_side'] ) ? esc_attr( $this->options['skiplinks_side']) : ''); } /* * Skiplinks action */ public function skiplinks_action_callback() { $footer = ($this->options['skiplinks_action'] == 'footer') ? ' selected' : ''; $body = ($this->options['skiplinks_action'] == 'body') ? ' selected' : ''; $field = '
'; $field .= ''; $field .= ' '; $field .= '
'; printf($field,isset( $this->options['skiplinks_action'] ) ? esc_attr( $this->options['skiplinks_action']) : ''); } }