You are here

function advagg_js_cdn_get_jquery_ui_filename in Advanced CSS/JS Aggregation 7

Get the path for the jquery-ui.js file.

Parameters

string $file: filename.

1 call to advagg_js_cdn_get_jquery_ui_filename()
advagg_js_cdn_advagg_js_pre_alter in advagg_js_cdn/advagg_js_cdn.module
Implements hook_advagg_js_pre_alter().

File

advagg_js_cdn/advagg_js_cdn.module, line 128
Advanced aggregation js cdn library module.

Code

function advagg_js_cdn_get_jquery_ui_filename($file = 'jquery-ui') {
  $jquery_ui_path_const = 'JQUERY_UI_PATH';
  if (!defined($jquery_ui_path_const)) {
    if (!function_exists('jquery_ui_get_path')) {
      return FALSE;
    }
    $jquery_ui_path = jquery_ui_get_path();
    if ($jquery_ui_path === FALSE) {
      return FALSE;
    }
  }
  else {
    $jquery_ui_path = constant($jquery_ui_path_const);
  }
  $jquery_ui_path .= '/ui';
  $compression = variable_get('jquery_update_compression_type', 'mini');
  switch ($compression) {
    case 'none':
      $file_path = "{$file}.js";
      break;
    case 'pack':
      $file_path = "packed/{$file}.packed.js";
      break;
    case 'mini':
    default:
      $file_path = "minified/{$file}.min.js";
      break;
  }
  $js_path = $jquery_ui_path . '/' . $file_path;
  return $js_path;
}