本文整理汇总了PHP中Ansel类的典型用法代码示例。如果您正苦于以下问题:PHP Ansel类的具体用法?PHP Ansel怎么用?PHP Ansel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Ansel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getOtherGalleries
/**
* Build the HTML for the other galleries widget content.
*
* @param Horde_View $view The view object.
*/
protected function _getOtherGalleries(&$view)
{
$owner = $this->_view->gallery->get('owner');
// Set up the tree
$tree = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Tree')->create('otherAnselGalleries_' . md5($owner), 'Javascript', array('class' => 'anselWidgets'));
try {
$galleries = $GLOBALS['injector']->getInstance('Ansel_Storage')->listGalleries(array('attributes' => $owner));
} catch (Ansel_Exception $e) {
Horde::log($e, 'ERR');
return;
}
foreach ($galleries as $gallery) {
$parents = $gallery->get('parents');
if (empty($parents)) {
$parent = null;
} else {
$parents = explode(':', $parents);
$parent = array_pop($parents);
}
$img = (string) Ansel::getImageUrl($gallery->getKeyImage(Ansel::getStyleDefinition('ansel_default')), 'mini', true);
$link = Ansel::getUrlFor('view', array('gallery' => $gallery->id, 'slug' => $gallery->get('slug'), 'view' => 'Gallery'), true);
$tree->addNode(array('id' => $gallery->id, 'parent' => $parent, 'label' => $gallery->get('name'), 'expanded' => $gallery->id == $this->_view->gallery->id, 'params' => array('icon' => $img, 'url' => $link)));
}
Horde::startBuffer();
$tree->sort('label');
$tree->renderTree();
$view->tree = Horde::endBuffer();
$GLOBALS['injector']->getInstance('Horde_Core_Factory_Imple')->create('Ansel_Ajax_Imple_ToggleOtherGalleries', array('id' => 'othergalleries-toggle'));
}
示例2: _content
/**
*/
protected function _content()
{
$GLOBALS['page_output']->addScriptFile('block.js');
/* Get the top level galleries */
try {
$galleries = $GLOBALS['injector']->getInstance('Ansel_Storage')->listGalleries(array('perm' => Horde_Perms::EDIT, 'attributes' => $GLOBALS['registry']->getAuth(), 'all_levels' => false, 'count' => empty($this->_params['limit']) ? 0 : $this->_params['limit'], 'sort_by' => 'last_modified', 'direction' => Ansel::SORT_DESCENDING));
} catch (Ansel_Exception $e) {
return $e->getMessage();
}
$header = array(_("Gallery Name"), _("Last Modified"), _("Photo Count"));
$html = <<<HEADER
<table class="linedRow" cellspacing="0" style="width:100%">
<thead><tr class="item nowrap">
<th class="item leftAlign">{$header['0']}</th>
<th class="item leftAlign">{$header['1']}</th>
<th class="item leftAlign">{$header['2']}</th>
</tr></thead>
<tbody>
HEADER;
foreach ($galleries as $gallery) {
$url = Ansel::getUrlFor('view', array('view' => 'Gallery', 'slug' => $gallery->get('slug'), 'gallery' => $gallery->id), true);
$html .= '<tr><td>' . $url->link(array('onmouseout' => '$("ansel_preview").hide();$("ansel_preview").update("");', 'onmouseover' => 'Ansel.previewImage(event, ' . $gallery->getKeyImage(Ansel::getStyleDefinition('ansel_default')) . ');')) . htmlspecialchars($gallery->get('name')) . '</a></td><td>' . strftime($GLOBALS['prefs']->getValue('date_format'), $gallery->get('last_modified')) . '</td><td>' . (int) $gallery->countImages(true) . '</td></tr>';
}
$html .= '</tbody></table>';
return $html;
}
示例3: _getGalleryActions
/**
* Helper function for generating the gallery actions selection widget.
*
* @param Horde_View $view The view object.
*/
protected function _getGalleryActions(&$view)
{
global $registry, $conf;
$id = $this->_view->gallery->id;
$galleryurl = Horde::url('gallery.php')->add('gallery', $id);
$selfurl = Horde::selfUrl(true, false, true);
$view->count = $count = $this->_view->gallery->countImages();
$date = $this->_view->gallery->getDate();
// Buid the url parameters to the zip link
$view_params = array('gallery' => $this->_view->gallery->id, 'view' => 'Gallery', 'slug' => $this->_view->gallery->get('slug'), 'page' => !empty($this->_view->_params['page']) ? $this->_view->_params['page'] : 0);
// Append the date information to the parameters if we need it
$view_params = array_merge($view_params, $date);
// Bookmark link
if ($registry->hasMethod('bookmarks/getAddUrl')) {
$api_params = array('url' => Ansel::getUrlFor('view', $view_params, true), 'title' => $this->_view->gallery->get('name'));
try {
$view->bookmark_url = new Horde_Url($registry->bookmarks->getAddUrl($api_params));
} catch (Horde_Exception $e) {
}
}
// Download as ZIP link
if (!empty($conf['gallery']['downloadzip']) && $this->_view->gallery->canDownload() && $count && $this->_view->gallery->hasFeature('zipdownload')) {
$zip_params = array_merge(array('actionID' => 'downloadzip'), $date);
$view->zip_url = $galleryurl->copy()->add($zip_params)->link(array('class' => 'widget'));
}
// Image upload, subgalleries, captions etc..
if ($this->_view->gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) {
$view->hasEdit = true;
$view->properties_url = $galleryurl->copy()->add(array('actionID' => 'modify', 'url' => $selfurl))->link(array('class' => 'widget'));
if ($count) {
if ($this->_view->gallery->hasFeature('image_captions')) {
$params = array_merge(array('gallery' => $id), $date);
$view->captions_url = Horde::url('gallery/captions.php')->add($params)->link(array('class' => 'widget'));
}
if ($this->_view->gallery->hasFeature('sort_images')) {
$view->sort_url = Horde::url('gallery/sort.php')->add(array_merge(array('gallery' => $id), $date))->link(array('class' => 'widget'));
$view->resetsort_url = Horde::url('gallery/sort.php')->add(array_merge(array('gallery' => $id, 'action' => 'Reset'), $date))->link(array('class' => 'widget'));
}
$view->regenerate_url = $galleryurl->copy()->add(array('actionID' => 'generateThumbs'))->link(array('class' => 'widget'));
$view->regenerate_all = $galleryurl->copy()->add(array('actionID' => 'deleteCache'))->link(array('class' => 'widget'));
if ($conf['faces']['driver'] && $conf['faces']['driver'] !== 'user' && $this->_view->gallery->hasFeature('faces')) {
$view->faces_url = Horde::url('faces/gallery.php')->add(array_merge($date, array('gallery' => $id, 'page' => !empty($this->_view->_params['page']) ? $this->_view->_params['page'] : 0)))->link(array('class' => 'widget'));
}
}
if ($this->_view->gallery->hasFeature('stacks')) {
$view->gendefault_url = $galleryurl->copy()->add(array('actionID' => 'generateDefault', 'url' => $selfurl))->link(array('class' => 'widget'));
}
}
if ($registry->getAuth() && $this->_view->gallery->get('owner') == $registry->getAuth()) {
$url = new Horde_Url('#');
$view->perms_link = $url->link(array('class' => 'popup widget', 'onclick' => Horde::popupJs(Horde::url('perms.php'), array('params' => array('cid' => $this->_view->gallery->id), 'urlencode' => true)) . 'return false;'));
} elseif (!empty($conf['report_content']['driver']) && ($conf['report_content']['allow'] == 'authenticated' && $registry->isAuthenticated() || $conf['report_content']['allow'] == 'all')) {
$view->report_url = Horde::url('report.php')->add('gallery', $id)->link(array('class' => 'widget'));
}
if ($this->_view->gallery->hasPermission($registry->getAuth(), Horde_Perms::DELETE)) {
$view->have_delete = true;
$view->deleteall_url = $galleryurl->copy()->add('actionID', 'empty')->link(array('class' => 'widget'));
$view->deletegallery_url = $galleryurl->copy()->add('actionID', 'delete')->link(array('class' => 'widget'));
}
}
示例4: html
public function html()
{
global $registry;
$view = $GLOBALS['injector']->createInstance('Horde_View');
$view->addTemplatePath(ANSEL_TEMPLATES . '/widgets');
$view->owner = $this->_view->gallery->get('owner');
$view->userfeedurl = Ansel::getUrlFor('rss_user', array('owner' => $view->owner));
$view->slug = $this->_view->gallery->get('slug');
$view->galleryname = $this->_view->gallery->get('name');
$view->galleryfeedurl = Ansel::getUrlFor('rss_gallery', array('gallery' => $this->_view->gallery->id, 'slug' => $view->slug));
$view->title = _("Links");
/* Embed html */
if (empty($this->_view->_params['image_id'])) {
/* Gallery view */
$params = array('count' => 10);
if (!empty($slug)) {
$params['gallery_slug'] = $slug;
} else {
$params['gallery_id'] = $this->_view->gallery->id;
}
} else {
// This is an image view
$params = array('thumbsize' => 'screen', 'images' => $this->_view->_params['image_id'], 'count' => 10);
}
$view->embed = Ansel::embedCode($params);
return $view->render('links');
}
示例5: _create
/**
*
* @return Horde_Image
*/
protected function _create()
{
$this->_image->resize(min($GLOBALS['conf']['thumbnail']['width'], $this->_dimensions['width']), min($GLOBALS['conf']['thumbnail']['height'], $this->_dimensions['height']), true);
/* Don't bother with these effects for a stack image
* (which will have a negative gallery_id). */
if ($this->_image->gallery > 0) {
if (is_null($this->_style)) {
$gal = $GLOBALS['injector']->getInstance('Ansel_Storage')->getGallery($this->_image->gallery);
$styleDef = $gal->getStyle();
} else {
$styleDef = $this->_style;
}
try {
/* Apply the effects - continue on error, but be sure to log */
$this->_image->addEffect('RoundCorners', array('border' => 2, 'bordercolor' => '#333'));
$this->_image->addEffect('DropShadow', array('background' => $styleDef->background, 'padding' => 5, 'distance' => 5, 'fade' => 3));
if ($GLOBALS['conf']['thumbnail']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
$this->_image->addEffect('Unsharpmask', array('radius' => $GLOBALS['conf']['thumbnail']['radius'], 'threshold' => $GLOBALS['conf']['thumbnail']['threshold'], 'amount' => $GLOBALS['conf']['thumbnail']['amount']));
}
$this->_image->applyEffects();
} catch (Horde_Image_Exception $e) {
throw new Ansel_Exception($e);
}
return $this->_image->getHordeImage();
}
}
示例6: _create
/**
*
* @return Horde_Image
*/
protected function _create()
{
// Take the largest requested dimension
if (empty($this->_params['width'])) {
$size = min($GLOBALS['conf']['thumbnail']['height'], $GLOBALS['conf']['thumbnail']['width']);
} else {
$size = min($this->_params['width'], $this->_params['height']);
}
// Use smartcrop algorithm if we have it, otherwise a plain center crop.
if (Ansel::isAvailable('SmartCrop') && $GLOBALS['conf']['image']['smartcrop']) {
$this->_image->addEffect('SmartCrop', array('width' => $size, 'height' => $size));
} else {
$this->_image->addEffect('CenterCrop', array('width' => $size, 'height' => $size));
}
$this->_image->applyEffects();
if ($GLOBALS['conf']['thumbnail']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
try {
$this->_image->addEffect('Unsharpmask', array('radius' => $GLOBALS['conf']['thumbnail']['radius'], 'threshold' => $GLOBALS['conf']['thumbnail']['threshold'], 'amount' => $GLOBALS['conf']['thumbnail']['amount']));
$this->_image->applyEffects();
} catch (Horde_Image_Exception $e) {
throw new Ansel_Exception($e);
}
}
return $this->_image->getHordeImage();
}
示例7: getTile
/**
* Outputs the html for a DateGallery tile.
*
* @param Ansel_Gallery_Decorator_Date $dgallery The Ansel_Gallery_Date we are
* displaying.
* @param Ansel_Style $style A style object.
* @param boolean $mini Force the use of a mini thumbail?
* @param array $params An array containing additional parameters.
* Currently, gallery_view_url and image_view_url
* are used to override the respective urls.
* %g and %i are replaced with image id and
* gallery id, respectively.
*
* @return string The HTML for the tile.
*/
public function getTile(Ansel_Gallery_Decorator_Date $dgallery, Ansel_Style $style = null, $mini = false, array $params = array())
{
$view = $GLOBALS['injector']->createInstance('Horde_View');
$view->addTemplatePath(ANSEL_TEMPLATES . '/tile');
// User's preferred date format
$date_format = $GLOBALS['prefs']->getValue('date_format');
$date_array = $dgallery->getDate();
if (empty($date_array['month'])) {
$date_array['month'] = 1;
}
if (empty($date_array['day'])) {
$date_array['day'] = 1;
}
$full_date = new Horde_Date($date_array);
// Need the unaltered date part array
$date_array = $dgallery->getDate();
// Figure out the needed link for the next drill down level. We *must*
// have at least a year since we are in a date tile.
if (empty($date_array['month'])) {
// unit == year
$view->caption = $full_date->strftime('%Y');
$next_date = array('year' => (int) $view->caption);
} elseif (empty($date_array['day'])) {
// unit == month
$view->caption = $full_date->strftime('%B %Y');
$next_date = array('year' => date('Y', $full_date->timestamp()), 'month' => date('n', $full_date->timestamp()));
} else {
// unit == day
$view->caption = $full_date->strftime($date_format);
$next_date = array('year' => date('Y', $full_date->timestamp()), 'month' => date('n', $full_date->timestamp()), 'day' => date('j', $full_date->timestamp()));
}
// Check permissions on the gallery and get appropriate tile image
if ($dgallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
if (is_null($style)) {
$style = $dgallery->getStyle();
}
$thumbstyle = $mini ? 'mini' : 'thumb';
$view->gallery_image = Ansel::getImageUrl($dgallery->getKeyImage(), $thumbstyle, true, $style);
} else {
$view->gallery_image = Horde_Themes::img('thumb-error.png');
}
/* Check for being called via the api and generate correct view links */
if (!isset($params['gallery_view_url'])) {
if (empty($params['style'])) {
$gstyle = $dgallery->getStyle();
} else {
$gstyle = $params['style'];
}
$params = array('gallery' => $dgallery->id, 'view' => 'Gallery', 'slug' => $dgallery->get('slug'));
$view->view_link = Ansel::getUrlFor('view', array_merge($params, $next_date));
} else {
$view->view_link = new Horde_Url(str_replace(array('%g', '%s'), array($dgallery->id, $dgallery->get('slug')), urldecode($params['gallery_view_url'])));
$view->view_link->add($next_date);
}
$view->gallery_count = $dgallery->countImages(true);
return $view->render('dategallery');
}
示例8: __construct
/**
* Const'r
*
* @see Ansel_View_Base::__construct
*/
public function __construct(array $params = array())
{
parent::__construct($params);
if (!empty($params['gallery_slug'])) {
$this->gallery = $this->_getGallery(null, $params['gallery_slug']);
} elseif (!empty($params['gallery_id'])) {
$this->gallery = $this->_getGallery($params['gallery_id']);
} else {
$this->gallery = $this->_getGallery();
}
// Check user age
if (!$this->gallery->isOldEnough()) {
if (!empty($params['api'])) {
throw new Ansel_Exception('Locked galleries are not viewable via the api.');
}
$date = Ansel::getDateParameter(array('year' => isset($this->_params['year']) ? $this->_params['year'] : 0, 'month' => isset($this->_params['month']) ? $this->_params['month'] : 0, 'day' => isset($this->_params['day']) ? $this->_params['day'] : 0));
$galleryurl = Ansel::getUrlFor('view', array_merge(array('gallery' => $this->gallery->id, 'slug' => empty($params['slug']) ? '' : $params['slug'], 'page' => empty($params['page']) ? 0 : $params['page'], 'view' => 'Gallery'), $date), true);
$params = array('gallery' => $this->gallery->id, 'url' => $galleryurl);
Horde::url('disclamer.php')->add($params)->setRaw(true)->redirect();
exit;
}
if ($this->gallery->hasPasswd()) {
if (!empty($params['api'])) {
throw new Ansel_Exception(_("Locked galleries are not viewable via the api."));
}
$date = Ansel::getDateParameter(array('year' => isset($this->_params['year']) ? $this->_params['year'] : 0, 'month' => isset($this->_params['month']) ? $this->_params['month'] : 0, 'day' => isset($this->_params['day']) ? $this->_params['day'] : 0));
$galleryurl = Ansel::getUrlFor('view', array_merge(array('gallery' => $this->gallery->id, 'slug' => empty($params['slug']) ? '' : $params['slug'], 'page' => empty($params['page']) ? 0 : $params['page'], 'view' => 'Gallery'), $date), true);
$params = array('gallery' => $this->gallery->id, 'url' => $galleryurl);
Horde::url('protect.php')->add($params)->setRaw(true)->redirect();
exit;
}
if (!$this->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
throw new Horde_Exception_PermissionDenied();
}
// Since this is a gallery view, the resource is the gallery.
$this->resource = $this->gallery;
// Do we have an explicit style set? If not, use the gallery's
if (!empty($this->_params['style'])) {
$style = Ansel::getStyleDefinition($this->_params['style']);
} else {
$style = $this->gallery->getStyle();
}
if (!empty($this->_params['gallery_view'])) {
$renderer = $this->_params['gallery_view'];
} else {
$renderer = !empty($style->gallery_view) ? $style->gallery_view : 'Gallery';
}
// Load the helper
$classname = 'Ansel_View_GalleryRenderer_' . basename($renderer);
$this->_renderer = new $classname($this);
$this->_renderer->init();
}
示例9: _create
/**
*
* @return boolean
*/
protected function _create()
{
$this->_image->resize(min($GLOBALS['conf']['screen']['width'], $this->_dimensions['width']), min($GLOBALS['conf']['screen']['height'], $this->_dimensions['height']), true);
if ($GLOBALS['conf']['screen']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
try {
$this->_image->addEffect('Unsharpmask', array('radius' => $GLOBALS['conf']['screen']['radius'], 'threshold' => $GLOBALS['conf']['screen']['threshold'], 'amount' => $GLOBALS['conf']['screen']['amount']));
$this->_image->applyEffects();
} catch (Horde_Image $e) {
throw new Ansel_Exception($e);
}
}
return $this->_image->getHordeImage();
}
示例10: menu
/**
*/
public function menu($menu)
{
global $conf, $registry;
/* Browse/Search */
$menu->add(Horde::url('browse.php'), _("_Browse"), 'ansel-browse', null, null, null, $GLOBALS['prefs']->getValue('defaultview') == 'browse' && basename($_SERVER['PHP_SELF']) == 'index.php' || basename($_SERVER['PHP_SELF']) == 'browse.php' ? 'current' : '__noselection');
if ($GLOBALS['registry']->getAuth()) {
$url = Ansel::getUrlFor('view', array('owner' => $GLOBALS['registry']->getAuth(), 'groupby' => 'owner', 'view' => 'List'));
$menu->add($url, _("_My Galleries"), 'ansel-mygalleries', null, null, null, Horde_Util::getFormData('owner', false) == $GLOBALS['registry']->getAuth() ? 'current' : '__noselection');
}
$menu->add(Ansel::getUrlFor('view', array('view' => 'List')), _("_All Galleries"), 'ansel-allgalleries', null, null, null, $GLOBALS['prefs']->getValue('defaultview') == 'galleries' && basename($_SERVER['PHP_SELF']) == 'index.php' || basename($_SERVER['PHP_SELF']) == 'group.php' && Horde_Util::getFormData('owner') !== $GLOBALS['registry']->getAuth() ? 'current' : '__noselection');
if ($conf['faces']['driver'] && $registry->isAuthenticated()) {
$menu->add(Horde::url('faces/search/all.php'), _("_Faces"), 'ansel-faces');
}
}
示例11: _create
/**
*
* @return Horde_Image
*/
protected function _create()
{
$imgobjs = $this->_getStackImages();
$style = $this->_params['style'];
$params = array('width' => 100, 'height' => 100, 'background' => $style->background);
$baseImg = Ansel::getImageObject($params);
try {
$baseImg->addEffect('PhotoStack', array('images' => $imgobjs, 'resize_height' => $GLOBALS['conf']['thumbnail']['height'], 'padding' => 0, 'background' => $style->background, 'type' => 'rounded'));
$baseImg->applyEffects();
$baseImg->resize($GLOBALS['conf']['thumbnail']['width'], $GLOBALS['conf']['thumbnail']['height']);
} catch (Horde_Image_Exception $e) {
throw new Ansel_Exception($e);
}
return $baseImg;
}
示例12: _content
/**
*/
protected function _content()
{
/* Get the tags */
$tags = $GLOBALS['injector']->getInstance('Ansel_Tagger')->getCloud(null, $this->_params['count']);
if (count($tags)) {
$cloud = new Horde_Core_Ui_TagCloud();
foreach ($tags as $id => $tag) {
$link = Ansel::getUrlFor('view', array('view' => 'Results', 'tag' => $tag['tag_name']));
$cloud->addElement($tag['tag_name'], $link, $tag['count']);
}
$html = $cloud->buildHTML();
} else {
$html = '';
}
return $html;
}
示例13: _create
/**
*
* @return Horde_Image
*/
protected function _create()
{
if ($GLOBALS['conf']['image']['squaremini']) {
$generator = Ansel_ImageGenerator::factory('SquareThumb', array('width' => min(50, $this->_dimensions['width']), 'height' => min(50, $this->_dimensions['height']), 'image' => $this->_image, 'style' => $this->_params['style']));
return $generator->create();
} else {
$this->_image->resize(min(50, $this->_dimensions['width']), min(50, $this->_dimensions['height']), true);
if ($GLOBALS['conf']['thumbnail']['unsharp'] && Ansel::isAvailable('Unsharpmask')) {
try {
$this->_image->addEffect('Unsharpmask', array('radius' => $GLOBALS['conf']['thumbnail']['radius'], 'threshold' => $GLOBALS['conf']['thumbnail']['threshold'], 'amount' => $GLOBALS['conf']['thumbnail']['amount']));
$this->_image->applyEffects();
} catch (Horde_Image_Exception $e) {
throw new Ansel_Exception($e);
}
}
return $this->_image->getHordeImage();
}
}
示例14: _content
/**
*/
protected function _content()
{
$gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getRandomGallery();
if (!$gallery) {
return _("There are no photo galleries available.");
}
$imagelist = $gallery->listImages(rand(0, $gallery->countImages() - 1), 1);
if (empty($imagelist)) {
return '';
}
$imageId = $imagelist[0];
$viewurl = Ansel::getUrlFor('view', array('gallery' => $gallery->id, 'slug' => $gallery->get('slug'), 'image' => $imageId, 'view' => 'Image'), true);
if ($gallery->isOldEnough() && !$gallery->hasPasswd()) {
$img = '<img src="' . Ansel::getImageUrl($imageId, 'thumb', true, Ansel::getStyleDefinition('ansel_default')) . '" alt="[random photo]" />';
} else {
$img = Horde::img('thumb-error.png');
}
return $viewurl->link(array('title' => _("View Photo"))) . $img . '</a>';
}
示例15: _content
/**
*/
protected function _content()
{
try {
$gallery = $this->_getGallery();
} catch (Ansel_Exception $e) {
return $e->getMessage();
}
$params = array('gallery_id' => $gallery->id, 'count' => $this->_params['perpage']);
if (!empty($this->_params['use_lightbox'])) {
$params['lightbox'] = true;
}
$html = Ansel::embedCode($params);
// Be nice to people with <noscript>
$viewurl = Ansel::getUrlFor('view', array('view' => 'Gallery', 'gallery' => $gallery->id, 'slug' => $gallery->get('slug')), true);
$html .= '<noscript>';
$html .= $viewurl->link(array('title' => sprintf(_("View %s"), $gallery->get('name'))));
if ($iid = $gallery->getKeyImage(Ansel::getStyleDefinition('ansel_default')) && $gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
$html .= '<img src="' . Ansel::getImageUrl($gallery->getKeyImage(Ansel::getStyleDefinition('ansel_default')), 'thumb', true) . '" alt="' . htmlspecialchars($gallery->get('name')) . '" />';
} else {
$html .= Horde::img('thumb-error.png');
}
return $html . '</a></noscript>';
}