You are here

function jquery_calendar_convert_file_name_to_library_name in jQuery World Calendars API 3.x

Parameters

$name:

Return value

array|bool

File

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

Code

function jquery_calendar_convert_file_name_to_library_name($name) {
  $result = FALSE;
  if (preg_match('%jquery\\.calendars(\\.([a-z]+))?(\\.([a-z]+))?(-([a-z\\-]+))?(.min)?\\.js$%i', $name, $matches)) {
    $result = [
      'libraryName' => NULL,
      'component' => NULL,
      'type' => NULL,
      'lang' => NULL,
      'minified' => NULL,
    ];
    $part1 = $matches[1];
    if ($part1 !== 'lang' && $part1 !== 'min' && $part1 !== 'picker' && $part1 !== 'all' && $part1 !== 'validation' && $part1 !== 'plus') {
      $result['component'] = 'type';
      $result['type'] = $part1;
    }
  }
  return $result;
}