1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-16 23:00:51 +03:00

Доработка стены

* Основной файл теперь принимает локальные переменные
This commit is contained in:
Denis Shakhov 2014-07-15 19:08:52 +07:00
parent ae3d35f18e
commit f04e8eefd3
2 changed files with 18 additions and 16 deletions

View file

@ -16,7 +16,7 @@
*/
/**
*
* Стена
*
* @package blocks
* @since 2.0
@ -29,12 +29,14 @@ class BlockWall extends Block {
$wall = $this->Wall_GetWall( array( 'wall_user_id' => (int) $this->GetParam('user_id'), 'pid' => null ), array( 'id' => 'desc' ), 1, Config::Get( 'module.wall.per_page' ) );
$posts = $wall['collection'];
$this->Viewer_Assign('posts', $posts);
$this->Viewer_Assign('count', $wall['count']);
$this->Viewer_Assign('classes', $this->GetParam('classes'));
$this->Viewer_Assign('posts', $posts, true);
$this->Viewer_Assign('count', $wall['count'], true);
$this->Viewer_Assign('classes', $this->GetParam('classes'), true);
$this->Viewer_Assign('attributes', $this->GetParam('attributes'), true);
$this->Viewer_Assign('mods', $this->GetParam('mods'), true);
if ( count($posts) ) {
$this->Viewer_Assign('lastId', end($posts)->getId());
$this->Viewer_Assign('lastId', end($posts)->getId(), true);
}
$this->SetTemplate('components/wall/wall.tpl');

View file

@ -1,22 +1,22 @@
{**
* Стена
*
* @param array $posts Посты
* @param array $count Общее кол-во постов на стене
* @param array $lastId ID последнего загруженного поста
* @param array $classes Доп-ые классы
*
* TODO: Локальные переменные
* @param array $posts Посты
* @param array $count Общее кол-во постов на стене
* @param array $lastId ID последнего загруженного поста
* @param array $classes Доп-ые классы
* @param array $mods Модификаторы
* @param array $attributes Атрибуты
*}
{* Название компонента *}
{$component = 'wall'}
{$loadedCount = count($posts)}
{$moreCount = $count - $loadedCount}
{$loadedCount = count($smarty.local.posts)}
{$moreCount = $smarty.local.count - $loadedCount}
{* Стена *}
<div class="{$component} {mod name=$component mods=$mods} {$classes}" data-user-id="{$oUserProfile->getId()}">
<div class="{$component} {mod name=$component mods=$smarty.local.mods} {$smarty.local.classes}" data-user-id="{$oUserProfile->getId()}" {$smarty.local.attributes}>
{* Форма добавления записи *}
{if $oUserCurrent}
{include './wall.form.tpl'}
@ -26,7 +26,7 @@
{* Список записей *}
<div class="js-wall-entry-container" data-id="0">
{include './wall.posts.tpl' posts=$posts}
{include './wall.posts.tpl' posts=$smarty.local.posts}
</div>
{* Уведомление о пустом списке *}
@ -39,6 +39,6 @@
{include 'components/more/more.tpl'
sClasses = 'js-wall-more'
iCount = $moreCount
sAttributes = "data-more-target=\".js-wall-entry-container[data-id=0]\" data-proxy-last_id=\"{$lastId}\""}
sAttributes = "data-more-target=\".js-wall-entry-container[data-id=0]\" data-proxy-last_id=\"{$smarty.local.lastId}\""}
{/if}
</div>