form->getAttributes(), '>'; $this->form->getError()->render(); $elements = $this->form->getElements(); $elementCount = 0; $inButtonGroup = false; foreach($elements as $element) { if($element instanceof Element_Hidden || $element instanceof Element_HTMLExternal) { $element->render(); } elseif($element instanceof Element_Button) { if (!$inButtonGroup) { echo '
'; $inButtonGroup = true; } $element->render(); } else { if ($inButtonGroup) { echo '
'; $inButtonGroup = false; } if ($element instanceof AccuaForm_Element_FieldsetBegin || $element instanceof AccuaForm_Element_FieldsetEnd) { $element->render(); } else { echo '
getWrapperCssId(); if(!empty($_wrapperId)) { echo ' id="', esc_attr($_wrapperId), '"'; } echo '>', $element->getPreHTML(); // Render inline label differently based on element type if ($element instanceof Element_HTML) { $this->renderLabel($element); $element->render(); } else { $this->renderInlineLabelWrapper($element); } echo $element->getPostHTML(), '
'; ++$elementCount; } } } if ($inButtonGroup) { echo ''; $inButtonGroup = false; } echo ''; } /** * Render the inline label wrapper with floating label support * * This creates the structure needed for Material Design floating labels: * - Wrapper div with relative positioning * - Label positioned absolutely * - Field rendered normally * - Proper ARIA attributes for accessibility */ protected function renderInlineLabelWrapper($element) { $label = $element->getLabel(); $id = $element->getID(); $description = $element->getDescription(); $required = $element->isRequired(); // Determine if this element should use inline floating labels // Checkboxes, radios, file inputs, colorpickers, and captchas use standard layout $useInlineLabel = !($element instanceof Element_Checkbox || $element instanceof AccuaForm_Element_Checkbox || $element instanceof Element_Radio || $element instanceof AccuaForm_Element_Radio || $element instanceof Element_File || $element instanceof AccuaForm_Element_File || $element instanceof AccuaForm_Element_ColorPicker || $element instanceof AccuaForm_Element_Captcha2 || $element instanceof AccuaForm_Element_Turnstile || $element instanceof AccuaForm_Element_Cap); if ($useInlineLabel && !empty($label)) { echo '
'; // Render the input field first echo '
'; $element->render(); echo '
'; // Render the floating label with ARIA support echo ''; // Render description below the field if(!empty($description)) { echo '
', $description, '
'; } // Render inline error $this->renderInlineError($element); echo '
'; } else { // Fall back to standard rendering for checkboxes, radios, file inputs $this->renderLabel($element); echo '
'; $element->render(); echo '
'; $this->renderInlineError($element); } } /** * Standard label rendering for elements that don't support floating labels * (checkboxes, radios, file inputs) */ protected function renderLabel($element) { $label = $element->getLabel(); $id = $element->getID(); $description = $element->getDescription(); if(!empty($label) || !empty($description)) { echo '
'; if(!empty($label)) { echo ''; } if(!empty($description)) echo '', $description, ''; echo '
'; } } public function renderCSS() { // For inline label view, we don't want PFBC to add width styles // The CSS in frontend.css handles all widths with width: 100% // So we don't generate any width-based CSS here // (empty implementation overrides parent's width CSS generation) } public function jQueryDocumentReady() { // Override parent to prevent jQuery width manipulation // The inline label view uses pure CSS for width control (width: 100%) // PFBC's default jQueryDocumentReady() converts CSS width to inline styles // which breaks our flexible layout } }