mirror of
https://github.com/openvk/openvk
synced 2025-07-07 00:09:48 +03:00
Add check forrwifhjrowhg jrbgerhjgehhge oghjrjkr
This commit is contained in:
parent
5ddb5354be
commit
b198a98506
7 changed files with 34 additions and 18 deletions
|
@ -80,6 +80,7 @@ class Wall implements Handler
|
|||
|
||||
$arr = [
|
||||
"count" => sizeof($myNotes),
|
||||
"closed" => $this->user->getPrivacySetting("notes.read"),
|
||||
"items" => []
|
||||
];
|
||||
|
||||
|
|
|
@ -481,6 +481,9 @@ final class Wall extends VKAPIRequestHandler
|
|||
if($attacc->getOwner()->getId() != $this->getUser()->getId())
|
||||
$this->fail(43, "You do not have access to this note");
|
||||
|
||||
if($attacc->getOwner()->getPrivacySetting("notes.read") < 1)
|
||||
$this->fail(11, "You can't attach note to post, because your notes list is closed. Change it in privacy settings in web-version.");
|
||||
|
||||
$post->attach($attacc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -287,6 +287,10 @@ final class WallPresenter extends OpenVKPresenter
|
|||
if(!$note || $note->isDeleted() || $note->getOwner()->getId() != $this->user->id) {
|
||||
$this->flashFail("err", tr("error"), tr("error_attaching_note"));
|
||||
}
|
||||
|
||||
if($note->getOwner()->getPrivacySetting("notes.read") < 1) {
|
||||
$this->flashFail("err", " ");
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($this->postParam("text")) && !$photo && !$video && !$poll && !$note)
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
{_video}
|
||||
</a>
|
||||
<a n:if="$notes ?? false" href="javascript:attachNote({$textAreaId})">
|
||||
<img src="/assets/packages/static/openvk/img/oxygen-icons/16x16/actions/document-new.png" />
|
||||
<img src="/assets/packages/static/openvk/img/oxygen-icons/16x16/mimetypes/application-x-srt.png" />
|
||||
{_note}
|
||||
</a>
|
||||
<a n:if="$graffiti ?? false" href="javascript:initGraffiti({$textAreaId});">
|
||||
|
|
|
@ -207,6 +207,9 @@ async function attachNote(id)
|
|||
let notes = await API.Wall.getMyNotes()
|
||||
let body = ``
|
||||
|
||||
if(notes.closed < 1) {
|
||||
body = `${tr("notes_closed")}`
|
||||
} else {
|
||||
if(notes.items.length < 1) {
|
||||
body = `${tr("no_notes")}`
|
||||
} else {
|
||||
|
@ -225,6 +228,7 @@ async function attachNote(id)
|
|||
|
||||
body += `</div>`
|
||||
}
|
||||
}
|
||||
|
||||
let frame = MessageBox(tr("select_note"), body, [tr("cancel")], [Function.noop]);
|
||||
|
||||
|
|
|
@ -411,6 +411,8 @@
|
|||
|
||||
"select_or_create_new" = "Select existing note or <a href='/notes/create'>create new one</a>";
|
||||
|
||||
"notes_closed" = "You can't attach note to post, because only you can see them.<br> You can change it in <a href=\"/settings?act=privacy\">settings</a>.";
|
||||
|
||||
/* Menus */
|
||||
|
||||
/* Note that is string need to fit into the "My Page" link */
|
||||
|
|
|
@ -396,6 +396,8 @@
|
|||
|
||||
"select_or_create_new" = "Выберите существующую заметку или <a href='/notes/create'>создайте новую</a>";
|
||||
|
||||
"notes_closed" = "Вы не можете прикрепить заметку к записи, так как ваши заметки видны только вам.<br><br> Вы можете поменять это в <a href=\"/settings?act=privacy\">настройках</a>.";
|
||||
|
||||
/* Menus */
|
||||
|
||||
"edit_button" = "ред.";
|
||||
|
|
Loading…
Reference in a new issue