' . htmlspecialchars($text, ENT_QUOTES, 'UTF-8') . ''; } /** * Create accessible navigation with full ARIA support * * @param array $menu Menu structure * @param array $options Navigation options * @return string Accessible navigation HTML */ public static function createAccessibleNavigation($menu, $options = []) { $id = $options['id'] ?? 'main-navigation'; $label = $options['aria-label'] ?? 'Hoofdmenu'; $orientation = $options['orientation'] ?? 'horizontal'; $html = ''; return $html; } /** * Create navigation item with ARIA support * * @param array $item Menu item * @param int $index Item index * @return string Navigation item HTML */ private static function createNavigationItem($item, $index) { $hasChildren = isset($item['children']) && !empty($item['children']); $itemId = 'nav-item-' . $index; if ($hasChildren) { $html = '
  • '; $html .= ''; foreach ($item['children'] as $childIndex => $child) { $html .= self::createNavigationItem($child, $index . '-' . $childIndex); } $html .= '
  • '; } else { $html = '
  • '; $html .= ' $field) { $html .= self::createFormField($field, $index); } $html .= ''; return $html; } /** * Create accessible form field with full ARIA support * * @param array $field Field configuration * @param int $index Field index * @return string Form field HTML */ private static function createFormField($field, $index) { $id = $field['id'] ?? 'field-' . $index; $type = $field['type'] ?? 'text'; $label = $field['label'] ?? 'Veld ' . ($index + 1); $required = $field['required'] ?? false; $help = $field['help'] ?? ''; $error = $field['error'] ?? ''; $html = '
    '; // Label with required indicator $html .= ''; // Input with ARIA attributes $inputAttributes = [ 'type="' . $type . '"', 'id="' . $id . '"', 'name="' . htmlspecialchars($field['name'] ?? $id, ENT_QUOTES, 'UTF-8') . '"', 'class="form-control"', 'tabindex="0"', 'aria-describedby="' . $id . '-help' . ($error ? ' ' . $id . '-error' : '') . '"', 'aria-required="' . ($required ? 'true' : 'false') . '"' ]; if ($error) { $inputAttributes[] = 'aria-invalid="true"'; $inputAttributes[] = 'aria-errormessage="' . $id . '-error"'; } if (isset($field['placeholder'])) { $inputAttributes[] = 'placeholder="' . htmlspecialchars($field['placeholder'], ENT_QUOTES, 'UTF-8') . '"'; } $html .= ''; // Help text if ($help) { $html .= '
    '; $html .= htmlspecialchars($help, ENT_QUOTES, 'UTF-8'); $html .= '
    '; } // Error message if ($error) { $html .= ''; } $html .= '
    '; return $html; } /** * Create accessible search form * * @param array $options Search options * @return string Accessible search form HTML */ public static function createAccessibleSearch($options = []) { $id = $options['id'] ?? 'search-form'; $placeholder = $options['placeholder'] ?? 'Zoeken...'; $buttonText = $options['button-text'] ?? 'Zoeken'; $label = $options['aria-label'] ?? 'Zoeken op de website'; $html = ''; return $html; } /** * Create accessible breadcrumb navigation * * @param array $breadcrumbs Breadcrumb items * @param array $options Breadcrumb options * @return string Accessible breadcrumb HTML */ public static function createAccessibleBreadcrumb($breadcrumbs, $options = []) { $label = $options['aria-label'] ?? 'Broodkruimelnavigatie'; $html = '
    '; return $html; } /** * Create accessible skip links * * @param array $targets Skip targets * @return string Skip links HTML */ public static function createSkipLinks($targets = []) { $defaultTargets = [ ['id' => 'main-content', 'text' => 'Skip to main content'], ['id' => 'navigation', 'text' => 'Skip to navigation'], ['id' => 'search', 'text' => 'Skip to search'] ]; $targets = array_merge($defaultTargets, $targets); $html = '