You are here

function better_messages_add_files in Better Messages 6

Same name and namespace in other branches
  1. 6.2 better_messages.module \better_messages_add_files()
  2. 7 better_messages.module \better_messages_add_files()
1 call to better_messages_add_files()
theme_better_messages in ./better_messages.module

File

./better_messages.module, line 157

Code

function better_messages_add_files($disable_autoclose) {
  $settings = better_messages_get_settings();
  drupal_add_css(drupal_get_path('module', 'better_messages') . '/skins/default/better_messages.css');
  drupal_add_js(drupal_get_path('module', 'better_messages') . '/better_messages.js');

  // Remove extra info from JS
  if (!module_exists('jquery_ui')) {
    unset($settings['jquery_ui']);
  }
  else {
    foreach ($settings['jquery_ui'] as $jquery_ui_setting => $value) {
      if ($value == 1) {
        jquery_ui_add(array(
          'ui.' . $jquery_ui_setting,
        ));
      }
    }
  }
  unset($settings['extra']);
  if ($disable_autoclose) {
    $settings['autoclose'] = 0;
  }
  drupal_add_js(array(
    'betterMessages' => $settings,
  ), 'setting');
}