Due to larger dimensions of styled buttons compared to regular system buttons, styled buttons more than often look wrong in complex forms (Views, Panels, etc.). This patch disables styled buttons for all paths below 'admin/', but at the same time adds a hidden variable to disable this behavior.

Comments

mpaler’s picture

works as described.

+1 to include in module.

wojtha’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.02 KB
new9.7 KB
new7.03 KB

Thanks, patch is working for the admin pages under admin/* path ... BUT there is a setting which allows use admin theme on the node add/edit page. With patch from @smk-ka I still have conflict between Rootcandy and Button style on the Node edit/add page.

I suggest to change the condition to this:

// taken from system_init()
$is_admin_path = (arg(0) == 'admin' || (variable_get('node_admin_theme', '0') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit')));
if (variable_get('button_style_ignore_admin', 1) && $is_admin_path) {
 ... etc
}

Patch attached.

robloach’s picture

I think #559712: Button Style on a per-theme basis might be a better solution. I want the button looks on the administration pages if I'm on a different theme than Root Candy.

wojtha’s picture

@Rob Loach, agree, your patch is better, I was too lazy to make it this way ;-)

sun’s picture

Status: Reviewed & tested by the community » Needs review

While this patch itself works, it breaks the design/layout of a theme on administrative pages. If I'm not mistaken, then this patch was not in relation to a separate admin theme originally. Instead, I think that a custom button style did not look nice on some highly custom administrative forms (like Views UI, Panels).

In the end, it would probably better to implement support for http://drupal.org/project/form, so you can disable button style for certain forms.