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
|
@ -79,8 +79,9 @@ class Wall implements Handler
|
|||
$myNotes = $this->notes->getUserNotes($this->user, 1, $this->notes->getUserNotesCount($this->user));
|
||||
|
||||
$arr = [
|
||||
"count" => sizeof($myNotes),
|
||||
"items" => []
|
||||
"count" => sizeof($myNotes),
|
||||
"closed" => $this->user->getPrivacySetting("notes.read"),
|
||||
"items" => []
|
||||
];
|
||||
|
||||
foreach($myNotes as $note) {
|
||||
|
|
|
@ -480,6 +480,9 @@ final class Wall extends VKAPIRequestHandler
|
|||
$this->fail(100, "Note does not exists");
|
||||
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,23 +207,27 @@ async function attachNote(id)
|
|||
let notes = await API.Wall.getMyNotes()
|
||||
let body = ``
|
||||
|
||||
if(notes.items.length < 1) {
|
||||
body = `${tr("no_notes")}`
|
||||
if(notes.closed < 1) {
|
||||
body = `${tr("notes_closed")}`
|
||||
} else {
|
||||
body = `
|
||||
${tr("select_or_create_new")}
|
||||
<div id="notesList">
|
||||
`
|
||||
|
||||
for(const note of notes.items) {
|
||||
body += `
|
||||
<div class="ntSelect" onclick="addNote(${id}, ${note.id}, '${escapeHtml(note.name)}')">
|
||||
<span>${escapeHtml(note.name)}</span>
|
||||
</div>
|
||||
if(notes.items.length < 1) {
|
||||
body = `${tr("no_notes")}`
|
||||
} else {
|
||||
body = `
|
||||
${tr("select_or_create_new")}
|
||||
<div id="notesList">
|
||||
`
|
||||
}
|
||||
|
||||
body += `</div>`
|
||||
|
||||
for(const note of notes.items) {
|
||||
body += `
|
||||
<div class="ntSelect" onclick="addNote(${id}, ${note.id}, '${escapeHtml(note.name)}')">
|
||||
<span>${escapeHtml(note.name)}</span>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
||||
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