mirror of
https://github.com/openvk/openvk
synced 2025-07-07 08:19:49 +03:00
Коммит целесторы
This commit is contained in:
parent
704a162345
commit
07a3f92308
3 changed files with 10 additions and 9 deletions
|
@ -21,7 +21,7 @@ class Groups implements Handler
|
||||||
$count = $this->groups->getWriteableClubsCount($this->user->getId());
|
$count = $this->groups->getWriteableClubsCount($this->user->getId());
|
||||||
|
|
||||||
if(!$count) {
|
if(!$count) {
|
||||||
$reject(122, "You don't have any groups with write access");
|
$reject("You don't have any groups with write access");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,21 +75,22 @@ class Clubs
|
||||||
|
|
||||||
function getWriteableClubs(int $id): \Traversable
|
function getWriteableClubs(int $id): \Traversable
|
||||||
{
|
{
|
||||||
$result = $this->clubs->where(["owner" => $id]);
|
$result = $this->clubs->where("owner", $id);
|
||||||
$coadmins = $this->coadmins->where(["user" => $id]);
|
$coadmins = $this->coadmins->where("user", $id);
|
||||||
|
|
||||||
foreach($result as $entry)
|
foreach($result as $entry) {
|
||||||
yield new Club($entry);
|
yield new Club($entry);
|
||||||
|
}
|
||||||
foreach($coadmins as $coadmin)
|
|
||||||
|
foreach($coadmins as $coadmin) {
|
||||||
$cl = new Manager($coadmin);
|
$cl = new Manager($coadmin);
|
||||||
yield $cl->getClub();
|
yield $cl->getClub();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWriteableClubsCount(int $id): int
|
function getWriteableClubsCount(int $id): int
|
||||||
{
|
{
|
||||||
return sizeof($this->clubs->where(["owner" => $id])) + sizeof($this->coadmins->where(["user" => $id]));
|
return sizeof($this->clubs->where("owner", $id)) + sizeof($this->coadmins->where("user", $id));
|
||||||
}
|
}
|
||||||
|
|
||||||
use \Nette\SmartObject;
|
use \Nette\SmartObject;
|
||||||
|
|
|
@ -217,7 +217,7 @@ async function repostPost(id, hash) {
|
||||||
document.getElementById("reposts"+id).insertAdjacentHTML("beforeend", "(<b id='repostsCount"+id+"'>1</b>)") //для старого вида постов
|
document.getElementById("reposts"+id).insertAdjacentHTML("beforeend", "(<b id='repostsCount"+id+"'>1</b>)") //для старого вида постов
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
xhr.send('text=' + encodeURI(text) + '&type=' + encodeURI(type) + '&groupId=' + encodeURI(groupId) + "&asGroup="+encodeURI(asGroup) + "&signed="+encodeURI(signed));
|
xhr.send('text='+encodeURI(text) + '&type='+type + '&groupId='+groupId + "&asGroup="+asGroup + "&signed="+signed);
|
||||||
}),
|
}),
|
||||||
Function.noop
|
Function.noop
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue