Jump to content

Recommended Posts

Posted

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.

post-1761-0-50888800-1416935808_thumb.jp

Posted
        $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

Posted

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.

Posted

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.

 

 

post-1761-0-89948500-1417017426_thumb.jp

 

 

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

Posted

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.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...