You are here

function improved_multi_select_init in Improved Multi Select 6

Implements hook_init().

File

./improved_multi_select.module, line 11
The improved_multi_select module main php code.

Code

function improved_multi_select_init() {
  $is_enabled = FALSE;
  if (variable_get('improved_multi_select:isall', 0)) {
    $is_enabled = TRUE;
  }
  else {
    $arg = arg();
    if (isset($arg[0]) and !($arg[0] == 'system' or $arg[0] == 'public')) {
      if ($url = variable_get('improved_multi_select:url', '')) {
        if (drupal_match_path($_GET['q'], $url)) {
          $is_enabled = TRUE;
        }
      }
    }
  }
  if ($is_enabled) {
    drupal_add_css(drupal_get_path('module', 'improved_multi_select') . '/improved_multi_select.css');
    drupal_add_js(drupal_get_path('module', 'improved_multi_select') . '/improved_multi_select.js');
  }
}