Framework  3.9
MobileFormLayout Class Reference

MobileFormLayout provides a linear form layout suitable for mobile devices. More...

+ Inheritance diagram for MobileFormLayout:
+ Collaboration diagram for MobileFormLayout:

Public Member Functions

 __construct ($form)
 
 startGroup ($name, $collapsible=false, $collapsed=false)
 
 endGroup ()
 
 startField ($field, $renderer, $colspan=1, $styles="")
 
 endField ($field, $renderer)
 
 printLabel ($field, $renderer, $styles="", $annotation="")
 Internal method to generate the HTML for the field label. More...
 
 startUngrouped ()
 
 endUngrouped ()
 
 startButtonLine ()
 
 endButtonLine ()
 
 errorBox ()
 
 requiredFields ($text)
 
- Public Member Functions inherited from AutoFormLayout
 getGroupClass ($name, $collapsible, $collapsed, $additionalClass="")
 
 getLabel ($field, $renderer, $addSuffix=true)
 
 getLabelID ($field)
 
 finalizeLayout ()
 

Additional Inherited Members

- Static Public Member Functions inherited from AutoFormLayout
static create ($type, $form)
 
- Public Attributes inherited from AutoFormLayout
 $form
 
 $externalErrorBox = false
 Flag indicating whether the error box should be rendered inside the form grouping. More...
 

Detailed Description

MobileFormLayout provides a linear form layout suitable for mobile devices.

Definition at line 642 of file auto_form_layout.inc.

Constructor & Destructor Documentation

◆ __construct()

MobileFormLayout::__construct (   $form)

Reimplemented from AutoFormLayout.

Reimplemented in MobileUngroupedFormLayout.

Definition at line 644 of file auto_form_layout.inc.

645  {
646  parent::__construct($form);
647  }

Member Function Documentation

◆ endButtonLine()

MobileFormLayout::endButtonLine ( )

Reimplemented from AutoFormLayout.

Definition at line 760 of file auto_form_layout.inc.

761  {
762  echo "</div><br/>";
763  }

◆ endField()

MobileFormLayout::endField (   $field,
  $renderer 
)

Reimplemented from AutoFormLayout.

Definition at line 697 of file auto_form_layout.inc.

698  {
699  if ($renderer->parent->showAnnotations && !$renderer->annotateBefore && $renderer->parent->annotations[$field])
700  {
701  if ($renderer->annotateNextLine)
702  {
703  echo "<br/>";
704  }
705  else
706  {
707  echo "&nbsp;&nbsp;";
708  }
709  echo $renderer->parent->annotations[$field];
710  }
711 
712  echo "</div>\n";
713  }

◆ endGroup()

MobileFormLayout::endGroup ( )

Reimplemented from AutoFormLayout.

Reimplemented in MobileUngroupedFormLayout.

Definition at line 667 of file auto_form_layout.inc.

668  {
669  $this->endUngrouped();
670  $name = $this->groupName;
671 
672  $desc = $this->form->getGroupDescription($name, "end");
673  if ($desc)
674  {
675  $id = $this->form->id . "_" . codify($name) . "_group";
676  echo "<div id='{$id}_description' class='{$this->form->groupDescriptionCSS}'>{$desc}</div>";
677  }
678 
679  unset($this->groupName);
680  echo "</fieldset>";
681  }
codify($name)
Takes a text string and converts it into a code-compliant format, suitable for use as a variable name...
Definition: functions.inc:1399

◆ endUngrouped()

MobileFormLayout::endUngrouped ( )

Reimplemented from AutoFormLayout.

Definition at line 750 of file auto_form_layout.inc.

751  {
752  echo "</div>";
753  }

◆ errorBox()

MobileFormLayout::errorBox ( )

Reimplemented from AutoFormLayout.

Definition at line 765 of file auto_form_layout.inc.

