public function embed()
{
/* First, determine the type of view we are asking for */
$class = 'Ansel_View_EmbeddedRenderer_' . basename($this->vars->get('gallery_view', 'Mini'));
if (!class_exists($class)) {
throw new Ansel_Exception(sprintf("Class definition for %s not found.", $class));
}
$params = array();
foreach ($this->vars as $key => $value) {
$params[$key] = $value;
}
try {
$view = new $class($params);
return new Horde_Core_Ajax_Response_Raw($view->html(), 'text/javascript');
} catch (Exception $e) {
}
}