Framework  3.9
TableHeaderFormLayout Class Reference

Used for the header row in SpreadSheetAutoForm. More...

+ Inheritance diagram for TableHeaderFormLayout:
+ Collaboration diagram for TableHeaderFormLayout:

Public Member Functions

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

Used for the header row in SpreadSheetAutoForm.

Definition at line 318 of file auto_form_layout.inc.

Constructor & Destructor Documentation

◆ __construct()

TableHeaderFormLayout::__construct (   $form)

Reimplemented from AutoFormLayout.

Reimplemented in SelectableTableHeaderFormLayout.

Definition at line 320 of file auto_form_layout.inc.

321  {
322  parent::__construct($form);
323  }

Member Function Documentation

◆ endButtonLine()

TableHeaderFormLayout::endButtonLine ( )

Reimplemented from AutoFormLayout.

Definition at line 419 of file auto_form_layout.inc.

420  {
421  // nothing to do
422  }

◆ endField()

TableHeaderFormLayout::endField (   $field,
  $renderer 
)

Reimplemented from AutoFormLayout.

Definition at line 348 of file auto_form_layout.inc.

349  {
350  echo "</td>\n";
351  }

◆ endGroup()

TableHeaderFormLayout::endGroup ( )

Reimplemented from AutoFormLayout.

Definition at line 330 of file auto_form_layout.inc.

331  {
332  $this->endUngrouped();
333  }

◆ endUngrouped()

TableHeaderFormLayout::endUngrouped ( )

Reimplemented from AutoFormLayout.

Definition at line 409 of file auto_form_layout.inc.

410  {
411  echo "</tr>\n";
412  }

◆ errorBox()

TableHeaderFormLayout::errorBox ( )

Reimplemented from AutoFormLayout.

Definition at line 424 of file auto_form_layout.inc.

425  {
426  echo "<tr>\n <td colspan='{$this->form->parent->colCount}' id='{$this->form->id}__error' class='error' style='display: ".($this->form->msg ? 'table-cell' : 'none')."'>{$this->form->msg}</td></tr>\n";
427  }

◆ getLabel()

TableHeaderFormLayout::getLabel (   $field,
  $renderer,
  $addSuffix = true 
)

Reimplemented from AutoFormLayout.

Definition at line 382 of file auto_form_layout.inc.

383  {
384  $obj = $renderer->parent->getData();
385  $label = isset($renderer->label) ? $renderer->label : $renderer->parent->prettifyFieldName($field);
386 
387  if ($renderer->parent->markRequiredFields &&
388  $renderer->parent->isRequired($field))
389  {
390  $label .= "*";
391  }
392 
393  $label .= $renderer->labelSuffix;
394 
395  if ($renderer->parent->onFormatLabel)
396  {
397  $fn = $renderer->parent->onFormatLabel;
398  $label = $fn($renderer->parent, $field, $label);
399  }
400 
401  return $label;
402  }

◆ printLabel()

TableHeaderFormLayout::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 366 of file auto_form_layout.inc.

367  {
368  //if ($renderer->hideLabel && $renderer->colspan > 1 && !$annotation) return;
369 
370  $label = $this->getLabel($field, $renderer);
371 
372  echo "<th ";
373  if ($renderer->parent->labelCSS) echo " class='{$renderer->parent->labelCSS}'";
374  if ($styles) echo " style='$styles'";
375  echo ">";
376 
377  echo "<label id='".$this->getLabelID($field)."' for='$field'>$label</label> ";
378 
379  echo "$annotation</th>\n";
380  }
getLabel($field, $renderer, $addSuffix=true)

◆ requiredFields()

TableHeaderFormLayout::requiredFields (   $text)

Reimplemented from AutoFormLayout.

Definition at line 353 of file auto_form_layout.inc.

354  {
355  // empty - want displayed once at top not for every form in the spreadsheet
356  }

◆ startButtonLine()

TableHeaderFormLayout::startButtonLine ( )

Reimplemented from AutoFormLayout.

Definition at line 414 of file auto_form_layout.inc.

415  {
416  // nothing to do
417  }

◆ startField()

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

Reimplemented from AutoFormLayout.

Definition at line 336 of file auto_form_layout.inc.

337  {
338  echo "<td ";
339  if ($renderer->parent->valueCSS) echo " class='{$renderer->parent->valueCSS}'";
340  echo ">";
341 
342  if ($renderer->annotateBefore && $renderer->parent->annotations[$field] && $renderer->colspan == 1)
343  {
344  echo $renderer->parent->annotations[$field]."<br/>";
345  }
346  }

◆ startGroup()

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

Reimplemented from AutoFormLayout.

Definition at line 325 of file auto_form_layout.inc.

326  {
327  $this->startUngrouped();
328  }

◆ startUngrouped()

TableHeaderFormLayout::startUngrouped ( )

Reimplemented from AutoFormLayout.

Reimplemented in SelectableTableHeaderFormLayout.

Definition at line 404 of file auto_form_layout.inc.

405  {
406  echo "<tr id='{$this->form->id}_container' class='{$this->form->containerClass}'>\n";
407  }

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