Fix for drupal_add_css not adding css

  1. function apb_zen_preprocess_page(&$vars, $hook) {
  2.   if (drupal_is_front_page()) {
  3.     drupal_add_js(path_to_theme() . '/apb_zen.js', 'theme');
  4.     $vars['scripts'] = drupal_get_js();
  5.   }
  6. $browser_ss = $_SERVER['HTTP_USER_AGENT']; // get the user agent data
  7. watchdog('content',$_SERVER['HTTP_USER_AGENT']); // log it to watchdog so that i know its in scope and what it is
  8. if(strpos($browser_ss, 'Mac')){ // does "Mac" appear any where in the agent data?
  9. drupal_add_css(path_to_theme() . '/maccff.css', 'theme', 'all'); // add the css file indicates
  10. watchdog('content','test');  // throw some test data into watchdog so that I know the conditional is true
  11.                                             }
  12.   }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.