/**
* Function to receive & pre-process javascript options
*
* @param mixed $options Associative array/Registry object with options
*
* @return Registry Options converted to Registry object
*/
private static function optionsToRegistry($options)
{
// Support options array
if (is_array($options)) {
$options = new Registry($options);
}
if (!$options instanceof Registry) {
$options = new Registry();
}
return $options;
}