Merge pull request #4008 from Al2Klimov/bugfix/checkbox-required
Form: allow checkboxes to be required
This commit is contained in:
commit
9c2f6f4fd7
|
@ -33,7 +33,6 @@ class ApplicationConfigForm extends Form
|
|||
'checkbox',
|
||||
'global_show_stacktraces',
|
||||
array(
|
||||
'required' => true,
|
||||
'value' => true,
|
||||
'label' => $this->translate('Show Stacktraces'),
|
||||
'description' => $this->translate(
|
||||
|
@ -47,7 +46,6 @@ class ApplicationConfigForm extends Form
|
|||
'checkbox',
|
||||
'global_show_application_state_messages',
|
||||
array(
|
||||
'required' => true,
|
||||
'value' => true,
|
||||
'label' => $this->translate('Show Application State Messages'),
|
||||
'description' => $this->translate(
|
||||
|
|
|
@ -243,6 +243,7 @@ class ResourceConfigForm extends ConfigForm
|
|||
'force_creation',
|
||||
array(
|
||||
'order' => 0,
|
||||
'required' => true,
|
||||
'ignore' => true,
|
||||
'label' => $this->translate('Force Changes'),
|
||||
'description' => $this->translate('Check this box to enforce changes without connectivity validation')
|
||||
|
|
|
@ -19,7 +19,6 @@ class UserForm extends RepositoryForm
|
|||
'checkbox',
|
||||
'is_active',
|
||||
array(
|
||||
'required' => true,
|
||||
'value' => true,
|
||||
'label' => $this->translate('Active'),
|
||||
'description' => $this->translate('Prevents the user from logging in if unchecked')
|
||||
|
|
|
@ -255,7 +255,6 @@ class PreferenceForm extends Form
|
|||
'checkbox',
|
||||
'show_stacktraces',
|
||||
array(
|
||||
'required' => true,
|
||||
'value' => $this->getDefaultShowStacktraces(),
|
||||
'label' => $this->translate('Show Stacktraces'),
|
||||
'description' => $this->translate('Set whether to show an exception\'s stacktrace.')
|
||||
|
@ -267,7 +266,6 @@ class PreferenceForm extends Form
|
|||
'checkbox',
|
||||
'show_benchmark',
|
||||
array(
|
||||
'required' => true,
|
||||
'label' => $this->translate('Use benchmark')
|
||||
)
|
||||
);
|
||||
|
|
|
@ -1015,7 +1015,7 @@ class Form extends Zend_Form
|
|||
*/
|
||||
public function ensureElementAccessibility(Zend_Form_Element $element)
|
||||
{
|
||||
if ($element->isRequired() && strpos(strtolower($element->getType()), 'checkbox') === false) {
|
||||
if ($element->isRequired()) {
|
||||
$element->setAttrib('aria-required', 'true'); // ARIA
|
||||
$element->setAttrib('required', ''); // HTML5
|
||||
if (($cue = $this->getRequiredCue()) !== null && ($label = $element->getDecorator('label')) !== false) {
|
||||
|
|
|
@ -175,7 +175,6 @@ class BackendConfigForm extends ConfigForm
|
|||
'checkbox',
|
||||
'disabled',
|
||||
array(
|
||||
'required' => true,
|
||||
'label' => $this->translate('Disable This Backend')
|
||||
)
|
||||
);
|
||||
|
|
|
@ -375,6 +375,7 @@ class TransportConfigForm extends ConfigForm
|
|||
'force_creation',
|
||||
array(
|
||||
'order' => 0,
|
||||
'required' => true,
|
||||
'ignore' => true,
|
||||
'label' => $this->translate('Force Changes'),
|
||||
'description' => $this->translate(
|
||||
|
|
|
@ -33,7 +33,6 @@ class ModulePage extends Form
|
|||
'checkbox',
|
||||
$module->getName(),
|
||||
array(
|
||||
'required' => true,
|
||||
'description' => $module->getDescription(),
|
||||
'label' => ucfirst($module->getName()),
|
||||
'value' => $module->getName() === 'monitoring' ? 1 : 0,
|
||||
|
|
Loading…
Reference in New Issue