mitsos Posted November 25, 2014 Report Posted November 25, 2014 I just have another question that I can't seem to figure out on my own. I need to convert the cpanel's module admin add service page to the screenshot shown. Imagine the textfields being replaced by the checkboxes, so that everything is in a single line (row). So the line should be a textfield for the domain, and a couple (or more) checkboxes with a label attached to them. I can't manage to attach the label to the checkboxes though. Moving further to the right, there will be a button to add another domain and configure it using the same fields for it too, depending on the number of domains allowed in the service's template. Responses in plain english are appreciated (ie dumb the response down). Thanks in advance. Quote
ModulesBakery Posted November 25, 2014 Report Posted November 25, 2014 $fields = new ModuleFields(); $my_label = $fields->label("My Field Label", "my_field_id"); // Create a field label displayed next to the checkbox $field_label = $fields->label("My Value", "my_field_my_value_id"); // Create and attach the field to the label, set as checked (3rd param) if necessary $my_label->attach($fields->fieldCheckbox("my_field_name", "my_value", (isset($vars->my_field_name) && $vars->my_field_name == "my_value"), array('id' => "my_field_my_value_id"), $field_label)); // Attach a tooltip to the label $my_label->attach($fields->tooltip("This is my tooltip")); $fields->setField($my_label); More info: http://docs.blesta.com/display/dev/ModuleFields Quote
mitsos Posted November 26, 2014 Author Report Posted November 26, 2014 Nope, still can't get it to work as expected. The label is attached to the right of the checkbox, class=inline. I'm either incredibly stupid, or this is an incredibly complex way to code. Quote
mitsos Posted November 26, 2014 Author Report Posted November 26, 2014 This is what I'm trying to do. Now if some could explain how to set the class to those specific <li>s, it would be much appreciated. EDIT: no, changing the .css isn't the answer I'm looking for. I don't want to change every pad's lis, just this specific module's lis Quote
mitsos Posted November 26, 2014 Author Report Posted November 26, 2014 Managed to do what I was trying to do by injecting a small php snippet in admin_clients_addservice_basic.pdt that checks if the module is my module, then sets the appropriate inline style for the lis. On to the next roadblock. Blesta Addons 1 Quote
Blesta Addons Posted November 27, 2014 Report Posted November 27, 2014 maybe you will have probleme in upgrade . use my css toolbox plugin to not re-doing the same work in every upgrade . Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.