e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 214 forks source link

FR - allow for admin area set size of switch button #4803

Open Jimmi08 opened 2 years ago

Jimmi08 commented 2 years ago

Motivation

Why are you making this feature request?

image

Proposed Solution

Change hardcoded size from small to parameter from admin UI

_function radioswitch

from

        if(deftrue('e_ADMIN_AREA'))
        {
         $options['switch'] = 'small';
        }

to (just working stuff, your way of coding is preferred)

        if(deftrue('e_ADMIN_AREA'))
        {
            $options['switch'] = ($options['switch']) ? $options['switch'] : 'small';    
        }

Alternatives

Working example:

            'sensitivity'           => array (  'title' => LAN_GC_COOKIE_SENSITIVITY,  'type' => 'boolean',  'data' => 'int',  'width' => 'auto',  'batch' => 'value',  
             'inline' => 'true',  'help' => '',  'readParms' =>  array (), 
            'help' => LAN_GC_COOKIE_SENSITIVITY_HELP ,
            'writeParms' =>  array ('enabled'=>'necessary', 'disabled'=>'non-necessary', 'switch'=> 'normal'),  'class' => 'left',  'thclass' => 'left',),

Additional Context

Maybe the "size" parameter would be enough but values for the switch are different than for text field

More info: https://stackoverflow.com/questions/24865579/bootstrap-switch-how-to-show-large-label-text/24867926#24867926

Thanks

Jimmi08 commented 5 days ago

Quick fix:

$code = ' .bootstrap-switch-handle-on {white-space: nowrap!important;} ';
e107::css('inline', $code);

Solved for me.