protected function _renderVarDisplay_captcha($form, &$var, &$vars)
{
static $captcha;
if (!isset($captcha)) {
$captcha = Text_CAPTCHA::factory('Image');
}
$image = $captcha->init(150, 60, $var->type->getText(), array('font_path' => dirname($var->type->getFont()) . '/', 'font_file' => basename($var->type->getFont())));
if (is_a($image, 'PEAR_Error')) {
return $image->getMessage();
}
$cid = md5($var->type->getText());
$cache = $GLOBALS['injector']->getInstance('Horde_Cache');
$cache->set($cid, serialize(array('data' => $captcha->getCAPTCHAAsJPEG(), 'ctype' => 'image/jpeg')));
$url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/cacheview.php')->add('cid', $cid);
return '<img src="' . $url . '" />';
}