diff --git a/apps/qubit/modules/settings/actions/dipUploadAction.class.php b/apps/qubit/modules/settings/actions/dipUploadAction.class.php index 9d166bee34..f062fdca30 100644 --- a/apps/qubit/modules/settings/actions/dipUploadAction.class.php +++ b/apps/qubit/modules/settings/actions/dipUploadAction.class.php @@ -39,7 +39,8 @@ protected function addField($name) { switch ($name) { case 'stripExtensions': - $this->form->setWidget($name, new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio'])); + $options = [$this->i18n->__('No'), $this->i18n->__('Yes')]; + $this->form->setWidget($name, new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio'])); $this->form->setValidator($name, new sfValidatorInteger(['required' => false])); break; diff --git a/apps/qubit/modules/settings/actions/markdownAction.class.php b/apps/qubit/modules/settings/actions/markdownAction.class.php index 793ae68b0d..62ca64d469 100644 --- a/apps/qubit/modules/settings/actions/markdownAction.class.php +++ b/apps/qubit/modules/settings/actions/markdownAction.class.php @@ -57,7 +57,8 @@ protected function addField($name) $this->form->setDefault($name, $default); $this->form->setValidator($name, new sfValidatorInteger(['required' => false])); - $this->form->setWidget($name, new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio'])); + $options = [$this->i18n->__('No'), $this->i18n->__('Yes')]; + $this->form->setWidget($name, new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio'])); break; } diff --git a/apps/qubit/modules/settings/actions/securityAction.class.php b/apps/qubit/modules/settings/actions/securityAction.class.php index c477545b5e..f401dc92b0 100644 --- a/apps/qubit/modules/settings/actions/securityAction.class.php +++ b/apps/qubit/modules/settings/actions/securityAction.class.php @@ -59,7 +59,8 @@ protected function addField($name) break; case 'require_ssl_admin': - $this->form->setWidget($name, new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio'])); + $options = [$this->i18n->__('No'), $this->i18n->__('Yes')]; + $this->form->setWidget($name, new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio'])); $this->form->setValidator($name, new sfValidatorInteger(['required' => false])); $labelText = $this->i18n->__('Require SSL for all administrator functionality'); $this->form->getWidgetSchema()->{$name}->setLabel($labelText); @@ -67,7 +68,8 @@ protected function addField($name) break; case 'require_strong_passwords': - $this->form->setWidget($name, new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio'])); + $options = [$this->i18n->__('No'), $this->i18n->__('Yes')]; + $this->form->setWidget($name, new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio'])); $this->form->setValidator($name, new sfValidatorInteger(['required' => false])); $labelText = $this->i18n->__('Require strong passwords'); $this->form->getWidgetSchema()->{$name}->setLabel($labelText); diff --git a/lib/form/SettingsGlobalForm.class.php b/lib/form/SettingsGlobalForm.class.php index 67a1019a33..126c577bec 100644 --- a/lib/form/SettingsGlobalForm.class.php +++ b/lib/form/SettingsGlobalForm.class.php @@ -30,29 +30,30 @@ class SettingsGlobalForm extends sfForm public function configure() { $this->i18n = sfContext::getInstance()->i18n; + $options = [$this->i18n->__('No'), $this->i18n->__('Yes')]; // Build widgets $this->setWidgets([ 'version' => new sfWidgetFormInput([], ['class' => 'disabled', 'disabled' => true]), - 'check_for_updates' => new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio']), + 'check_for_updates' => new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio']), 'hits_per_page' => new sfWidgetFormInput(), 'escape_queries' => new sfWidgetFormInput(), 'sort_browser_user' => new sfWidgetFormSelectRadio(['choices' => ['alphabetic' => $this->i18n->__('title/name'), 'lastUpdated' => $this->i18n->__('date modified'), 'identifier' => $this->i18n->__('identifier'), 'referenceCode' => $this->i18n->__('reference code')]], ['class' => 'radio']), 'sort_browser_anonymous' => new sfWidgetFormSelectRadio(['choices' => ['alphabetic' => $this->i18n->__('title/name'), 'lastUpdated' => $this->i18n->__('date modified'), 'identifier' => $this->i18n->__('identifier'), 'referenceCode' => $this->i18n->__('reference code')]], ['class' => 'radio']), 'default_repository_browse_view' => new sfWidgetFormSelectRadio(['choices' => ['card' => $this->i18n->__('card'), 'table' => $this->i18n->__('table')]], ['class' => 'radio']), 'default_archival_description_browse_view' => new sfWidgetFormSelectRadio(['choices' => ['card' => $this->i18n->__('card'), 'table' => $this->i18n->__('table')]], ['class' => 'radio']), - 'multi_repository' => new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio']), - 'enable_institutional_scoping' => new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio']), - 'audit_log_enabled' => new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio']), - 'show_tooltips' => new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio']), + 'multi_repository' => new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio']), + 'enable_institutional_scoping' => new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio']), + 'audit_log_enabled' => new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio']), + 'show_tooltips' => new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio']), 'slug_basis_informationobject' => $this->getSlugBasisInformationObjectWidget(), - 'permissive_slug_creation' => new sfWidgetFormSelectRadio(['choices' => [QubitSlug::SLUG_PERMISSIVE => 'yes', QubitSlug::SLUG_RESTRICTIVE => 'no']], ['class' => 'radio']), + 'permissive_slug_creation' => new sfWidgetFormSelectRadio(['choices' => [QubitSlug::SLUG_PERMISSIVE => $this->i18n->__('Yes'), QubitSlug::SLUG_RESTRICTIVE => $this->i18n->__('No')]], ['class' => 'radio']), 'defaultPubStatus' => new sfWidgetFormSelectRadio(['choices' => [QubitTerm::PUBLICATION_STATUS_DRAFT_ID => $this->i18n->__('Draft'), QubitTerm::PUBLICATION_STATUS_PUBLISHED_ID => $this->i18n->__('Published')]], ['class' => 'radio']), - 'draft_notification_enabled' => new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio']), + 'draft_notification_enabled' => new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio']), 'sword_deposit_dir' => new sfWidgetFormInput(), 'google_maps_api_key' => new sfWidgetFormInput(), - 'generate_reports_as_pub_user' => new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio']), - 'cache_xml_on_save' => new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio']), + 'generate_reports_as_pub_user' => new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio']), + 'cache_xml_on_save' => new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio']), ]); // Add labels diff --git a/lib/form/SettingsPermissionsCopyrightStatementForm.class.php b/lib/form/SettingsPermissionsCopyrightStatementForm.class.php index d472de203e..c159015f91 100644 --- a/lib/form/SettingsPermissionsCopyrightStatementForm.class.php +++ b/lib/form/SettingsPermissionsCopyrightStatementForm.class.php @@ -24,7 +24,10 @@ public function configure() $this->widgetSchema->setNameFormat('copyrightStatement[%s]'); $this->getValidatorSchema()->setOption('allow_extra_fields', true); - $this->setWidget('copyrightStatementEnabled', new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio'])); + $this->i18n = sfContext::getInstance()->i18n; + $options = [$this->i18n->__('No'), $this->i18n->__('Yes')]; + + $this->setWidget('copyrightStatementEnabled', new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio'])); $this->setValidator('copyrightStatementEnabled', new sfValidatorInteger(['required' => false])); $default = false; @@ -42,7 +45,7 @@ public function configure() $this->setDefault('copyrightStatement', $setting->getValue()); } - $this->setWidget('copyrightStatementApplyGlobally', new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio'])); + $this->setWidget('copyrightStatementApplyGlobally', new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio'])); $this->setValidator('copyrightStatementApplyGlobally', new sfValidatorInteger(['required' => false])); $default = false; diff --git a/lib/form/SettingsPermissionsPreservationSystemAccessStatementForm.class.php b/lib/form/SettingsPermissionsPreservationSystemAccessStatementForm.class.php index ca3c1dc456..a428906b7a 100644 --- a/lib/form/SettingsPermissionsPreservationSystemAccessStatementForm.class.php +++ b/lib/form/SettingsPermissionsPreservationSystemAccessStatementForm.class.php @@ -24,7 +24,10 @@ public function configure() $this->widgetSchema->setNameFormat('preservationSystemAccessStatement[%s]'); $this->getValidatorSchema()->setOption('allow_extra_fields', true); - $this->setWidget('preservationSystemAccessStatementEnabled', new sfWidgetFormSelectRadio(['choices' => [1 => 'yes', 0 => 'no']], ['class' => 'radio'])); + $this->i18n = sfContext::getInstance()->i18n; + $options = [$this->i18n->__('No'), $this->i18n->__('Yes')]; + + $this->setWidget('preservationSystemAccessStatementEnabled', new sfWidgetFormSelectRadio(['choices' => $options], ['class' => 'radio'])); $this->setValidator('preservationSystemAccessStatementEnabled', new sfValidatorInteger(['required' => false])); $default = false;