You are here

function _jquery_calendar_component_path in jQuery World Calendars API 7

Helper function to build a library component path.

Parameters

$component: Library component name.

$compression: Compression level.

$extension: Component file extension.

$prefix: Component filename prefix.

Return value

Library component path.

1 call to _jquery_calendar_component_path()
jquery_calendar_add in ./jquery_calendar.module
API function to include specified jQuery Calendar library components while trying to take care of dups n' deps.

File

./jquery_calendar.module, line 349
Implements necessary hooks, API and helpers for jQuery World Calendars.

Code

function _jquery_calendar_component_path($component, $compression, $extension = 'js', $prefix = 'jquery.calendars') {
  $path = _jquery_calendar_path() . '/' . $prefix;

  // Fix compression level if required.
  $compression = $compression == 'normal' || empty($compression) || strpos($component, '-') !== FALSE ? '' : '.' . $compression;

  // Fix component name if required.
  if ($component[0] != '-') {
    $component = empty($component) || $component == 'base' ? '' : '.' . $component;
  }
  return $path . $component . $compression . '.' . $extension;
}