本文整理汇总了PHP中XenForo_Template_Abstract::setParams方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Template_Abstract::setParams方法的具体用法?PHP XenForo_Template_Abstract::setParams怎么用?PHP XenForo_Template_Abstract::setParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Template_Abstract
的用法示例。
在下文中一共展示了XenForo_Template_Abstract::setParams方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$mediaCloudModel = XenForo_Model::create('EWRmedio_Model_Keywords');
// $model = XenForo_Model::create('EWRporta_Model_Options');
// $option = $model->getOptionById('MediaCloud');
$options = XenForo_Application::get('options');
$sidebar['keywords'] = $mediaCloudModel->getKeywordCloud($options->EWRmedio_cloudcount, $options->EWRmedio_mincloud, $options->EWRmedio_maxcloud);
if ($options->EWRmedio_animatedcloud && $sidebar['keywords']) {
$sidebar['animated'] = $mediaCloudModel->getAnimatedCloud($sidebar['keywords']);
}
/* $limit = $option['limit'];
$mincloud = $option['mincloud'];
$maxcloud = $option['maxcloud'];
$animated = $option['animated'];
$cloud['keywords'] = $mediaCloudModel->getKeywordCloud($limit, $mincloud, $maxcloud);
if ($animated && $cloud['keywords'])
{
$cloud['animated'] = $mediaCloudModel->getAnimatedCloud($cloud['keywords']);
}*/
$viewParams = array('MediaCloud' => $sidebar);
$renderTemplateObject->setParams($viewParams);
return $renderTemplateObject->render();
}
示例2: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$renderTemplateObject->setParams($params);
if (!isset($params['url'])) {
// try to detect the correct url for different templates
$autoDetectedUrl = false;
switch ($positionCode) {
case 'forum_list':
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:forums');
break;
case 'forum_view':
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:forums', $params['forum']);
break;
case 'member_view':
// this widget on member_view, seriously?
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:members', $params['user']);
break;
case 'resource_author_view':
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:resources/authors', $params['user']);
break;
case 'resource_view':
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:resources', $params['resource']);
break;
case 'thread_view':
$autoDetectedUrl = XenForo_Link::buildPublicLink('canonical:threads', $params['thread']);
break;
}
if ($autoDetectedUrl !== false) {
$renderTemplateObject->setParam('url', $autoDetectedUrl);
}
}
return $renderTemplateObject->render();
}
示例3: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$params = $renderTemplateObject->getParams();
$params['taigachat']['alt'] = true;
$params['taigachat_alt'] = true;
$renderTemplateObject->setParams($params);
return $renderTemplateObject->render();
}
示例4: _render
/**
* @param array $widget
* @param string $positionCode
* @param array $params
* @param XenForo_Template_Abstract $template
* @return string
*/
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $template)
{
if (!$this->_canViewGallery()) {
return;
}
$photoModel = $this->_getPhotoModel();
$conditions = array('content_type' => sonnb_XenGallery_Model_Photo::$contentType, 'content_state' => 'visible');
$this->_prepareConditions($widget, $conditions, $fetchOptions);
$photos = $photoModel->getContents($conditions, $fetchOptions);
$photos = $photoModel->prepareContents($photos, $fetchOptions);
$this->_prepareContents($widget, $photos, $photoModel);
if (empty($photos)) {
return;
}
$template->setParam('photos', null);
$template->setParams(array('widget' => $widget, 'contents' => $photos));
if (method_exists('WidgetFramework_Template_Trojan', 'WidgetFramework_setRequiredExternals')) {
$externalRequires = array('css' => array('sonnb_xengallery_widget_photo'));
WidgetFramework_Template_Trojan::WidgetFramework_setRequiredExternals($externalRequires);
}
return $template->render();
}
示例5: _render
protected function _render(array $widget, $positionCode, array $params, XenForo_Template_Abstract $renderTemplateObject)
{
$renderTemplateObject->setParams($params);
return $renderTemplateObject->render();
}
示例6: _render
//.........这里部分代码省略.........
/* @var $albumModel sonnb_XenGallery_Model_Album */
$albumModel = $core->getModelFromCache('sonnb_XenGallery_Model_Album');
/* @var $galleryModel sonnb_XenGallery_Model_Gallery */
$galleryModel = $core->getModelFromCache('sonnb_XenGallery_Model_Gallery');
if (!$galleryModel->canViewGallery()) {
return;
}
$conditions = array('album_state' => 'visible', 'content_count' => array('>', 0), 'cover_content_id' => array('>', 0));
$fetchOptions = array('orderDirection' => 'desc', 'limit' => $widget['options']['limit'] * 3, 'join' => sonnb_XenGallery_Model_Album::FETCH_USER | sonnb_XenGallery_Model_Album::FETCH_COVER_PHOTO, 'followingUserId' => XenForo_Visitor::getUserId());
switch ($widget['options']['type']) {
case 'new':
$fetchOptions['order'] = 'album_date';
break;
case 'lastUpdate':
$fetchOptions['order'] = 'album_updated_date';
break;
case 'mostViewed':
$fetchOptions['order'] = 'view_count';
break;
case 'mostCommented':
$fetchOptions['order'] = 'comment_count';
break;
case 'random':
$fetchOptions['order'] = 'random';
break;
case 'recentlyLiked':
$fetchOptions['order'] = 'recently_liked';
break;
case 'mostLiked':
default:
$fetchOptions['order'] = 'likes';
break;
}
if ($widget['options']['category_id']) {
$conditions['category_id'] = $widget['options']['category_id'];
}
if ($widget['options']['collection_id']) {
$fetchOptions['fetchCollectionDate'] = true;
$fetchOptions['order'] = 'collection_date';
$conditions['collection_id'] = $widget['options']['collection_id'];
}
if ($widget['options']['likes']) {
$conditions['likes'] = array('>', $widget['options']['likes']);
}
if ($widget['options']['view_count']) {
$conditions['view_count'] = array('>', $widget['options']['view_count']);
}
if ($widget['options']['comment_count']) {
$conditions['comment_count'] = array('>', $widget['options']['comment_count']);
}
$userIds = explode(',', $widget['options']['user_id']);
$userIds = array_filter($userIds);
array_walk($userIds, create_function('&$userId, $key', '$userId = trim($userId);'));
if ($userIds) {
$conditions['user_id'] = $userIds;
}
$albums = $albumModel->getAlbums($conditions, $fetchOptions);
$albums = $albumModel->prepareAlbums($albums, $fetchOptions);
if ($albums) {
foreach ($albums as $albumId => $album) {
if (!$albumModel->canViewAlbum($album)) {
unset($albums[$albumId]);
continue;
}
}
}
if (empty($albums)) {
return;
}
$albums = array_slice($albums, 0, $widget['options']['limit']);
$albums = $albumModel->attachCoversToAlbums($albums, $fetchOptions);
if ($widget['options']['thumbnail_width'] && $widget['options']['thumbnail_height']) {
foreach ($albums as &$album) {
if (!empty($album['cover']['medium_height']) && !empty($album['cover']['medium_width'])) {
$widthRatio = $album['cover']['medium_width'] / $widget['options']['thumbnail_width'];
$heightRatio = $album['cover']['medium_height'] / $widget['options']['thumbnail_height'];
if ($widthRatio == $heightRatio) {
$album['cover']['medium_width'] = $widget['options']['thumbnail_width'];
$album['cover']['medium_height'] = $widget['options']['thumbnail_height'];
$album['cover']['style'] = '';
} elseif ($widthRatio < $heightRatio) {
$album['cover']['medium_height'] = $album['cover']['medium_height'] / ($album['cover']['medium_width'] / $widget['options']['thumbnail_width']);
$album['cover']['medium_width'] = $widget['options']['thumbnail_width'];
$album['cover']['style'] = 'top: -' . ($album['cover']['medium_height'] - $widget['options']['thumbnail_height']) / 2 . 'px;';
} else {
$album['cover']['medium_width'] = $album['cover']['medium_width'] / ($album['cover']['medium_height'] / $widget['options']['thumbnail_height']);
$album['cover']['medium_height'] = $widget['options']['thumbnail_height'];
$album['cover']['style'] = 'left: -' . ($album['cover']['medium_width'] - $widget['options']['thumbnail_width']) / 2 . 'px;';
}
}
}
}
$template->setParam('albums', null);
$template->setParams(array('widget' => $widget, 'albums' => $albums));
if (method_exists('WidgetFramework_Template_Trojan', 'WidgetFramework_setRequiredExternals')) {
$externalRequires = array('css' => array('sonnb_xengallery_widget_album'));
WidgetFramework_Template_Trojan::WidgetFramework_setRequiredExternals($externalRequires);
}
return $template->render();
}