766  {
767  echo "<div id='{$this->form->id}__error' class='error' style='display: ".($this->form->msg ? 'table-cell' : 'none')."'>{$this->form->msg}</div>\n";
768  }

◆ printLabel()

MobileFormLayout::printLabel (   $field,
  $renderer,
  $styles = "",
  $annotation = "" 
)

Internal method to generate the HTML for the field label.

Parameters
string$fieldthe field name
int$colspanthe number of columns to span
string$stylesoptional special styles that need to be applied
string$annotationannotation text for the field

Reimplemented from AutoFormLayout.

Definition at line 723 of file auto_form_layout.inc.

724  {
725  $colspan = $renderer->colspan;
726  if ($renderer->hideLabel && !$annotation) return;
727 
728  $label = $this->getLabel($field, $renderer);
729 
730  if (!$renderer->hideLabel)
731  {
732  echo "<label id='".$this->getLabelID($field)."' for='$field'";
733  if ($renderer->parent->labelCSS) echo " class='{$renderer->parent->labelCSS}'";
734  if ($styles) echo " style='$styles'";
735 
736  echo ">$label</label> ";
737  }
738 
739  echo "$annotation\n";
740  }
getLabel($field, $renderer, $addSuffix=true)

◆ requiredFields()

MobileFormLayout::requiredFields (   $text)

Reimplemented from AutoFormLayout.

Definition at line 770 of file auto_form_layout.inc.

771  {
772  echo "<p class='required_text'>{$text}</p>\n";
773  }

◆ startButtonLine()

MobileFormLayout::startButtonLine ( )

Reimplemented from AutoFormLayout.

Definition at line 755 of file auto_form_layout.inc.

756  {
757  echo " <div class='{$this->form->buttonLineCSS}' style='text-align: {$this->form->buttonAlignment}'><br/>";
758  }

◆ startField()

MobileFormLayout::startField (   $field,
  $renderer,
  $colspan = 1,
  $styles = "" 
)

Reimplemented from AutoFormLayout.

Definition at line 683 of file auto_form_layout.inc.

684  {
685  echo "<div class='field {$renderer->parent->id}_{$field}_field'>\n";
686 
687  $this->printLabel($field, $renderer, $styles, $this->parent->annotations[$field]);
688 
689  if (!$renderer->hideLabel) echo "<br/>\n";
690 
691  if ($renderer->parent->showAnnotations && $renderer->annotateBefore && $renderer->parent->annotations[$field])
692  {
693  echo $renderer->parent->annotations[$field]."<br/>";
694  }
695  }
printLabel($field, $renderer, $styles="", $annotation="")
Internal method to generate the HTML for the field label.

◆ startGroup()

MobileFormLayout::startGroup (   $name,
  $collapsible = false,
  $collapsed = false 
)

Reimplemented from AutoFormLayout.

Reimplemented in MobileUngroupedFormLayout.

Definition at line 649 of file auto_form_layout.inc.

650  {
651  $class = $this->getGroupClass($name, $collapsible, $collapsed);
652 
653  $id = $this->form->id . "_" . codify($name) . "_group";
654 
655  echo "<fieldset id='$id'$class><legend>$name</legend>";
656 
657  $desc = $this->form->getGroupDescription($name, "start");
658  if ($desc)
659  {
660  echo "<div id='{$id}_description' class='{$this->form->groupDescriptionCSS}'>{$desc}</div>";
661  }
662  $this->groupName = $name;
663 
664  $this->startUngrouped();
665  }
getGroupClass($name, $collapsible, $collapsed, $additionalClass="")

◆ startUngrouped()

MobileFormLayout::startUngrouped ( )

Reimplemented from AutoFormLayout.

Definition at line 742 of file auto_form_layout.inc.

743  {
744  echo "<div";
745  if ($this->form->formCSS) echo " class='{$this->form->formCSS}'";
746  if ($this->form->style) echo " style='{$this->form->style}'";
747  echo ">\n";
748  }

The documentation for this class was generated from the following file: