options = get_option( 'accessible_poetry' );
echo '
';
acp_panel_header();
echo '
';
echo '
';
if( acp_proAvailable() ) acp_panel_sidebar();
echo '
';
echo '
';
}
/*
* Panel page fields initialization
*/
public function page_init() {
/*
* Register the settings group and
* call the Sanitize function
*/
register_setting(
'acp_group',
'accessible_poetry',
array( $this, 'sanitize' )
);
/*
* Add our Sections
*/
// Semantics section
add_settings_section(
'acp_semantics',
__('Semantics', 'acp'),
array( $this, 'empty_section_info' ),
'accessible-poetry'
);
// Visual section
add_settings_section(
'acp_visual',
__('Visual', 'acp'),
array( $this, 'empty_section_info' ),
'accessible-poetry'
);
// Toolbar section
add_settings_section(
'acp_toolbar',
__('Toolbar', 'acp'),
array( $this, 'empty_section_info' ),
'accessible-poetry'
);
// Skiplinks section
add_settings_section(
'acp_skiplinks',
__('Skiplinks', 'acp'),
array( $this, 'empty_section_info' ),
'accessible-poetry'
);
/*
* Add our Fields
*/
// language attribute
add_settings_field(
'html_lang', '',
array( $this, 'html_lang_callback' ),
'accessible-poetry',
'acp_semantics'
);
// empty images alt
add_settings_field(
'image_alt', '',
array( $this, 'image_alt_callback' ),
'accessible-poetry',
'acp_semantics'
);
// remove unnecessary tabindex
add_settings_field(
'remove_tabindex', '',
array( $this, 'remove_tabindex_callback' ),
'accessible-poetry',
'acp_semantics'
);
// replace titles with aria-labels
add_settings_field(
'links_arialabel', '',
array( $this, 'links_arialabel_callback' ),
'accessible-poetry',
'acp_semantics'
);
// logo identifier
add_settings_field(
'logo_identifier', '',
array( $this, 'logo_identifier_callback' ),
'accessible-poetry',
'acp_semantics'
);
// logo directive
add_settings_field(
'logo_directive', '',
array( $this, 'logo_directive_callback' ),
'accessible-poetry',
'acp_semantics'
);
// replacement tag 1
add_settings_field(
'tag_replacement1_callback', '',
array( $this, 'tag_replacement1_callback' ),
'accessible-poetry',
'acp_semantics'
);
// replacement tag 2
add_settings_field('tag_replacement2_callback', '',
array( $this, 'tag_replacement2_callback' ),
'accessible-poetry',
'acp_semantics'
);
// replacement tag 3
add_settings_field(
'tag_replacement3_callback', '',
array( $this, 'tag_replacement3_callback' ),
'accessible-poetry',
'acp_semantics'
);
// outline on focus mode
add_settings_field(
'link_outline', '',
array( $this, 'link_outline_callback' ),
'accessible-poetry',
'acp_visual'
);
// add link underline
add_settings_field(
'link_underline', '',
array( $this, 'link_underline_callback' ),
'accessible-poetry',
'acp_visual'
);
// enable manual toolbar
add_settings_field(
'enable_manual_toolbar', '',
array( $this, 'enable_manual_toolbar_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// enable ajax toolbar
add_settings_field(
'enable_toolbar', '',
array( $this, 'enable_ajax_toolbar_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// disable toolbar on mobile
add_settings_field(
'disable_mobile_toolbar', '',
array( $this, 'disable_mobile_toolbar_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// declaration link
add_settings_field(
'declaration_link',
'',
array( $this, 'declaration_link_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// contact link
add_settings_field(
'contact_link', '',
array( $this, 'contact_link_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// hide font size
add_settings_field(
'hide_fontsizer', '',
array( $this, 'hide_fontsizer_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// hide contrast
add_settings_field(
'hide_contrast', '',
array( $this, 'hide_contrast_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// hide underline
add_settings_field(
'hide_underline', '',
array( $this, 'hide_underline_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// hide linkmark
add_settings_field(
'hide_linkmark', '',
array( $this, 'hide_linkmark_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// hide readable
add_settings_field(
'hide_readable', '',
array( $this, 'hide_readable_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// hide animation
add_settings_field(
'hide_animation', '',
array( $this, 'hide_animation_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// Toolbar Style
add_settings_field(
'toolbar_skin', '',
array( $this, 'toolbar_skin_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// toolbar side
add_settings_field(
'toolbar_side', '',
array( $this, 'toolbar_side_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// Icon size
add_settings_field(
'icon_size', '',
array( $this, 'icon_size_callback' ),
'accessible-poetry',
'acp_toolbar'
);
add_settings_field(
'icon_position', '',
array( $this, 'icon_position_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// include tags on font sizer
add_settings_field(
'fontsizer_include', '',
array( $this, 'fontsizer_include_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// exclude tags on font sizer
add_settings_field(
'fontsizer_exclude', '',
array( $this, 'fontsizer_exclude_callback' ),
'accessible-poetry',
'acp_toolbar'
);
// activate skiplinks manual
add_settings_field(
'enable_manual_skiplinks', '',
array( $this, 'enable_manual_skiplinks_callback' ),
'accessible-poetry',
'acp_skiplinks'
);
// activate skiplinks with ajax
add_settings_field(
'enable_ajax_skiplinks', '',
array( $this, 'enable_ajax_skiplinks_callback' ),
'accessible-poetry',
'acp_skiplinks'
);
// activate skiplinks for home
add_settings_field(
'skiplinks_home', '',
array( $this, 'skiplinks_home_callback' ),
'accessible-poetry',
'acp_skiplinks'
);
// skiplinks side
add_settings_field(
'skiplinks_side', '',
array( $this, 'skiplinks_side_callback' ),
'accessible-poetry',
'acp_skiplinks'
);
}
/*
* Sanitize the information
*/
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 language attribute to html tag
*
* @type checkbox
* @id html_lang
* @since 2.0.1
*/
public function html_lang_callback() {
$field = '' . __('Attributes', 'acp') . ' ';
$field .= '';
$field .= ' ' . __('LANG Attribute', 'acp') . ' ';
$field .= '' . __('At the beginning of each HTML document there is an opening tag that looks like this: <html>, which surrounds the entire document. this tag need to have a language attribute with the document language code as a value. the option below will force the <html> tag to have the language attribute with the right value.', 'acp') . '
';
$field .= ' ';
$field .= ' options['html_lang'] ), false ) . '>';
$field .= __('Add Language Attribute to the <html> tag', 'acp');
$field .= ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['html_lang'] ) ? esc_attr( $this->options['html_lang']) : ''
);
}
/*
* Add alt attribute to images without alt
*
* @type checkbox
* @id image_alt
* @since 2.0.1
*/
public function image_alt_callback() {
$field = '';
$field .= ' ' . __('ALT Attribute', 'acp') . ' ';
$field .= ' ';
$field .= ' options['image_alt'] ), false ) . '>';
$field .= __('Add empty Alt attribute to images without an Alt attribute', 'acp');
$field .= ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['image_alt'] ) ? esc_attr( $this->options['image_alt']) : ''
);
}
/*
* Add aria-label to links
*
* @type radio
* @id links_arialabel
* @since 2.1.1
*/
public function links_arialabel_callback() {
$none = ''; $replace = ''; $add = '';
$title_attr = $this->options['title_attr'];
if( $title_attr == 'none' )
$none = ' selected';
elseif( $title_attr == 'replace' )
$replace = ' selected';
elseif( $title_attr == 'add' )
$add = ' selected';
$linkTitle = 'read more about the title attribute';
$field = '';
$field .= '' . __('TITLE Attribute', 'acp') . ' ';
$field .= '' . __('The \'title\' attribute specifies extra information about an element', 'acp') . ' ';
$field .= ( acp_proAvailable() ) ? '('.__('read more','acp').' ).':'';
$field .= __('apparently, some popular screen readers ignore that attribute, so to pass the extra information that the \'title\' attribute holds we can use the \'aria-label\' attribute.', 'acp') . '
';
$field .= __('At the option below you can determine weather to replace the \'title\' attribute with an \'aria-label\' attribute, or to add extra \'aria-label\' attribute with the value of the \'title\' attribute', 'acp') . '';
$field .= ' ' . __('Title Attribte Behavior', 'acp') . ' ';
$field .= ' ';
$field .= ' ' . __('-- None --', 'acp') . ' ';
$field .= ' ' . __('Replace the \'title\' attribute with \'aria-label\' attribute (value will remain the same)', 'acp') . ' ';
$field .= ' ' . __('Add extra \'aria-label\' attribute to all objects that have \'title\' attribute', 'acp') . ' ';
$field .= ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['links_arialabel'] ) ? esc_attr( $this->options['links_arialabel']) : ''
);
}
/*
* Add outline to all links when
* they're on focus mode
*
* @type radio
* @id link_outline
* @since 2.0.1
*/
public function link_outline_callback() {
$none = '';$red = '';$blue = '';
// PRO ONLY
$custom = '';
// Check if and which option is selected
if( $this->options['link_outline'] == 'none' )
$none = ' selected';
elseif( $this->options['link_outline'] == 'red' )
$red = ' selected';
elseif( $this->options['link_outline'] == 'blue' )
$blue = ' selected';
$field = '' . __('Focus', 'acp') . ' ';
$field .= '';
$field .= '' . __('Add outline to all necessary objects when they\'re in focus', 'acp') . ' ';
$field .= '';
$field .= ' ' . __('-- None --', 'acp') . ' ';
$field .= ' ' . __('Red Outline', 'acp') . ' ';
$field .= ' ' . __('Blue Outline', 'acp') . ' ';
// PRO ONLY
$field .= ' ' . __('Custom Color (PRO Only)', 'acp') . ' ';
$field .= ' ';
if( acp_proAvailable() ) {
acp_upgrade_promote();
}
$field .= ' ';
printf(
$field,
isset( $this->options['link_outline'] ) ? esc_attr( $this->options['link_outline']) : ''
);
}
/*
* Add underline to all links
*
* @type checkbox
* @id link_underline
* @since 2.0.1
*/
public function link_underline_callback() {
$field = '' . __('Links', 'acp') . ' ';
$field .= '';
$field .= '';
$field .= ' options['link_underline'] ), false ) . '>';
$field .= __('Add underline to all links in focus & hover mode', 'acp') . ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['link_underline'] ) ? esc_attr( $this->options['link_underline']) : ''
);
}
/*
* Remove tabindex attribute
*
* @type checkbox
* @id remove_tabindex
* @since 2.0.1
*/
public function remove_tabindex_callback() {
$field = '' . __('TABINDEX Attribute', 'acp') . ' ';
$field .= '';
$field .= '';
$field .= ' options['remove_tabindex'] ), false ) . '>';
$field .= __('Remove unnecessary tabindex attributes', 'acp') . ' ';
$field .= ( acp_proAvailable() ) ? acp_upgrade_promote( __('Want more control on the Tabindex?', 'acp') ) : '';
$field .= ' ';
printf(
$field,
isset( $this->options['remove_tabindex'] ) ? esc_attr( $this->options['remove_tabindex']) : ''
);
}
/*
* Enable Manual Toolbar
*
* @type checkbox
* @id enable_manual_toolbar
* @since 2.0.1
*/
public function enable_manual_toolbar_callback() {
$field = '';
$field .= ' ' . __('General', 'acp') . ' ';
$field .= ' ' . __('To see the Toolbar on your WordPress site you must first activate it. there are two ways to activate the toolbar, the manual way & the auto way.', 'acp');
$field .= '
' . __('Toolbar Manual Activation', 'acp') . ' ';
$field .= '';
$field .= '
' . __('This is the recommended way to activate the toolbar but it is also an advanced way so remember: Do not mess with it if you not familiar with WordPress theme files.', 'acp') . '
';
$field .= '
' . __('To activate the toolbar manually please follow the instructions below:', 'acp') . '
';
$field .= '
';
$field .= ' ' . __('Activate the Manual Toolbar checkbox', 'acp'). ' ';
$field .= ' ' . __('Open the file \'header.php\' from your theme folder', 'acp'). ' ';
$field .= ' ' . __('Locate the opening body tag (it need to look like this: <body>)', 'acp'). ' ';
$field .= ' ' . __('Insert the next code right after the opening body tag (if you using also the skiplinks please add this before the skiplinks):', 'acp');
$field .= ' <?php if(function_exists(\'acp_toolbar\') ) { acp_toolbar(); }?> ';
$field .= ' ';
$field .= ' ';
$field .= '
';
$field .= ' options['enable_manual_toolbar'] ), false ) . '>';
$field .= __('Enable the Accessibility Toolbar Manually', 'acp') . ' ';
$field .= '
';
$field .= '' . __('The Manual Activation is disabled because the auto activation is active.', 'acp') . '
';
$field .= ' ';
printf(
$field,
isset( $this->options['enable_manual_toolbar'] ) ? esc_attr( $this->options['enable_manual_toolbar']) : ''
);
}
/*
* Enable Ajax Toolbar
*
* @type checkbox
* @id enable_ajax_toolbar
* @since 2.0.1
*/
public function enable_ajax_toolbar_callback() {
$field = '';
$field .= '' . __('Auto Activation', 'acp') . ' ';
$field .= '';
$field .= '
' . __('In the Automatic Activation the toolbar will be loaded with Ajax calls. all you need to do is to check the next checkbox.', 'acp') . '
';
$field .= '
';
$field .= ' options['enable_ajax_toolbar'] ), false ) . '>';
$field .= __('Enable the Accessibility Toolbar with Ajax call', 'acp') . ' ';
$field .= '
';
$field .= '' . __('The Auto Activation is disabled because the manual activation is active.', 'acp') . '
';
$field .= ' ';
printf(
$field,
isset( $this->options['enable_ajax_toolbar'] ) ? esc_attr( $this->options['enable_ajax_toolbar']) : ''
);
}
/*
* Disable Toolbar on mobile devices
*
* @type checkbox
* @id disable_mobile_toolbar
* @since 2.0.1
*/
public function disable_mobile_toolbar_callback() {
$field = '' . __('Additional Settings', 'acp') . ' ';
$field .= '';
$field .= '';
$field .= ' options['disable_mobile_toolbar'] ), false ) . '>';
$field .= __('Disable toolbar for mobile users', 'acp') . ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['disable_mobile_toolbar'] ) ? esc_attr( $this->options['disable_mobile_toolbar']) : ''
);
}
/*
* Toolbar Skins
*
* @type checkbox
* @id toolbar_skin
* @since 2.1.1
*/
public function toolbar_skin_callback() {
$skin_flat = '';
$skin_solid = '';
$skin = $this->options['toolbar_skin'];
if( $skin == '1' ) {
$skin_solid = ' selected';
}
elseif( $skin == '2' ) {
$skin_flat = ' selected';
}
$field = '' . __('Customization', 'acp') . '' . __('NEW', 'acp') . ' ';
$field .= '';
$field .= '' . __('Toolbar style', 'acp') . ' ';
$field .= ' ';
$field .= ' ' . __('Solid', 'acp') . ' ';
$field .= ' ' . __('Flat', 'acp') . ' ';
$field .= ' ' . __('Minimal (PRO Only)', 'acp') . ' ';
$field .= ' ' . __('Rounded (PRO Only)', 'acp') . ' ';
$field .= ' ' . __('Fancy (PRO Only)', 'acp') . ' ';
$field .= ' ';
if( acp_proAvailable() )
$field .= ' ' . acp_upgrade_promote() . '
';
$field .= ' ';
printf(
$field,
isset( $this->options['toolbar_skin'] ) ? esc_attr( $this->options['toolbar_skin']) : ''
);
}
/*
* toolbar side
*
* @type dropdown
* @id toolbar_side
* @since 2.1.1
*/
public function toolbar_side_callback() {
$left = ''; $right = '';
if( $this->options['toolbar_side'] == 'right' ) {
$right = ' selected';
}
elseif( $this->options['toolbar_side'] == 'left' ) {
$left = ' selected';
}
$field = '';
$field .= '' . __('Toolbar Side', 'acp') . ' ';
$field .= ' ';
$field .= ' ' . __('Left', 'acp') . ' ';
$field .= ' ' . __('Right', 'acp') . ' ';
$field .= ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['toolbar_side'] ) ? esc_attr( $this->options['toolbar_side']) : ''
);
}
/*
* Icon size
*
* @type checkbox
* @id icon_size
* @since 2.1.1
*/
public function icon_size_callback() {
$large = ''; $small = '';
$icon_size = $this->options['icon_size'];
if( $icon_size == 'large' ) {
$large = ' selected';
}
elseif( $icon_size == 'small' ) {
$small = ' selected';
}
$field = '';
$field .= '' . __('Icon Size', 'acp') . ' ';
$field .= ' ';
$field .= ' ' . __('Large', 'acp') . ' ';
$field .= ' ' . __('Small', 'acp') . ' ';
$field .= ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['icon_size'] ) ? esc_attr( $this->options['icon_size']) : ''
);
}
/*
* Icon position
*
* @type checkbox
* @id icon_position
* @since 2.1.1
*/
public function icon_position_callback() {
$field = '';
$field .= '' . __('Icon Position from top (in pixels, default is 30)', 'acp') . ' ';
if( acp_proAvailable() ) {
$afterField = '' . __('Want to change the icon to something else?') . ' ' . '' . __('Upgrade to PRO') . ' ' . __('and get the ability to choose from 3 different icons!') . '
';
}
printf(
$field . 'px ' . $afterField,
isset( $this->options['icon_position'] ) ? esc_attr( $this->options['icon_position']) : ''
);
}
/*
* Activate the declaration button
* on the toolbar
*
* @type checkbox
* @id declaration_link
* @since 2.0.1
*/
public function declaration_link_callback() {
$field = '' . __('Additional Buttons', 'acp') . ' ';
$field .= '';
$field .= '' . __('Add additional button for Accessibility Declaration (leave blank to disable)', 'acp') . ' ';
printf(
$field . ' ',
isset( $this->options['declaration_link'] ) ? esc_attr( $this->options['declaration_link']) : ''
);
}
/*
* Contact button url
* on toolbar
*
* @type checkbox
* @id contact_link
* @since 2.0.1
*/
public function contact_link_callback() {
$field = '';
$field .= '' . __('Add additional button for Contact page (leave blank to disable)', 'acp') . ' ';
printf(
$field . ' ',
isset( $this->options['contact_link'] ) ? esc_attr( $this->options['contact_link']) : ''
);
}
/*
* Hide the font size changing buttons
* from the toolbar
*
* @type checkbox
* @id hide_fontsizer
* @since 2.0.1
*/
public function hide_fontsizer_callback() {
$field = '' . __('Buttons Visibility', 'acp') . ' ';
$field .= '';
$field .= '';
$field .= ' options['hide_fontsizer'] ), false ) . '>';
$field .= __('Hide the buttons that change the font size', 'acp') . ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['hide_fontsizer'] ) ? esc_attr( $this->options['hide_fontsizer']) : ''
);
}
/*
* Hide the contrast changing buttons
* from the toolbar
*
* @type checkbox
* @id hide_contrast
* @since 2.0.1
*/
public function hide_contrast_callback() {
$field = '';
$field .= '';
$field .= ' options['hide_contrast'] ), false ) . '>';
$field .= __('Hide the buttons that change the contrast', 'acp') . ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['hide_contrast'] ) ? esc_attr( $this->options['hide_contrast']) : ''
);
}
/*
* Hide the link underline button
* from the toolbar
*
* @type checkbox
* @id hide_underline
* @since 2.0.1
*/
public function hide_underline_callback() {
$field = '';
$field .= '';
$field .= ' options['hide_underline'] ), false ) . '>';
$field .= __('Hide the button that add underline to links', 'acp') . ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['hide_underline'] ) ? esc_attr( $this->options['hide_underline']) : ''
);
}
/*
* Hide the link mark button
* from the toolbar
*
* @type checkbox
* @id hide_linkmark
* @since 2.0.1
*/
public function hide_linkmark_callback() {
$field = '';
$field .= '';
$field .= ' options['hide_linkmark'] ), false ) . '>';
$field .= __('Hide the button that mark the links', 'acp') . ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['hide_linkmark'] ) ? esc_attr( $this->options['hide_linkmark']) : ''
);
}
/*
* Hide the readable font button
* from the toolbar
*
* @type checkbox
* @id hide_readable
* @since 2.0.1
*/
public function hide_readable_callback() {
$field = '';
$field .= '';
$field .= ' options['hide_readable'] ), false ) . '>';
$field .= __('Hide the button that change the font to readable', 'acp') . ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['hide_readable'] ) ? esc_attr( $this->options['hide_readable']) : ''
);
}
/*
* Hide the disable animation button
* from the toolbar
*
* @type checkbox
* @id hide_animation
* @since 2.0.1
*/
public function hide_animation_callback() {
$field = '';
$field .= '';
$field .= ' options['hide_animation'] ), false ) . '>';
$field .= __('Hide the button that disable the animations', 'acp') . ' ';
$field .= ' ';
printf(
$field,
isset( $this->options['hide_animation'] ) ? esc_attr( $this->options['hide_animation']) : ''
);
}
/*
* Include objects on the font size changing
* button on the toolbar
*
* @type text
* @id fontsizer_include
* @since 2.0.1
*/
public function fontsizer_include_callback() {
$field = '' . __('Font Size Change Options', 'acp') . ' ';
$field .= '';
$field .= '' . __('Include additional objects to affect with the font size change options at the toolbar by adding the object class or id (separate objects with a comma)', 'acp') . ' ';
$field .= ' ',
isset( $this->options['fontsizer_include'] ) ? esc_attr( $this->options['fontsizer_include']) : ''
);
}
/*
* Include objects from the font size changing
* button on the toolbar
*
* @type text
* @id fontsizer_exclude
* @since 2.0.1
*/
public function fontsizer_exclude_callback() {
$field = '';
$field .= '' . __('Exclude objects from the effect of the font size change options at the toolbar by adding the object class or id (separate objects with a comma)', 'acp') . ' ';
$field .= ' ',
isset( $this->options['fontsizer_exclude'] ) ? esc_attr( $this->options['fontsizer_exclude']) : ''
);
}
/*
* Activate the Skiplinks
*
* @type checkbox
* @id enable_manual_skiplinks
* @since 2.0.1
*/
public function enable_manual_skiplinks_callback() {
$field = '' . __('General', 'acp') . ' ';
$field .= '' . __('Skiplinks are buttons that helps navigate through the central regions of the page using the Tab key.', 'acp') . '
';
$field .= '' . __('There are two ways to activate the Skiplinks, the manual way & the auto way.', 'acp') . '
';
$field .= '' . __('Skiplinks Manual Activation', 'acp') . ' ';
$field .= '';
$field .= '';
$field .= '
' . __('This is the recommended way to activate the Skiplinks but it is also an advanced way so remember: Do not mess with it if you not familiar with WordPress theme files.', 'acp') . '
';
$field .= '
' . __('To activate the Skiplinks manually please follow the instructions below:', 'acp') . '
';
$field .= '
';
$field .= ' ' . __('Activate the Manual Skiplinks checkbox', 'acp'). ' ';
$field .= ' ' . __('Open the file \'header.php\' from your theme folder', 'acp'). ' ';
$field .= ' ' . __('Locate the opening body tag (it need to look like this: <body>)', 'acp'). ' ';
$field .= ' ' . __('Insert the next code right after the opening body tag (if you using also the toolbar please add this after the toolbar):', 'acp');
$field .= ' <?php if(function_exists(\'acp_skiplinks\') ) { acp_skiplinks(); }?> ';
$field .= ' ';
$field .= ' ';
$field .= '
';
$field .= ' options['enable_manual_skiplinks'] ), false ) . '>';
$field .= __('Enable the Skiplinks Manually', 'acp') . ' ';
$field .= '
';
$field .= '' . __('Skiplinks Manual Activation is not available because the Skiplink Auto Activation is active.', 'acp') . '
';
$field .= ' ';
printf(
$field,
isset( $this->options['enable_manual_skiplinks'] ) ? esc_attr( $this->options['enable_manual_skiplinks']) : ''
);
}
/*
* Activate the Skiplinks with ajax
*
* @type checkbox
* @id enable_ajax_skiplinks
* @since 2.1.1
*/
public function enable_ajax_skiplinks_callback() {
$field = '' . __('Skiplinks Auto Activation', 'acp') . ' ';
$field .= '';
$field .= '';
$field .= '
' . __('To activate the skiplinks automatically using Ajax call simply check the checkbox below.', 'acp') . '
';
$field .= '
';
$field .= ' options['enable_ajax_skiplinks'] ), false ) . '>';
$field .= __('Enable the Auto Skiplinks Activation', 'acp') . ' ';
$field .= '' . __('Skiplinks Auto Activation is not available because the Skiplink Manual Activation is active.', 'acp') . '
';
$field .= ' ';
printf(
$field,
isset( $this->options['enable_ajax_skiplinks'] ) ? esc_attr( $this->options['enable_ajax_skiplinks']) : ''
);
}
/*
* Skiplinks side
*
* @type checkbox
* @id skiplinks_side
* @since 2.1.1
*
* PRO ONLY
*/
public function skiplinks_side_callback() {
$left = ''; $right = '';
if( $this->options['skiplinks_side'] == 'left' )
$left = ' selected';
elseif( $this->options['skiplinks_side'] == 'right' )
$right = ' selected';
$field = '' . __('Customization', 'acp') . ' ';
$field .= '';
$field .= '' . __('Skiplinks Side', 'acp') . ' ';
$field .= ' ';
$field .= ' ' . __('Left', 'acp') . ' ';
$field .= ' ' . __('Right', 'acp') . ' ';
$field .= ' ';
$field .= ' ';
if( acp_proAvailable() )
$field .= '' . __('Want to change the style of the Skiplinks?') . ' ' . '' . __('Upgrade to PRO') . ' ' . __('and get the ability to choose from 3 different skins!') . '
';
printf(
$field,
isset( $this->options['skiplinks_side'] ) ? esc_attr( $this->options['skiplinks_side']) : ''
);
}
/*
* Activate the special Skiplinks for Home page
*
* @type checkbox
* @id skiplinks_home
* @since 2.0.1
*/
public function skiplinks_home_callback() {
$field = '' . __('Activate Special Skiplinks for Home Page', 'acp') . ' ';
$field .= '' . __('Customize special Skiplinks for Home page.', 'acp') . '
';
$field .= '';
$field .= ' options['skiplinks_home'] ), false ) . ' />';
$field .= __('Activate Home Page Skiplinks', 'acp');
$field .= ' ';
printf(
$field,
isset( $this->options['skiplinks_home'] ) ? esc_attr( $this->options['skiplinks_home']) : ''
);
}
/*
* Logo Identifer
*
* @type text
* @id logo_identifier
* @since 2.1.1
*/
public function logo_identifier_callback() {
$field = '' . __('Logo Semantics', 'acp') . ' ' . __('NEW', 'acp') . ' ';
$field .= '' . __('If the logo of your website is clickable and leads to the Home page, you should inform the user to where this link will lead him.', 'acp') . '
';
$field .= '' . __('The fields below will help you to add extra information on the logo link with the aria-label attribute:', 'acp') . '
';
$field .= '';
$field .= '
' . __('Write the Logo Identifier. for examplt: #site-logo .logo', 'acp') . ' ';
printf(
$field . '
',
isset( $this->options['logo_identifier'] ) ? esc_attr( $this->options['logo_identifier']) : ''
);
}
/*
* Logo Label
*
* @type text
* @id logo_identifier
* @since 2.1.1
*/
public function logo_directive_callback() {
$field = '
';
$field .= '' . __('Write the text that will guide the user. for examplt: This link leads to the home page', 'acp') . ' ';
printf(
$field . ' ',
isset( $this->options['logo_directive'] ) ? esc_attr( $this->options['logo_directive']) : ''
);
}
/*
* Change the Html tag of the given object to time
*
* @type text
* @id tag_replacement1
* @since 2.1.1
*/
public function tag_replacement1_callback() {
$fieldsetClasses = ( '' != $this->options['tag_replacement1'] || '' != $this->options['tag_replacement1_tag'] ) ? 'open' : '';
$field = '
' . __('Tag Replacement', 'acp') . ' ' . __('NEW', 'acp') . ' ';
$field .= '
' . __('In this section you can replace Html tags with a new tag and keep the attributes.', 'acp') . '
';
$field .= '
' . __('For example you can change this:', 'acp') . '
';
$field .= '
<div class="page-title">...</div>';
$field .= '
' . __('to this:', 'acp') . '
';
$field .= '
<h1 class="page-title">...</h1>';
$field .= '
' . __('To do this you need to declare the object(s) and than choose a new tag name from the dropdown list:', 'acp') . '
';
$field .= '
' . __('Add New Replacement Tag', 'acp') . ' (3 ) ';
$field .= '
';
$field .= 'X ';
$field .= '' . __('Add the objects you want to affect with the Replacement Tag 1', 'acp') . ' ';
$h1 = ''; $h2 = ''; $h3 = ''; $h4 = ''; $h5 = ''; $h6 = ''; $time = '';
if( 'h1' == $this->options['tag_replacement1_tag'] ) {
$h1 = ' selected';
}
elseif( 'h2' == $this->options['tag_replacement1_tag'] ) {
$h2 = ' selected';
}
elseif( 'h3' == $this->options['tag_replacement1_tag'] ) {
$h3 = ' selected';
}
elseif( 'h4' == $this->options['tag_replacement1_tag'] ) {
$h4 = ' selected';
}
elseif( 'h5' == $this->options['tag_replacement1_tag'] ) {
$h5 = ' selected';
}
elseif( 'h6' == $this->options['tag_replacement1_tag'] ) {
$h6 = ' selected';
}
elseif( 'time' == $this->options['tag_replacement1_tag'] ) {
$time = ' selected';
}
$dd = '';
$dd .= '' . __('Choose the Tag', 'acp') . ' ';
$dd .= '';
$dd .= ' ' . __('-- None --', 'acp') . ' ';
$dd .= ' ' . __('Heading 1 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 2 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 3 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 4 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 5 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 6 Tag', 'acp') . ' ';
$dd .= ' ' . __('Time Tag', 'acp') . ' ';
$dd .= ' ';
$dd .= ' ';
printf(
$field . '',
isset( $this->options['tag_replacement1'] ) ? esc_attr( $this->options['tag_replacement1']) : ''
);
printf(
$dd . ' ',
isset( $this->options['tag_replacement1_tag'] ) ? esc_attr( $this->options['tag_replacement1_tag']) : ''
);
}
/*
* Change the Html tag of the given object to time
*
* @type text
* @id tag_replacement2
* @since 2.1.1
*/
public function tag_replacement2_callback() {
$fieldsetClasses = ( '' != $this->options['tag_replacement2'] || '' != $this->options['tag_replacement2_tag'] ) ? 'open' : '';
$field = '
';
$field .= 'X ';
$field .= '' . __('Replacement Tag 2', 'acp') . ' ';
$h1 = ''; $h2 = ''; $h3 = ''; $h4 = ''; $h5 = ''; $h6 = ''; $time = '';
if( 'h1' == $this->options['tag_replacement2_tag'] ) {
$h1 = ' selected';
}
elseif( 'h2' == $this->options['tag_replacement2_tag'] ) {
$h2 = ' selected';
}
elseif( 'h3' == $this->options['tag_replacement2_tag'] ) {
$h3 = ' selected';
}
elseif( 'h4' == $this->options['tag_replacement2_tag'] ) {
$h4 = ' selected';
}
elseif( 'h5' == $this->options['tag_replacement2_tag'] ) {
$h5 = ' selected';
}
elseif( 'h6' == $this->options['tag_replacement2_tag'] ) {
$h6 = ' selected';
}
elseif( 'time' == $this->options['tag_replacement2_tag'] ) {
$time = ' selected';
}
$dd = '';
$dd .= '' . __('Choose the Tag', 'acp') . ' ';
$dd .= '';
$dd .= ' ' . __('-- None --', 'acp') . ' ';
$dd .= ' ' . __('Heading 1 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 2 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 3 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 4 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 5 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 6 Tag', 'acp') . ' ';
$dd .= ' ' . __('Time Tag', 'acp') . ' ';
$dd .= ' ';
$dd .= ' ';
printf(
$field . '',
isset( $this->options['tag_replacement2'] ) ? esc_attr( $this->options['tag_replacement2']) : ''
);
printf(
$dd . ' ',
isset( $this->options['tag_replacement2_tag'] ) ? esc_attr( $this->options['tag_replacement2_tag']) : ''
);
}
/*
* Change the Html tag of the given object to time
*
* @type text
* @id tag_replacement3
* @since 2.1.1
*/
public function tag_replacement3_callback() {
$fieldsetClasses = ( '' != $this->options['tag_replacement3'] || '' != $this->options['tag_replacement3_tag'] ) ? 'open' : '';
$field = '
';
$field .= 'X ';
$field .= '' . __('Replacement Tag 3', 'acp') . ' ';
$h1 = ''; $h2 = ''; $h3 = ''; $h4 = ''; $h5 = ''; $h6 = ''; $time = '';
if( 'h1' == $this->options['tag_replacement3_tag'] ) {
$h1 = ' selected';
}
elseif( 'h2' == $this->options['tag_replacement3_tag'] ) {
$h2 = ' selected';
}
elseif( 'h3' == $this->options['tag_replacement3_tag'] ) {
$h3 = ' selected';
}
elseif( 'h4' == $this->options['tag_replacement3_tag'] ) {
$h4 = ' selected';
}
elseif( 'h5' == $this->options['tag_replacement3_tag'] ) {
$h5 = ' selected';
}
elseif( 'h6' == $this->options['tag_replacement3_tag'] ) {
$h6 = ' selected';
}
elseif( 'time' == $this->options['tag_replacement3_tag'] ) {
$time = ' selected';
}
$dd = '';
$dd .= '' . __('Choose the Tag', 'acp') . ' ';
$dd .= '';
$dd .= ' ' . __('-- None --', 'acp') . ' ';
$dd .= ' ' . __('Heading 1 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 2 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 3 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 4 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 5 Tag', 'acp') . ' ';
$dd .= ' ' . __('Heading 6 Tag', 'acp') . ' ';
$dd .= ' ' . __('Time Tag', 'acp') . ' ';
$dd .= ' ';
$dd .= ' ';
if( acp_proAvailable() ) {
$afterField = '' . __('Need More than 3 replacement tags?', 'acp') . ' ';
$afterField .= '' . __('Want to have the ability to replace with any tag you want and with unlimited replacements?', 'acp') . ' ' . __('Upgrade to PRO', 'acp') . '
';
}
printf(
$field . '',
isset( $this->options['tag_replacement3'] ) ? esc_attr( $this->options['tag_replacement3']) : ''
);
printf(
$dd . ' ' . $afterField,
isset( $this->options['tag_replacement3_tag'] ) ? esc_attr( $this->options['tag_replacement3_tag']) : ''
);
}
/*
* Register administration scripts & styles
*/
function admin_assets($hook) {
wp_register_style( 'acp-admin-style', plugins_url('accessible-poetry/assets/css/acp-admin-style.css') );
wp_enqueue_style( 'acp-admin-style' );
wp_enqueue_script( 'acp-admin', plugins_url('accessible-poetry/assets/js/acp-admin.js') );
}
}
new Accessible_Poetry();