Check box with rounded edges.
Switches:
-C display check symbol
ONO::Lib::UI::Check->box( $id, $text, $sel, $switches );
returns: qq~<div id="ono_onoff_box_$id\_box" class="box_$color pad10_2 fl mr5 mb5 cursorlink noselect" onclick="onojs_onoff_box_toggle('$id');">$CONTENT</div> <input type="hidden" id="ono_onoff_box_$id\_id" name="ono_onoff_box_$id" value="$sel"> <input type="hidden" name="ono_onoff_box_$id\_text" value="$text"> ~
ONO checkbox. Also see switch(), which looks better and offers many more options.
Switches:
-C counter mode - uses 'ono_ui_checkbox_counter_$option' instead of
'${id}_id' as ID, which may render mutli-selection easier on some occasions
-d disable
-G green checkbox (on)
-R red checkbox (off)
ONO::Lib::UI::Check->checkbox( $id, $checked, $switches, $option );
returns: $CHK
ONO switch. Also see switches() and checkbox().
Switches:
-b border 2px
-B all Blue mode (opaque = on / transparent = off)
-c center
-C javascript: use $js as onChange
-d disabled (not clickable)
-D disabled, but not transparent
-G all Green mode (opaque = on / transparent = off)
-i invert (1 = off, 0 = on)
-I inline mode (make html wrap correctly)
-J javascript: use $js on click ON, $js2 on click OFF
-l left
-L use link instead of JS ($script_url required)
-m mini, also see -y
-M margin right 5px
-o use (NULL,on) instead of (0,1)
-O on/off style, looks a bit like a radio button
-r right
-R all Red mode (opaque = on / transparent = off)
-s make scriptable - adds js that allows to control the switch including $js and $js2 support,
you may also simply use onojs_ui_switch_on/off/toggle(id,opt) if $js and $js2 are not required, in this case -s is not required
-S adjust size by content + center content
-t margin top 2px (can be combined with -T)
-T margin top 5px (can be combined with -t)
-v vertical
-V use $string as value
-X display result as text input instead of hidden input (nice for debugging, devstation only)
-y micro, even smaller than -m
ONO::Lib::UI::Check->switch( $id, $selected, $switches, $string, $js, $js2 );
Generate a number of usable switches, while offering 2 select options:
1) check if $vars{$id} is set 2) check if $id is 'id:somevalue'
switches_switches can be used to transmit switches settings
ONO::Lib::UI::Check->switches( $vars_ref, @ids );
returns: %CHK