Commit 4b1be46a authored by kiz_0987's avatar kiz_0987

#59789 - Changed css import to use theme_add_style(). This may need to be updated

 again once the correct methods to import module css files has been documented
 (see http://drupal.org/node/60096).
 - The css file is now not included twice on gallery pages (is correctly loaded
   after Gallery2's theme.css file and so can override)
 - This *removes* the functionality to use a theme specific drupal_g2.css file.
   There have got to be better ways to override module css files.
 - css improvements to not hide h2's in G2 Admin pages
 - Removed DOS line endings from gallery_filter.inc
parent 43f9c3c1
......@@ -19,6 +19,11 @@
display: none;
}
/* Brings h2 back for siteAdmin pages */
#siteAdminForm .gbBlock h2 {
display: block;
}
/* Do not display the breadcrumb */
#gsNavBar div.gbBreadCrumb {
display: none;
......
......@@ -27,8 +27,10 @@ function gallery_menu($may_cache) {
'type' => MENU_LOCAL_TASK,
);
} else {
// Add head info here so that it is included once only per page (almost)
gallery_set_html_head(gallery_css_include());
// Add head info here so that it is included once only per page
// May need modification once the merits/issues of theme_add_style are fully known
// See http://drupal.org/node/60096
theme_add_style(drupal_get_path('module', 'gallery') .'/drupal_g2.css');
}
return $items;
}
......@@ -212,9 +214,6 @@ function gallery_page() {
gallery_set_html_head(implode("\n", $javascript));
}
gallery_set_html_head(implode("\n", $css));
// Add Gallery head. FIX - this will be included twice on a gallery page. Has to be
// included here as it is after the G2 .css files and so can override them.
gallery_set_html_head(gallery_css_include(), false);
drupal_set_title($title);
// Add pathbar. See http://gallery.menalto.com/node/33447
if (isset($result['themeData'])) {
......
......@@ -98,24 +98,6 @@ function _gallery_init($full = false, $vars = null) {
return array(true, null);
}
/**
* Include css files as needed
*/
function gallery_css_include($css_file = 'drupal_g2.css') {
/* The theme may not exist, so neither does path_to_theme(), so need to init */
global $theme;
if ($theme === NULL) {
$theme = init_theme();
}
$output = theme('stylesheet_import', base_path() . drupal_get_path('module', 'gallery') .
'/' . $css_file,'screen') ."\n";
$themecss = path_to_theme() .'/' . $css_file;
if (file_exists($themecss)) {
$output .= theme('stylesheet_import', base_path() . $themecss,'screen') . "\n";
}
return $output;
}
/**
* Include head information with check made for uniqueness (see drupal_add_js)
*/
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment