You are here

function _better_messages_add_files in Better Messages 7.2

Helper function to add required files.

1 call to _better_messages_add_files()
theme_better_messages in ./better_messages.module
Theme function that switches default Drupal messages with Better Messages.

File

./better_messages.module, line 182

Code

function _better_messages_add_files() {
  $default_skin = variable_get('better_messages_default');
  $settings = _better_messages_get_settings($default_skin);
  drupal_add_css(drupal_get_path('module', 'better_messages') . '/skins/' . $settings['skin'] . '/skin.css');
  drupal_add_js(drupal_get_path('module', 'better_messages') . '/better_messages.js', array(
    'scope' => 'footer',
    'weight' => 10,
  ));

  // Add required jQuery UI Libraries.
  if ($settings['jquery_ui']['draggable']) {
    drupal_add_library('system', 'ui.draggable');
  }
  if (!empty($settings['animation']['popin']['easing']) || !empty($settings['animation']['popout']['easing'])) {
    drupal_add_library('system', 'effects');
  }

  // Remove administration settings from JavaScript settings.
  unset($settings['admin']);
  drupal_add_js(array(
    'betterMessages' => $settings,
  ), array(
    'type' => 'setting',
  ));
}