1 views_ui.admin.inc | views_ui_get_admin_css() |
Create an array of Views admin CSS for adding or attaching.
This returns an array of arrays. Each array represents a single file. The array format is:
- file: The fully qualified name of the file to send to backdrop_add_css
- options: An array of options to pass to backdrop_add_css.
File
- core/
modules/ views_ui/ views_ui.admin.inc, line 15 - Admin page callbacks for the Views UI module.
Code
function views_ui_get_admin_css() {
$module_path = backdrop_get_path('module', 'views_ui');
$list = array();
$list[$module_path . '/css/views_ui.admin.css'] = array();
$list[$module_path . '/css/views_ui.admin.theme.css'] = array();
// Add in any theme specific CSS files we have
$themes = list_themes();
$theme_key = $GLOBALS['theme'];
while ($theme_key) {
// Try to find the admin css file for non-core themes.
$theme_path = backdrop_get_path('theme', $theme_key);
// First search in the css directory, then in the root folder of the theme.
if (file_exists($theme_path . "/css/views-admin.$theme_key.css")) {
$list[$theme_path . "/css/views-admin.$theme_key.css"] = array(
'group' => CSS_THEME,
);
}
elseif (file_exists($theme_path . "/views-admin.$theme_key.css")) {
$list[$theme_path . "/views-admin.$theme_key.css"] = array(
'group' => CSS_THEME,
);
}
$theme_key = isset($themes[$theme_key]->base_theme) ? $themes[$theme_key]->base_theme : '';
}
return $list;
}