'All Tests', 'section508' => 'Section 508', 'wcag1a' => 'WCAG 1.0 A', 'wcag1aa' => 'WCAG 1.0 AA', 'wcag1aaa' => 'WCAG 1.0 AAA', 'wcag2a' => 'WCAG 2.0 A', 'wcag2aa' => 'WCAG 2.0 AA', 'wcag2aaa' => 'WCAG 2.0 AAA', ); } /** * Accessibility admin options page. This is where the admin sets the guideline * to use for the site, as well as the severity levels to cover during testing. */ function accessible_helper_options() { if ( $_GET['test'] ) { include( 'test_settings.php' ); return null; } if ( function_exists('current_user_can') && !current_user_can( 'manage_options' ) ) { wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); } if ( isset($_POST['submit']) ) { update_option( 'accessibility_guideline', $_POST['guideline'] ); update_option( 'accessibility_severity', $_POST['severity'] ); } $severity = get_option( 'accessibility_severity' ); ?>
Accessibility information will be available once this post is saved.
'; return null; } foreach( accessible_helper_get_severity() as $severity => $label ) { $total = get_post_meta( $post->ID, '_accessibility_'. $severity, true ); if ( $total ) { echo ''. $label .': '. $total .'
'; } } echo 'View More Information | '; echo 'View Highlighted Info
'; } /** * Includes the QUAIL library */ function accessible_helper_include_library() { if ( !file_exists(ABSPATH .'wp-content/plugins/accessible_helper/quail/quail/quail.php') ) { return $data; } return include_once(ABSPATH .'wp-content/plugins/accessible_helper/quail/quail/quail.php'); } /** * The overview page that helps users see accessibility problems with a given page or post. * We switch between includes based on the 'type' URL parameter. */ function accessible_helper_overview_page() { accessible_helper_include_library(); switch( $_GET['type'] ) { case 'overview': include('overview.php'); break; case 'highlight': include('highlight.php'); break; case 'test': include('test.php'); break; default; include('overview.php'); } } /** * Retrieves the translated or user-prepared error codes about a test. * @param string The test class name from QUAIL */ function accessible_helper_get_test( $test ) { if ( !$test_info = get_option('accessibility_test_'. $test) ) { $translations = fopen(ABSPATH .'wp-content/plugins/accessible_helper/quail/quail/guidelines/translations/en.txt', 'r'); if ($translations ) { while ( $translation = fgetcsv($translations) ) { if ( count($translation) == 4 && $translation[0] == $test ) { $test_info['title'] = $translation[1]; $test_info['body'] = $translation[2]; return $test_info; } } } } return $test_info; }