silverstripe-framework/Forms/PrintableTransformation_TabSet.php
Damian Mooyman 8dd644d25d
API Namespace all classes
Namespace all templates
Move difflib and BBCodeParser2 to thirdparty
Remove deprecated API marked for removal in 4.0
2016-09-08 10:23:17 +12:00

34 lines
590 B
PHP

<?php
namespace SilverStripe\Forms;
/**
* Class representing printable tabsets
*/
class PrintableTransformation_TabSet extends TabSet
{
/**
* @param array $tabs
*/
public function __construct($tabs)
{
$this->children = $tabs;
CompositeField::__construct($tabs);
}
public function FieldHolder($properties = array())
{
// This gives us support for sub-tabs.
$tag = ($this->tabSet) ? "h2>" : "h1>";
$retVal = '';
foreach ($this->children as $tab) {
$retVal .= "<$tag" . $tab->Title() . "</$tag\n";
$retVal .= $tab->FieldHolder();
}
return $retVal;
}
}