You are here

function panopoly_core_pre_render_styles in Panopoly Core 7

Pre render the styles element.

1 string reference to 'panopoly_core_pre_render_styles'
panopoly_core_element_info_alter in ./panopoly_core.module
Implementation hook_element_info_alter().

File

./panopoly_core.module, line 227

Code

function panopoly_core_pre_render_styles($elements) {
  $css =& $elements['#items'];

  // We only need to mess with the CSS if a jQuery UI theme is loaded.
  if (!isset($css['misc/ui/jquery.ui.theme.css'])) {
    return $elements;
  }
  $seven_theme = drupal_get_path('theme', 'seven') . '/jquery.ui.theme.css';

  // Always override the Seven theme's jQuery UI theme (because its for an
  // earlier version of jQuery UI and doesn't quite work right).
  if ($css['misc/ui/jquery.ui.theme.css']['data'] === $seven_theme || variable_get('panopoly_core_override_jquery_ui_theme', 1)) {
    $css['misc/ui/jquery.ui.theme.css']['data'] = drupal_get_path('module', 'panopoly_core') . '/css/panopoly-jquery-ui-theme.css';
  }
  return $elements;
}