setAttributes(array('name' => $param_names['enabler'], 'class' => 'enabler')) ->setChecked($enabled); $this->addControlElement($checkbox); // The quantity element $input = new ElementInputNumber(); $attributes = array('name' => $param_names['quantity'], 'value' => $duration); if (isset($input_attributes)) { $attributes = array_merge($attributes, $input_attributes); } $input->setAttributes($attributes); $this->addControlElement($input); // The select element for the units $options = Form::getTimeUnitOptions(); $select = new ElementSelect(); $select->setAttribute('name', $param_names['units']) ->addSelectOptions($options, array_search($units, $options), true); $this->addControlElement($select); // The suffix if (isset($suffix)) { $span = new ElementSpan(); $span->setText($suffix); $this->addControlElement($span); } } }