[Favourite] Add backend support for favourite

This commit is contained in:
rainydaysavings
2020-09-04 15:18:58 +01:00
committed by Hugo Sales
parent b6fb0255da
commit 8a0418d8cf
4 changed files with 87 additions and 10 deletions

View File

@@ -30,6 +30,8 @@
namespace App\Twig;
use App\Core\Event;
use App\Entity\Note;
use App\Util\Formatting;
use Functional as F;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -56,6 +58,13 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface
return F\some($routes, F\partial_left([Formatting::class, 'startsWith'], $current_route)) ? $class : '';
}
public function getNoteActions(Note $note)
{
$actions = [];
Event::handle('add_note_actions', [$this->request, $note, &$actions]);
return $actions;
}
// ----------------------------------------------------------
// Request is not a service, can't find a better way to get it