add_to_head("<link rel='stylesheet' href='".DYNAMICS."assets/switch/switch.min.css'>");
add_to_head("<link rel='stylesheet' href='".DYNAMICS."assets/switch/switch.min.css'>");
add_to_head("<link rel='stylesheet' href='".DYNAMICS."assets/switch/switch.text.min.css'>");
$checkbox .= "<input id='".$options['input_id']."' style='margin:0;vertical-align:middle;' name='$input_name' value='".$options['value']."' type='".$options['type']."'".($options['deactivate'] ? ' disabled' : '').($options['onclick'] ? ' onclick="'.$options['onclick'].'"' : '').($input_value == $options['value'] ? ' checked' : '').">";
$checkbox .= "</div>";
}
$html = "<div id='".$options['input_id']."-field' class='".($options['toggle'] ? 'checkbox-switch ' : '')."form-group check-group ".($options['inline'] && $label ? 'row ' : '').(!empty($error_class) ? $error_class : '').($options['class'] ? ' '.$options['class'] : '')."'>";
$checkbox .= ($options['toggle'] ? "<label class='switch'>" : "")."<input id='".$options['input_id']."' style='margin:0;vertical-align:middle;' name='$input_name' value='".$options['value']."' type='".$options['type']."'".($options['deactivate'] ? ' disabled' : '').($options['onclick'] ? ' onclick="'.$options['onclick'].'"' : '').($input_value == $options['value'] ? ' checked' : '').">".($options['toggle'] ? "<div class='slider round'><span class='on'>".$options['toggle_text'][1]."</span><span class='off'>".$options['toggle_text'][0]."</span></div></label>" : "");
$checkbox .= "</div>";
}
// class='".($options['toggle'] ? 'checkbox-switch ' : '')."
$html = "<div id='".$options['input_id']."-field' class='form-group check-group ".($options['inline'] && $label ? 'row ' : '').(!empty($error_class) ? $error_class : '').($options['class'] ? ' '.$options['class'] : '')."'>";
toggle_text
was used in the old switch but is no longer needed, I will remove this option. I don't think it's necessary to have text here. It's just simple switch that you can see in every modern OS and it should be as simple as possible. However, I can add red / green colors, that's not a bad idea.Category Forum
Addons Open TestingLabels
Statistics
2 participants
Notifications
You are not receiving notifications from this thread.
Related Questions