diff -u b/themekey_css/themekey_css.install b/themekey_css/themekey_css.install --- b/themekey_css/themekey_css.install +++ b/themekey_css/themekey_css.install @@ -39,6 +39,17 @@ } /** + * Implements hook_disable(). + * + * We should delete 'themekey_css_debug_css_files' when module is disabled + * because if 'themekey_css_debug_css_files' == TRUE but module was disabled + * there will be css debug message on a page. + */ +function themekey_css_disable() { + variable_del('themekey_css_debug_css_files'); +} + +/** * Implements hook_uninstall(). */ function themekey_css_uninstall() { diff -u b/themekey_css/themekey_css.module b/themekey_css/themekey_css.module --- b/themekey_css/themekey_css.module +++ b/themekey_css/themekey_css.module @@ -121,0 +122,14 @@ + +/** + * Implements hook_form_alter(). + * + * Add 'Show list of css files' option on debug settings form. + */ +function themekey_css_form_themekey_debug_settings_form_alter(array &$form, array &$form_state, $form_id) { + $form['themekey_debug']['themekey_css_debug_css_files'] = array( + '#type' => 'checkbox', + '#title' => t('Show list of css files'), + '#default_value' => variable_get('themekey_css_debug_css_files', FALSE), + '#description' => t('Prints out detailed information about css files added on a page. Useful to debug ThemeKey Css rules.'), + ); +} diff -u b/themekey_css/themekey_css_admin.inc b/themekey_css/themekey_css_admin.inc --- b/themekey_css/themekey_css_admin.inc +++ b/themekey_css/themekey_css_admin.inc @@ -32,11 +32,10 @@ 'CSS_SYSTEM' => 'system', ); - $css_weight_options = array(); - - for ($i = -50; $i <= 50; $i++) { - $css_weight_options[$i] = $i; - } + // range(-50, 50) returns array with keys from 0 to 100 + // but we need array with keys from -50 to 50 + // because keys will be values for select. + $css_weight_options = drupal_map_assoc(range(-50, 50)); return themekey_abstract_rule_chain_form($form, $form_state, array( 'load_rules_callback' => 'themekey_css_load_rules', diff -u b/themekey_debug.module b/themekey_debug.module --- b/themekey_debug.module +++ b/themekey_debug.module @@ -171,14 +171,9 @@ themekey_debug_properties(); } - if (variable_get('themekey_debug_show_css_files', FALSE)) { + if (variable_get('themekey_css_debug_css_files', FALSE)) { // add the list of css files to the end of debug messages. $list['title'] = t('Css files on a page'); - // drupal_get_css() returns html markup with "@import" statements combined in