Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Form checkbox text mod

Asked Modified Viewed 1,114 times
M
MathiasHU
M
https://fusion.bltfm.hu/
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
  • Answered 1 question
asked
Junior Member

Checkbox contains a toggle_text option but is not used.
With this change the toogle checkbox will display a set of text.

To use the fullpage, rename the form_checkbox_text() function in the form_checkbox_text.php file to form_checkbox(), rename the form_checkbox() function in the form_checkbox.php file to form_checkbox_pause(), or delete the core of the form_checkbox.php.


Modify core file

Editing
/includes/dynamics/includes/form_checkbox.php

Look for this
add_to_head("<link rel='stylesheet' href='".DYNAMICS."assets/switch/switch.min.css'>");


Change
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'>");


Look for this
$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'] : '')."'>";


Change
$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'] : '')."'>";
Edited by MathiasHU on 23-12-2021 00:17,
MathiasHU attached the following files:
bltfmhu_checkbox_text_mod_100.zip [No information available / 60 Downloads]
MathiasHU attached the following image:
Image not found Image not found
0 replies

2 posts

R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

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.


And big thumbs up for you, finally someone from the community who wants to help improve this cms. You have good ideas.

Many people hate this cms, but they have no idea that for the last 2 years or so mostly I worked on this. It is not easy to maintain such a complex system.
0 replies
M
MathiasHU
M
https://fusion.bltfm.hu/
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
  • Answered 1 question
answered
Junior Member

Thank you, bigger thumbs up for you.
Color is also good.
0 replies

Category Forum

Addons Open Testing

Statistics

  • Views 0 views
  • Posts 2 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

R
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
M
M
https://fusion.bltfm.hu/
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
  • Answered 1 question

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet