File modules/template_engine/components/html/component_fieldset/FieldsetComponent.class.php
Last commit: Tue Dec 1 00:07:39 2020 +0100 Jan Dankert New: Visibility-Button for password fields, fix: QR-code button for mobile devices.
1 <?php 2 3 namespace template_engine\components\html\component_fieldset; 4 5 use template_engine\components\html\Component; 6 use template_engine\element\CMSElement; 7 use template_engine\element\HtmlElement; 8 use template_engine\element\Value; 9 use template_engine\element\ValueExpression; 10 11 12 /** 13 * A fieldset contains a label (rendered as a 'legend') and a value. 14 * The value contains all elements of the subcomponents. 15 * 16 * @author Jan Dankert 17 */ 18 class FieldsetComponent extends Component 19 { 20 public $label; 21 public $qrcode; 22 23 /** 24 * Creates all elements for a fieldset. 25 * 26 * @return CMSElement 27 */ 28 public function createElement() 29 { 30 $fieldset = (new CMSElement('section'))->addStyleClass('fieldset'); 31 32 // it is not possible to use 'legend' here, because 'legend' cannot be a flex element (in FF 80). 33 // A headline should semanically correct. 34 $label = (new HtmlElement('h3'))->addStyleClass('fieldset-label')->asChildOf($fieldset); 35 36 if ( $this->label ) 37 $label->content( $this->label ); 38 39 $value = (new HtmlElement('div'))->addStyleClass('fieldset-value')->asChildOf($fieldset); 40 41 $this->adoptiveElement = $value; 42 /* 43 $action = (new HtmlElement('div'))->addStyleClass('fieldset-action')->asChildOf($fieldset); 44 $action->addChild( 45 (new CMSElement('i')) 46 ->addStyleClass('image-icon') 47 ->addStyleClass('image-icon--menu-qrcode') 48 ->addStyleClass('qrcode') 49 ->addStyleClass('info') 50 ->addAttribute('data-qrcode', $this->qrcode) 51 ->addAttribute('title', Value::createExpression(ValueExpression::TYPE_MESSAGE, 'QRCODE_SHOW')) 52 ); 53 */ 54 return $fieldset; 55 } 56 }
Downloadmodules/template_engine/components/html/component_fieldset/FieldsetComponent.class.php
History Tue, 1 Dec 2020 00:07:39 +0100 Jan Dankert New: Visibility-Button for password fields, fix: QR-code button for mobile devices. Sun, 18 Oct 2020 01:30:49 +0200 Jan Dankert New component "fieldset" for better form layout. Sat, 17 Oct 2020 22:24:58 +0200 Jan Dankert Fix: XSD must contain all subelements per element; New: Component 'fieldset'.