mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
Wall: Hotfix - added a embedded version of wall
This commit is contained in:
parent
4ecef2d687
commit
316a369a5e
4 changed files with 73 additions and 24 deletions
|
@ -39,7 +39,7 @@ final class WallPresenter extends OpenVKPresenter
|
|||
$this->logPostView($post, $wall);
|
||||
}
|
||||
|
||||
function renderWall(int $user): void
|
||||
function renderWall(int $user, bool $embedded = false): void
|
||||
{
|
||||
if(false)
|
||||
exit("Ошибка доступа: " . (string) random_int(0, 255));
|
||||
|
@ -57,6 +57,7 @@ final class WallPresenter extends OpenVKPresenter
|
|||
else
|
||||
$canPost = false;
|
||||
|
||||
if ($embedded == true) $this->template->_template = "components/wall.xml";
|
||||
$this->template->oObj = $owner;
|
||||
$this->template->owner = $user;
|
||||
$this->template->canPost = $canPost;
|
||||
|
@ -68,9 +69,15 @@ final class WallPresenter extends OpenVKPresenter
|
|||
"amount" => sizeof($this->template->posts),
|
||||
"perPage" => OPENVK_DEFAULT_PER_PAGE,
|
||||
];
|
||||
|
||||
|
||||
$this->logPostsViewed($this->template->posts, $user);
|
||||
}
|
||||
|
||||
function renderWallEmbedded(int $user): void
|
||||
{
|
||||
$this->renderWall($user, true);
|
||||
}
|
||||
|
||||
function renderFeed(): void
|
||||
{
|
||||
|
|
|
@ -462,7 +462,7 @@
|
|||
</p>
|
||||
</div>
|
||||
|
||||
{presenter "openvk!Wall->wall", $user->getId()}
|
||||
{presenter "openvk!Wall->wallEmbedded", $user->getId()}
|
||||
|
||||
<script n:if="isset($thisUser) && $thisUser->getChandlerUser()->can('access')->model('admin')->whichBelongsTo(NULL)">
|
||||
function banUser() {
|
||||
|
|
|
@ -1,30 +1,70 @@
|
|||
<div class="content_divider">
|
||||
<div class="content_title_expanded" onclick="hidePanel(this, {$count});">
|
||||
{_"wall"}
|
||||
<div class="content_title_expanded" onclick="hidePanel(this);">
|
||||
{_"wall"}
|
||||
<nobold>
|
||||
{tr("wall", $count)}
|
||||
<a href="/wall{$owner}" class="float-right lowercase">{_all_title}</a>
|
||||
</nobold>
|
||||
</div>
|
||||
<div>
|
||||
<div class="content_subtitle">
|
||||
{tr("wall", $count)}
|
||||
<div style="float: right;">
|
||||
<a onclick="show_write_textarea()">{_'write'}</a>
|
||||
<div n:if="$canPost" class="content_subtitle">
|
||||
<div id="write" style="padding: 5px 0;" onfocusin="expand_wall_textarea();">
|
||||
<form action="/wall{$owner}/makePost" method="post" enctype="multipart/form-data" style="margin:0;">
|
||||
<textarea id="wall-post-input" placeholder="{_write}" name="text" style="width: 100%;resize: none;" class="small-textarea"></textarea>
|
||||
<div>
|
||||
<!-- padding to fix <br/> bug -->
|
||||
</div>
|
||||
<div id="post-buttons" style="display: none;">
|
||||
<div class="post-upload">
|
||||
Вложение: <span>(unknown)</span>
|
||||
</div>
|
||||
<div class="post-opts">
|
||||
{if !is_null($thisUser) && $owner < 0 && $club->canBeModifiedBy($thisUser)}
|
||||
<script>
|
||||
function onWallAsGroupClick(el) {
|
||||
_display = el.checked ? "block" : "none";
|
||||
document.querySelector("#forceSignOpt").style.display = _display;
|
||||
}
|
||||
</script>
|
||||
|
||||
<label>
|
||||
<input type="checkbox" name="as_group" onchange="onWallAsGroupClick(this)" /> От имени сообщества
|
||||
</label>
|
||||
<label id="forceSignOpt" style="display: none;">
|
||||
<input type="checkbox" name="force_sign" /> Подпись автора
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
<label>
|
||||
<input type="checkbox" name="nsfw" /> Содержит NSFW-контент
|
||||
</label>
|
||||
</div>
|
||||
<input type="file" name="_pic_attachment" accept="image/*" style="display:none;" />
|
||||
<input type="hidden" name="type" value="1" />
|
||||
<input type="hidden" name="hash" value="{$csrfToken}" />
|
||||
<br/>
|
||||
<input type="submit" value="{_'write'}" class="button" />
|
||||
<div style="float: right;">
|
||||
<a href="javascript:void(document.querySelector(`input[name=_pic_attachment]`).click());">
|
||||
{_attach_photo}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="write" style="padding: 8px; display: none;">
|
||||
<form action="/actions/add_post" method="post">
|
||||
<textarea name="text" style="width: 100%;"></textarea>
|
||||
<input type="hidden" name="id" value="{$owner}" />
|
||||
<input type="hidden" name="type" value="1" />
|
||||
<div style="float: right;">
|
||||
<input type="submit" value="{_'write'}" class="button" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
{foreach $posts->page($__page, 10) as $post}
|
||||
{include "post.xml", post => $post}
|
||||
{/foreach}
|
||||
|
||||
{include "paginator.xml", page => $__page, bag => $posts}
|
||||
{if sizeof($posts) > 0}
|
||||
{foreach $posts as $post}
|
||||
<a name="postGarter={$post->getId()}"></a>
|
||||
|
||||
{include "../components/post.xml", post => $post}
|
||||
{/foreach}
|
||||
{include "../components/paginator.xml", conf => $paginatorConf}
|
||||
{else}
|
||||
{_no_posts_abstract}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -217,6 +217,8 @@ routes:
|
|||
handler: "VKAPI->tokenLogin"
|
||||
- url: "/sandbox_cocksex"
|
||||
handler: "About->sandbox"
|
||||
- url: "/internal/wall{num}"
|
||||
handler: "Wall->wallEmbedded"
|
||||
- url: "/{?shortCode}"
|
||||
handler: "UnknownTextRouteStrategy->delegate"
|
||||
placeholders:
|
||||
|
|
Loading…
Reference in a new issue