本文整理汇总了PHP中Ansel::embedCode方法的典型用法代码示例。如果您正苦于以下问题:PHP Ansel::embedCode方法的具体用法?PHP Ansel::embedCode怎么用?PHP Ansel::embedCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ansel
的用法示例。
在下文中一共展示了Ansel::embedCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: _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>';
}