While overriding the presentation of the action element, I had to use a phptemplate function to strip out some of the inline styles that were being added in the $form. It'd be nice to have these divs built with classes and ids instead and put the CSS definitions in a css file. This wold make it easier to update some styles and opens the door for more options when a theme developer is trying to select various divs.

This small patch creates a css file and adds it in hook_menu. I also removed some of the inline style in views_bulk_operations_form(). The css definitions are pretty general, and might need to be adjusted depending on whether you have anything more planned here. The big thing I'm not sure about is that I floated any .form-items under #views-bulk-operations-form, but you might want to use the #views_bulk_operations_action div that I wrapped around the action div.

Note that I also wrapped the 'Enable or disable allowed operations' link in a div with the id "allowed_operations_link".

Needs review.

CommentFileSizeAuthor
vbo_css.patch2.83 KBseanbfuller

Comments

infojunkie’s picture

Assigned: Unassigned » infojunkie
Category: support » feature
Status: Needs review » Fixed

Excellent initiative. Thanks.
I just moved the drupal_add_css() call to hook_init(), which seems to be where other modules place it.

seanbfuller’s picture

Glad it was useful. The only thing I noticed was that my previous css declaration for the submit button resulted in some bad margins on the confirm and cancel buttons on the confirmation screen. I added a:

#views-bulk-operations-form div .container-inline .form-submit {
  margin: 0;
}

to override the previous declaration for the other "Execute" button. Something to consider going forward.

infojunkie’s picture

Thanks for following up on this. I fixed the CSS and module to only apply the styles to the desired elements.

Anonymous’s picture

Status: Fixed » Closed (fixed)