mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Discussions: Some fixes
This commit is contained in:
parent
3ed37e34a4
commit
cd91d4e310
4 changed files with 12 additions and 4 deletions
|
@ -49,6 +49,7 @@ class Comment extends Post
|
|||
{
|
||||
return $this->getOwner()->getId() == $user->getId() ||
|
||||
$this->getTarget()->getOwner()->getId() == $user->getId() ||
|
||||
$this->getTarget() instanceof Post && $this->getTarget()->getTargetWall() < 0 && (new Clubs)->get(abs($this->getTarget()->getTargetWall()))->canBeModifiedBy($user);
|
||||
$this->getTarget() instanceof Post && $this->getTarget()->getTargetWall() < 0 && (new Clubs)->get(abs($this->getTarget()->getTargetWall()))->canBeModifiedBy($user) ||
|
||||
$this->getTarget() instanceof Topic && $this->getTarget()->canBeModifiedBy($user);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,7 +160,10 @@ final class TopicsPresenter extends OpenVKPresenter
|
|||
|
||||
$topic->setTitle(ovk_proc_strtr($title, 127));
|
||||
$topic->setClosed(empty($this->postParam("close")) ? 0 : 1);
|
||||
|
||||
if($topic->getClub()->canBeModifiedBy($this->user->identity))
|
||||
$topic->setPinned(empty($this->postParam("pin")) ? 0 : 1);
|
||||
|
||||
$topic->save();
|
||||
|
||||
$this->flash("succ", tr("changes_saved"), tr("topic_changes_saved_comment"));
|
||||
|
|
|
@ -32,7 +32,9 @@
|
|||
<span class="nobold">{_topic_settings}</span>
|
||||
</td>
|
||||
<td>
|
||||
{if $topic->getClub()->canBeModifiedBy($thisUser)}
|
||||
<input type="checkbox" name="pin" n:attr="checked => $topic->isPinned()" /> {_pin_topic}<br />
|
||||
{/if}
|
||||
<input type="checkbox" name="close" n:attr="checked => $topic->isClosed()" /> {_close_topic}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
<div n:ifset="$thisUser">
|
||||
{var commentsURL = "/al_comments.pl/create/$model/" . $parent->getId()}
|
||||
{var club = $parent instanceof \openvk\Web\Models\Entities\Post && $parent->getTargetWall() < 0 ? (new openvk\Web\Models\Repositories\Clubs)->get(abs($parent->getTargetWall())) : $club}
|
||||
{if !$readOnly}
|
||||
{include "textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), club => $club}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{if sizeof($comments) > 0}
|
||||
|
|
Loading…
Reference in a new issue