accessibility_widget-1.0.0/accessibility_widget.module

accessibility_widget.module
<?php

/**
 * @file
 * Accessibility Widget module for Drupal 10/11.
 * 
 * Provides BFSG-compliant accessibility features for your website.
 * All JavaScript is bundled - no external dependencies.
 */

use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_help().
 */
function accessibility_widget_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.accessibility_widget':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Accessibility Widget module provides a comprehensive accessibility toolbar for your Drupal site, helping you comply with the German Barrierefreiheitsstärkungsgesetz (BFSG) and international accessibility standards.') . '</p>';
      $output .= '<p><strong>' . t('This module includes all JavaScript bundled - no external requests are made.') . '</strong></p>';
      $output .= '<h3>' . t('Features') . '</h3>';
      $output .= '<ul>';
      $output .= '<li>' . t('Font size adjustment') . '</li>';
      $output .= '<li>' . t('Multiple contrast modes') . '</li>';
      $output .= '<li>' . t('Screen reader functionality') . '</li>';
      $output .= '<li>' . t('Voice navigation (German/English)') . '</li>';
      $output .= '<li>' . t('Reading guide and more') . '</li>';
      $output .= '</ul>';
      $output .= '<h3>' . t('Support') . '</h3>';
      $output .= '<p>' . t('For support, please contact: <a href="mailto:steven@schwerbehindert.org">steven@schwerbehindert.org</a>') . '</p>';
      return $output;

    default:
  }
}

/**
 * Implements hook_page_attachments().
 */
function accessibility_widget_page_attachments(array &$attachments) {
  // Only attach on non-admin pages
  if (!\Drupal::service('router.admin_context')->isAdminRoute()) {
    $attachments['#attached']['library'][] = 'accessibility_widget/accessibility-widget';
  }
}

/**
 * Implements hook_preprocess_html().
 */
function accessibility_widget_preprocess_html(&$variables) {
  // Add a class to body for potential CSS targeting
  $variables['attributes']['class'][] = 'has-accessibility-widget';
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc