You are here

protected function HostingForm::makeFieldsetsIntoRadios in Aegir Objects 7.3

File

classes/HostingForm.inc, line 144
The HostingForm class.

Class

HostingForm
@file The HostingForm class.

Code

protected function makeFieldsetsIntoRadios($radio, $fieldsets) {
  foreach ($fieldsets as $fieldset => $label) {
    $this->form[$radio][$this
      ->language()]['#options'][$fieldset] = $label;
    $this->form[$fieldset]['#title'] = $label;
    $this->form[$fieldset]['#collapsible'] = FALSE;
    $this->form[$fieldset]['#weight'] = 10;
    $this->form[$fieldset]['#states'] = [
      'visible' => [
        ':input[name="' . $radio . '[' . $this
          ->language() . ']"]' => [
          'value' => $fieldset,
        ],
      ],
    ];
  }
}