You are here

function _jquery_calendar_input_to_array in jQuery World Calendars API 7

Internal helper to convert a mixed-formatted input to an array.

Parameters

Unlimited input parameters.:

Return value

An array of input arrays.

1 call to _jquery_calendar_input_to_array()
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 464
Implements necessary hooks, API and helpers for jQuery World Calendars.

Code

function _jquery_calendar_input_to_array() {
  $arrays = array();
  $args = func_get_args();
  foreach ($args as $arg) {
    if (is_array($arg)) {
      $arg = array_map('trim', $arg);
    }
    else {
      $arg = strpos($arg, ',') !== FALSE ? array_map('trim', explode(',', $arg)) : array(
        trim($arg),
      );
    }
    $arrays[] = array_filter($arg);
  }
  return $arrays;
}