You are here

function user_relationships_ui_init in User Relationships 6

Same name and namespace in other branches
  1. 7 user_relationships_ui/user_relationships_ui.module \user_relationships_ui_init()

Implementation of hook_init().

File

user_relationships_ui/user_relationships_ui.module, line 395
UI components of user_relationships @author Jeff Smick (creator) @author Alex Karshakevich (maintainer) http://drupal.org/user/183217 @author Darren Ferguson (contributor) http://drupal.org/user/70179

Code

function user_relationships_ui_init() {

  //do not enable ajax functions if set in admin/user/relationships/settings
  if (!variable_get('user_relationships_enable_ajax_popups', 1)) {
    return;
  }
  drupal_add_js(USER_RELATIONSHIPS_UI_PATH . '/user_relationships_ui.js');
  drupal_add_css(USER_RELATIONSHIPS_UI_PATH . '/user_relationships_ui.css');
  $settings['user_relationships_ui']['loadingimage'] = url(USER_RELATIONSHIPS_UI_PATH . '/images/loadingAnimation.gif', array(
    'language' => language_default(),
  ));
  $settings['user_relationships_ui']['savingimage'] = url(USER_RELATIONSHIPS_UI_PATH . '/images/savingimage.gif', array(
    'language' => language_default(),
  ));
  $settings['user_relationships_ui']['position'] = array(
    'position' => variable_get('user_relationships_position', 'absolute'),
    'left' => variable_get('user_relationships_left', '0'),
    'top' => variable_get('user_relationships_top', '0'),
  );
  drupal_add_js($settings, 'setting');
}