mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 12:34:39 +02:00
Add menu entry to directly collapse posts
This commit is contained in:
parent
28185c12fc
commit
1744f6b2c3
7 changed files with 182 additions and 110 deletions
16
mod/item.php
16
mod/item.php
|
@ -384,6 +384,22 @@ function item_content(App $a)
|
|||
|
||||
Contact\User::setIgnored($item['author-id'], DI::userSession()->getLocalUserId(), true);
|
||||
|
||||
if (DI::mode()->isAjax()) {
|
||||
// ajax return: [<item id>, 0 (no perm) | <owner id>]
|
||||
System::jsonExit([intval($args->get(2)), DI::userSession()->getLocalUserId()]);
|
||||
} else {
|
||||
item_redirect_after_action($item, $args->get(3));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'collapse':
|
||||
$item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), ['guid', 'author-id', 'parent', 'gravity'], ['id' => $args->get(2)]);
|
||||
if (empty($item['author-id'])) {
|
||||
throw new HTTPException\NotFoundException('Item not found');
|
||||
}
|
||||
|
||||
Contact\User::setCollapsed($item['author-id'], DI::userSession()->getLocalUserId(), true);
|
||||
|
||||
if (DI::mode()->isAjax()) {
|
||||
// ajax return: [<item id>, 0 (no perm) | <owner id>]
|
||||
System::jsonExit([intval($args->get(2)), DI::userSession()->getLocalUserId()]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue