You are here

function _jquery_calendar_datepicker_themes in jQuery World Calendars API 7

Internal helper to collect all datepicker themes.

Return value

An array of datepicker theme component names.

1 call to _jquery_calendar_datepicker_themes()
jquery_calendar_form_settings in ./jquery_calendar.admin.inc
Form callback for jQuery World Calendars administration.

File

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

Code

function _jquery_calendar_datepicker_themes() {
  $themes = array();
  $files = file_scan_directory(_jquery_calendar_path(), '/.css/', array(
    'key' => 'name',
    'recurse' => FALSE,
  ));
  foreach ($files as $key => $file) {

    // Exluclude jQuery UI themes, for now.
    if (drupal_substr($key, 0, 2) == 'ui') {
      continue;
    }

    // Loadup the array.
    $name = str_replace('.calendars.picker', '', $key);
    $themes[$name] = ucwords($name) . ' - ' . $file->name;
  }
  return $themes;
}