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