Commit a4a5bcc2 authored by Kristina Hoeppner's avatar Kristina Hoeppner

Change default for switchbox to Yes/No (Bug #1506625)

The majority of our options have action words
and thus the "Yes/No" combination works better.

behatnotneeded

Change-Id: Idfff35b18a6799dd98342931169bdf7f624a9157
parent 9f12c31f
......@@ -43,9 +43,6 @@ if (!$opensslext || !$curlext || !$xmlrpcext) {
$openssl = OpenSslRepo::singleton();
$yesno = array(true => get_string('yes'),
false => get_string('no'));
$networkingform = pieform(
array(
'name' => 'networkingform',
......@@ -83,7 +80,6 @@ $networkingform = pieform(
'title' => get_string('enablenetworking','admin'),
'description' => get_string('enablenetworkingdescription','admin'),
'defaultvalue' => get_config('enablenetworking'),
'options' => $yesno,
),
'promiscuousmode' => array(
'type' => 'switchbox',
......@@ -91,7 +87,6 @@ $networkingform = pieform(
'title' => get_string('promiscuousmode','admin'),
'description' => get_string('promiscuousmodedescription','admin'),
'defaultvalue' => get_config('promiscuousmode'),
'options' => $yesno,
),
'submitbuttons' => array(
'type' => 'fieldset',
......
......@@ -27,9 +27,6 @@ $langoptions = get_languages();
$themeoptions = get_all_themes();
unset($themeoptions['custom']); // Only available for institution configurable themes
$yesno = array(true => get_string('yes'),
false => get_string('no'));
$searchpluginoptions = get_search_plugins();
$countries = getoptions_country();
......
......@@ -392,7 +392,6 @@ if ($institution || $add) {
);
$elements['deletelogo'] = array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('deletelogo', 'admin'),
'description' => get_string('deletelogodescription1', 'admin'),
);
......
......@@ -99,21 +99,18 @@ $form = array(
),
'forcepasswordchange' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('forceuserstochangepassword', 'admin'),
'description' => get_string('forceuserstochangepassworddescription', 'admin'),
'defaultvalue' => true,
),
'emailusers' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('emailusersaboutnewaccount', 'admin'),
'description' => get_string('emailusersaboutnewaccountdescription', 'admin'),
'defaultvalue' => true,
),
'updateusers' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('updateusers', 'admin'),
'description' => get_string('updateusersdescription', 'admin'),
'defaultvalue' => false,
......
......@@ -507,7 +507,6 @@ class ArtefactTypeTask extends ArtefactType {
),
'completed' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'defaultvalue' => null,
'title' => get_string('completed', 'artefact.plans'),
'description' => get_string('completeddesc', 'artefact.plans'),
......
......@@ -146,7 +146,6 @@ class PluginAuthBrowserid extends PluginAuth {
),
'weautocreateusers' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('weautocreateusers', 'auth'),
'defaultvalue' => self::$default_config['weautocreateusers'],
'help' => true
......
......@@ -1768,14 +1768,12 @@ class PluginAuthLdap extends PluginAuth {
),
'updateuserinfoonlogin' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('updateuserinfoonlogin', 'auth.ldap'),
'defaultvalue' => self::$default_config['updateuserinfoonlogin'],
'help' => true,
),
'weautocreateusers' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('weautocreateusers', 'auth.ldap'),
'defaultvalue' => self::$default_config['weautocreateusers'],
'help' => true,
......@@ -1916,14 +1914,12 @@ class PluginAuthLdap extends PluginAuth {
),
'syncgroupsmemberattributeisdn' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('syncgroupsmemberattributeisdn', 'auth.ldap'),
'help' => true,
'defaultvalue' => self::$default_config['syncgroupsmemberattributeisdn'],
),
'syncgroupsnestedgroups' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('syncgroupsnestedgroups', 'auth.ldap'),
'help' => true,
'defaultvalue' => self::$default_config['syncgroupsnestedgroups'],
......@@ -1949,7 +1945,6 @@ class PluginAuthLdap extends PluginAuth {
),
'syncgroupsbyuserfield' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('syncgroupsbyuserfield', 'auth.ldap'),
'help' => true,
'defaultvalue' => self::$default_config['syncgroupsbyuserfield'],
......
......@@ -403,7 +403,6 @@ class PluginAuthSaml extends PluginAuth {
),
'institutionregex' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('institutionregex', 'auth.saml'),
'defaultvalue' => self::$default_config['institutionregex'],
'help' => true,
......@@ -419,14 +418,12 @@ class PluginAuthSaml extends PluginAuth {
),
'remoteuser' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('remoteuser', 'auth.saml'),
'defaultvalue' => self::$default_config['remoteuser'],
'help' => true,
),
'loginlink' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('loginlink', 'auth.saml'),
'defaultvalue' => self::$default_config['loginlink'],
'disabled' => (self::$default_config['remoteuser'] ? false : true),
......@@ -434,14 +431,12 @@ class PluginAuthSaml extends PluginAuth {
),
'updateuserinfoonlogin' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('updateuserinfoonlogin', 'auth.saml'),
'defaultvalue' => self::$default_config['updateuserinfoonlogin'],
'help' => true,
),
'weautocreateusers' => array(
'type' => 'switchbox',
'switchtext' => 'yesno',
'title' => get_string('weautocreateusers', 'auth.saml'),
'defaultvalue' => self::$default_config['weautocreateusers'],
'help' => true,
......
......@@ -57,21 +57,21 @@ function pieform_element_switchbox(Pieform $form, $element) {
function pieform_element_switchbox_labeltext($element){
// Dealing with the label text
$type = isset($element['switchtext']) ? $element['switchtext'] : 'onoff';
$type = isset($element['switchtext']) ? $element['switchtext'] : '';
switch ($type) {
case 'truefalse':
$on = 'true';
$off = 'false';
break;
case 'yesno':
$on = 'yes';
$off = 'no';
break;
default:
case 'onoff':
$on = 'on';
$off = 'off';
break;
default:
$on = 'yes';
$off = 'no';
break;
}
return array(
......
......@@ -1006,8 +1006,6 @@ function get_config_options_extended() {
// certificate values from MNet
$openssl = OpenSslRepo::singleton();
$yesno = array(true => get_string('yes'),
false => get_string('no'));
$elements = array(
// fieldset of master switch
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment