Add check forrwifhjrowhg jrbgerhjgehhge oghjrjkr

This commit is contained in:
lalka2016 2023-06-24 16:04:09 +03:00
parent 5ddb5354be
commit b198a98506
7 changed files with 34 additions and 18 deletions

View file

@ -80,6 +80,7 @@ class Wall implements Handler
$arr = [ $arr = [
"count" => sizeof($myNotes), "count" => sizeof($myNotes),
"closed" => $this->user->getPrivacySetting("notes.read"),
"items" => [] "items" => []
]; ];

View file

@ -481,6 +481,9 @@ final class Wall extends VKAPIRequestHandler
if($attacc->getOwner()->getId() != $this->getUser()->getId()) if($attacc->getOwner()->getId() != $this->getUser()->getId())
$this->fail(43, "You do not have access to this note"); $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); $post->attach($attacc);
} }
} }

View file

@ -287,6 +287,10 @@ final class WallPresenter extends OpenVKPresenter
if(!$note || $note->isDeleted() || $note->getOwner()->getId() != $this->user->id) { if(!$note || $note->isDeleted() || $note->getOwner()->getId() != $this->user->id) {
$this->flashFail("err", tr("error"), tr("error_attaching_note")); $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) if(empty($this->postParam("text")) && !$photo && !$video && !$poll && !$note)

View file

@ -80,7 +80,7 @@
{_video} {_video}
</a> </a>
<a n:if="$notes ?? false" href="javascript:attachNote({$textAreaId})"> <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} {_note}
</a> </a>
<a n:if="$graffiti ?? false" href="javascript:initGraffiti({$textAreaId});"> <a n:if="$graffiti ?? false" href="javascript:initGraffiti({$textAreaId});">

View file

@ -207,6 +207,9 @@ async function attachNote(id)
let notes = await API.Wall.getMyNotes() let notes = await API.Wall.getMyNotes()
let body = `` let body = ``
if(notes.closed < 1) {
body = `${tr("notes_closed")}`
} else {
if(notes.items.length < 1) { if(notes.items.length < 1) {
body = `${tr("no_notes")}` body = `${tr("no_notes")}`
} else { } else {
@ -225,6 +228,7 @@ async function attachNote(id)
body += `</div>` body += `</div>`
} }
}
let frame = MessageBox(tr("select_note"), body, [tr("cancel")], [Function.noop]); let frame = MessageBox(tr("select_note"), body, [tr("cancel")], [Function.noop]);

View file

@ -411,6 +411,8 @@
"select_or_create_new" = "Select existing note or <a href='/notes/create'>create new one</a>"; "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 */ /* Menus */
/* Note that is string need to fit into the "My Page" link */ /* Note that is string need to fit into the "My Page" link */

View file

@ -396,6 +396,8 @@
"select_or_create_new" = "Выберите существующую заметку или <a href='/notes/create'>создайте новую</a>"; "select_or_create_new" = "Выберите существующую заметку или <a href='/notes/create'>создайте новую</a>";
"notes_closed" = "Вы не можете прикрепить заметку к записи, так как ваши заметки видны только вам.<br><br> Вы можете поменять это в <a href=\"/settings?act=privacy\">настройках</a>.";
/* Menus */ /* Menus */
"edit_button" = "ред."; "edit_button" = "ред.";