Right now views provide custom admin css files for garland, seven, and bartik.

This would be a great feature for any theme to be able to implement.

Patch to be attached soon.

Comments

merlinofchaos’s picture

Any theme should already be able to implement it.

ericduran’s picture

Patch attached.

This allows any theme to declare a css/views-admin.theme_name.css file and views will load that.

The current behavior is almost the same, except views uses the wrong path for any theme thats not included in the views module.

ericduran’s picture

Oh, being that views is trying to do this for any theme, yet it gets the wrong path, this might be a bug report instead of a feature request, but I'll let the maintainers be the judge of that. :-)

ericduran’s picture

@merlinofchaos, I didn't see your comment before attaching the patch. If thats the case then this is probably a bug report.

ericduran’s picture

Category: bug » feature

[double post]

ericduran’s picture

Category: feature » bug
ericduran’s picture

Category: feature » bug

I'm not entirely sure how to fix the problem, without hard-coding which theme views support. But here's some more details.

<?php
    // This is how views adds all the css for other themes.
    $list[$module_path . "/css/views-admin.$theme_key.css"] = array(
      'group' => CSS_THEME,
    );
    // $module_path is always set to  drupal_get_path('module', 'views_ui');
?>

So what ends up happening when testing with Rubik for example views call drupal_add_css for these files:

sites/all/modules/views/css/views-admin.rubik.css
sites/all/modules/views/css/views-admin.tao.css (rubik base theme)

Note: If you decide to test this, you will need to modified rubik to correct the filename, and place it in the right directory.

merlinofchaos’s picture

Perform a file_exists() on that file. If it does not exist, instead do a drupal_add_css using the path for the theme. And, hm. Optionally the 'css' directory. It is unfortunately difficult to discover css files in any ol' directory in a theme.

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new1.33 KB

I think this two places are enought. Here is a patch which does it.

dawehner’s picture

Status: Needs review » Fixed

Commited to 7.x-3.x, because the code looks fine.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.