summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhimerus2010-07-10 17:28:44 (GMT)
committer himerus2010-07-10 17:28:44 (GMT)
commit626ef85d7bfeb110b01edc296f11c3271a70687f (patch)
tree5d4300cb2ec740f8d5571a0765f59a1427503460
parent675104cace1273a4b4d8cd13cac4d7fadf5fbe55 (diff)
#850412 by himerus - allowing for all optional CSS files to be excluded from the base theme and sub-themes.6.x-1.0-beta10
-rw-r--r--omega.info13
-rwxr-xr-xstarterkit/omega_starterkit.info5
-rw-r--r--template.php19
-rw-r--r--theme-settings.php33
4 files changed, 62 insertions, 8 deletions
diff --git a/omega.info b/omega.info
index 1c50a96..4ba0884 100644
--- a/omega.info
+++ b/omega.info
@@ -5,13 +5,6 @@ core = 6.x
engine = phptemplate
screenshot = screenshot.png
-stylesheets[all][] = css/reset.css
-;stylesheets[all][] = css/960.css
-stylesheets[all][] = css/text.css
-stylesheets[all][] = css/regions.css
-stylesheets[all][] = css/defaults.css
-stylesheets[all][] = css/custom.css
-
scripts[] = js/omega.js
regions[sidebar_first] = sidebar first
@@ -50,6 +43,12 @@ features[] = secondary_links
; Set the default settings to be used in theme-settings.php
; Non-960gs default settings
+settings[reset_css] = 1
+settings[text_css] = 1
+settings[regions_css] = 1
+settings[defaults_css] = 1
+settings[custom_css] = 1
+
settings[front_page_title_display] = title_slogan
settings[page_title_display_custom] = ''
settings[other_page_title_display] = ptitle_stitle
diff --git a/starterkit/omega_starterkit.info b/starterkit/omega_starterkit.info
index 677534d..334f699 100755
--- a/starterkit/omega_starterkit.info
+++ b/starterkit/omega_starterkit.info
@@ -56,6 +56,11 @@ features[] = secondary_links
; ------- Set the default settings to be used in theme-settings.php
; ------- Non-960gs general settings
+settings[reset_css] = 1
+settings[text_css] = 1
+settings[regions_css] = 1
+settings[defaults_css] = 1
+settings[custom_css] = 1
settings[front_page_title_display] = title_slogan
settings[page_title_display_custom] = ''
diff --git a/template.php b/template.php
index f712bb8..c9444b2 100644
--- a/template.php
+++ b/template.php
@@ -46,6 +46,7 @@ function omega_preprocess(&$vars, $hook) {
* The default functionality can be found in preprocess/preprocess-page.inc
*/
function omega_preprocess_page(&$vars, $hook) {
+ // Prepare 960gs CSS. Fixed width is default, fluid is optional via theme-settings
if(theme_get_setting('omega_fixed_fluid') == 'fluid') {
$css_960 = drupal_get_path('theme', 'omega') .'/css/960-fluid.css';
}
@@ -53,6 +54,24 @@ function omega_preprocess_page(&$vars, $hook) {
$css_960 = drupal_get_path('theme', 'omega') .'/css/960.css';
}
drupal_add_css($css_960, 'theme', 'all');
+
+ // enable/disable optional CSS files
+ if (theme_get_setting('reset_css') == '1') {
+ drupal_add_css(drupal_get_path('theme', 'omega') .'/css/reset.css', 'theme', 'all');
+ }
+ if (theme_get_setting('text_css') == '1') {
+ drupal_add_css(drupal_get_path('theme', 'omega') .'/css/text.css', 'theme', 'all');
+ }
+ if (theme_get_setting('regions_css') == '1') {
+ drupal_add_css(drupal_get_path('theme', 'omega') .'/css/regions.css', 'theme', 'all');
+ }
+ if (theme_get_setting('defaults_css') == '1') {
+ drupal_add_css(drupal_get_path('theme', 'omega') .'/css/defaults.css', 'theme', 'all');
+ }
+ if (theme_get_setting('custom_css') == '1') {
+ drupal_add_css(drupal_get_path('theme', 'omega') .'/css/custom.css', 'theme', 'all');
+ }
+ // redeclare $styles
$vars['styles'] = drupal_get_css();
} // end preprocess_page
function omega_preprocess_node(&$vars, $hook) {
diff --git a/theme-settings.php b/theme-settings.php
index f26340b..4d17f49 100644
--- a/theme-settings.php
+++ b/theme-settings.php
@@ -58,7 +58,38 @@ function omega_settings($saved_settings, $subtheme_defaults = array()) {
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
-
+ $form['omega_container']['omega_general']['optional_css'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Optional CSS Files'),
+ '#description' => t('Here, you may disable default theme CSS provided by the Omega base theme.'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+ $form['omega_container']['omega_general']['optional_css']['reset_css'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Enable reset.css'),
+ '#default_value' => $saved_settings['reset_css'],
+ );
+ $form['omega_container']['omega_general']['optional_css']['text_css'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Enable text.css'),
+ '#default_value' => $saved_settings['text_css'],
+ );
+ $form['omega_container']['omega_general']['optional_css']['regions_css'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Enable regions.css'),
+ '#default_value' => $saved_settings['regions_css'],
+ );
+ $form['omega_container']['omega_general']['optional_css']['defaults_css'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Enable defaults.css'),
+ '#default_value' => $saved_settings['defaults_css'],
+ );
+ $form['omega_container']['omega_general']['optional_css']['custom_css'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Enable custom.css'),
+ '#default_value' => $saved_settings['custom_css'],
+ );
// Page titles
$form['omega_container']['omega_general']['page_format_titles'] = array(
'#type' => 'fieldset',