|
|
|
@ -43,6 +43,9 @@ class ActivityController extends AbstractController
@@ -43,6 +43,9 @@ class ActivityController extends AbstractController
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/list.html.twig', |
|
|
|
|
[ |
|
|
|
|
'session' => [ |
|
|
|
|
'user' => $user |
|
|
|
|
], |
|
|
|
|
'activities' => $activityService->findLastActivities( // @TODO locale/sensitive filters |
|
|
|
|
$user->getEvents(), |
|
|
|
|
$this->getParameter('app.pagination'), |
|
|
|
@ -59,7 +62,8 @@ class ActivityController extends AbstractController
@@ -59,7 +62,8 @@ class ActivityController extends AbstractController
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function event( |
|
|
|
|
$activity, |
|
|
|
|
\App\Entity\User $user, |
|
|
|
|
\App\Entity\Activity $activity, |
|
|
|
|
ActivityService $activityService, |
|
|
|
|
UserService $userService, |
|
|
|
|
TorrentService $torrentService, |
|
|
|
@ -347,6 +351,12 @@ class ActivityController extends AbstractController
@@ -347,6 +351,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
// Torrent |
|
|
|
|
case $activity::EVENT_TORRENT_ADD: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/add.html.twig', |
|
|
|
|
[ |
|
|
|
@ -362,10 +372,22 @@ class ActivityController extends AbstractController
@@ -362,10 +372,22 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName() |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -374,6 +396,12 @@ class ActivityController extends AbstractController
@@ -374,6 +396,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
|
|
|
|
|
case $activity::EVENT_TORRENT_APPROVE_ADD: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/approve/add.html.twig', |
|
|
|
|
[ |
|
|
|
@ -389,10 +417,22 @@ class ActivityController extends AbstractController
@@ -389,10 +417,22 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName() |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -401,6 +441,12 @@ class ActivityController extends AbstractController
@@ -401,6 +441,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
|
|
|
|
|
case $activity::EVENT_TORRENT_APPROVE_DELETE: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/approve/delete.html.twig', |
|
|
|
|
[ |
|
|
|
@ -416,10 +462,22 @@ class ActivityController extends AbstractController
@@ -416,10 +462,22 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName() |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -429,6 +487,12 @@ class ActivityController extends AbstractController
@@ -429,6 +487,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
// Torrent Download |
|
|
|
|
case $activity::EVENT_TORRENT_DOWNLOAD_FILE_ADD: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/download/file/add.html.twig', |
|
|
|
|
[ |
|
|
|
@ -444,10 +508,22 @@ class ActivityController extends AbstractController
@@ -444,10 +508,22 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName() |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -456,6 +532,12 @@ class ActivityController extends AbstractController
@@ -456,6 +532,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
|
|
|
|
|
case $activity::EVENT_TORRENT_DOWNLOAD_MAGNET_ADD: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/download/magnet/add.html.twig', |
|
|
|
|
[ |
|
|
|
@ -471,10 +553,22 @@ class ActivityController extends AbstractController
@@ -471,10 +553,22 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName() |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -484,6 +578,12 @@ class ActivityController extends AbstractController
@@ -484,6 +578,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
/// Torrent Locales |
|
|
|
|
case $activity::EVENT_TORRENT_LOCALES_ADD: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/locales/add.html.twig', |
|
|
|
|
[ |
|
|
|
@ -499,16 +599,28 @@ class ActivityController extends AbstractController
@@ -499,16 +599,28 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName(), |
|
|
|
|
'locales' => [ |
|
|
|
|
'locales' => [ |
|
|
|
|
'id' => $activity->getData()['torrentLocalesId'], |
|
|
|
|
'exist' => $torrentService->getTorrentLocales( |
|
|
|
|
'exist' => $torrentService->getTorrentLocales( |
|
|
|
|
$activity->getData()['torrentLocalesId'] // could be deleted by moderator, remove links |
|
|
|
|
) |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -517,6 +629,12 @@ class ActivityController extends AbstractController
@@ -517,6 +629,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
|
|
|
|
|
case $activity::EVENT_TORRENT_LOCALES_DELETE: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/locales/delete.html.twig', |
|
|
|
|
[ |
|
|
|
@ -532,16 +650,28 @@ class ActivityController extends AbstractController
@@ -532,16 +650,28 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName(), |
|
|
|
|
'locales' => [ |
|
|
|
|
'id' => $activity->getData()['torrentLocalesId'], |
|
|
|
|
'locales' => [ |
|
|
|
|
'id' => $activity->getData()['torrentLocalesId'], |
|
|
|
|
'exist' => $torrentService->getTorrentLocales( |
|
|
|
|
$activity->getData()['torrentLocalesId'] // could be deleted by moderator, remove links |
|
|
|
|
) |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -550,6 +680,12 @@ class ActivityController extends AbstractController
@@ -550,6 +680,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
|
|
|
|
|
case $activity::EVENT_TORRENT_LOCALES_APPROVE_ADD: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/locales/approve/add.html.twig', |
|
|
|
|
[ |
|
|
|
@ -565,16 +701,28 @@ class ActivityController extends AbstractController
@@ -565,16 +701,28 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName(), |
|
|
|
|
'locales' => [ |
|
|
|
|
'id' => $activity->getData()['torrentLocalesId'], |
|
|
|
|
'locales' => [ |
|
|
|
|
'id' => $activity->getData()['torrentLocalesId'], |
|
|
|
|
'exist' => $torrentService->getTorrentLocales( |
|
|
|
|
$activity->getData()['torrentLocalesId'] // could be deleted by moderator, remove links |
|
|
|
|
) |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -583,6 +731,12 @@ class ActivityController extends AbstractController
@@ -583,6 +731,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
|
|
|
|
|
case $activity::EVENT_TORRENT_LOCALES_APPROVE_DELETE: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/locales/approve/delete.html.twig', |
|
|
|
|
[ |
|
|
|
@ -598,16 +752,28 @@ class ActivityController extends AbstractController
@@ -598,16 +752,28 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName(), |
|
|
|
|
'locales' => [ |
|
|
|
|
'id' => $activity->getData()['torrentLocalesId'], |
|
|
|
|
'locales' => [ |
|
|
|
|
'id' => $activity->getData()['torrentLocalesId'], |
|
|
|
|
'exist' => $torrentService->getTorrentLocales( |
|
|
|
|
$activity->getData()['torrentLocalesId'] // could be deleted by moderator, remove links |
|
|
|
|
) |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -617,6 +783,12 @@ class ActivityController extends AbstractController
@@ -617,6 +783,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
/// Torrent Sensitive |
|
|
|
|
case $activity::EVENT_TORRENT_SENSITIVE_ADD: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/sensitive/add.html.twig', |
|
|
|
|
[ |
|
|
|
@ -632,16 +804,28 @@ class ActivityController extends AbstractController
@@ -632,16 +804,28 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName(), |
|
|
|
|
'sensitive' => [ |
|
|
|
|
'id' => $activity->getData()['torrentSensitiveId'], |
|
|
|
|
'id' => $activity->getData()['torrentSensitiveId'], |
|
|
|
|
'exist' => $torrentService->getTorrentSensitive( |
|
|
|
|
$activity->getData()['torrentSensitiveId'] // could be deleted by moderator, remove links |
|
|
|
|
) |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -650,6 +834,12 @@ class ActivityController extends AbstractController
@@ -650,6 +834,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
|
|
|
|
|
case $activity::EVENT_TORRENT_SENSITIVE_DELETE: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/sensitive/delete.html.twig', |
|
|
|
|
[ |
|
|
|
@ -665,16 +855,28 @@ class ActivityController extends AbstractController
@@ -665,16 +855,28 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName(), |
|
|
|
|
'sensitive' => [ |
|
|
|
|
'id' => $activity->getData()['torrentSensitiveId'], |
|
|
|
|
'id' => $activity->getData()['torrentSensitiveId'], |
|
|
|
|
'exist' => $torrentService->getTorrentSensitive( |
|
|
|
|
$activity->getData()['torrentSensitiveId'] // could be deleted by moderator, remove links |
|
|
|
|
) |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -683,6 +885,12 @@ class ActivityController extends AbstractController
@@ -683,6 +885,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
|
|
|
|
|
case $activity::EVENT_TORRENT_SENSITIVE_APPROVE_ADD: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/sensitive/approve/add.html.twig', |
|
|
|
|
[ |
|
|
|
@ -698,16 +906,28 @@ class ActivityController extends AbstractController
@@ -698,16 +906,28 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName(), |
|
|
|
|
'sensitive' => [ |
|
|
|
|
'id' => $activity->getData()['torrentSensitiveId'], |
|
|
|
|
'id' => $activity->getData()['torrentSensitiveId'], |
|
|
|
|
'exist' => $torrentService->getTorrentSensitive( |
|
|
|
|
$activity->getData()['torrentSensitiveId'] // could be deleted by moderator, remove links |
|
|
|
|
) |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -716,6 +936,12 @@ class ActivityController extends AbstractController
@@ -716,6 +936,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
|
|
|
|
|
case $activity::EVENT_TORRENT_SENSITIVE_APPROVE_DELETE: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/sensitive/approve/delete.html.twig', |
|
|
|
|
[ |
|
|
|
@ -731,16 +957,28 @@ class ActivityController extends AbstractController
@@ -731,16 +957,28 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName(), |
|
|
|
|
'sensitive' => [ |
|
|
|
|
'id' => $activity->getData()['torrentSensitiveId'], |
|
|
|
|
'id' => $activity->getData()['torrentSensitiveId'], |
|
|
|
|
'exist' => $torrentService->getTorrentSensitive( |
|
|
|
|
$activity->getData()['torrentSensitiveId'] // could be deleted by moderator, remove links |
|
|
|
|
) |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -750,6 +988,12 @@ class ActivityController extends AbstractController
@@ -750,6 +988,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
/// Torrent star |
|
|
|
|
case $activity::EVENT_TORRENT_STAR_ADD: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/star/add.html.twig', |
|
|
|
|
[ |
|
|
|
@ -765,10 +1009,22 @@ class ActivityController extends AbstractController
@@ -765,10 +1009,22 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName() |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
@ -777,6 +1033,12 @@ class ActivityController extends AbstractController
@@ -777,6 +1033,12 @@ class ActivityController extends AbstractController
|
|
|
|
|
|
|
|
|
|
case $activity::EVENT_TORRENT_STAR_DELETE: |
|
|
|
|
|
|
|
|
|
// Init torrent |
|
|
|
|
if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) |
|
|
|
|
{ |
|
|
|
|
throw $this->createNotFoundException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|
'default/activity/event/torrent/star/delete.html.twig', |
|
|
|
|
[ |
|
|
|
@ -792,18 +1054,28 @@ class ActivityController extends AbstractController
@@ -792,18 +1054,28 @@ class ActivityController extends AbstractController
|
|
|
|
|
], |
|
|
|
|
'torrent' => |
|
|
|
|
[ |
|
|
|
|
'id' => $activity->getTorrentId(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$activity->getTorrentId() |
|
|
|
|
'id' => $torrent->getId(), |
|
|
|
|
'sensitive' => $torrent->isSensitive(), |
|
|
|
|
'approved' => $torrent->isApproved(), |
|
|
|
|
'name' => $torrentService->readTorrentFileByTorrentId( |
|
|
|
|
$torrent->getId() |
|
|
|
|
)->getName() |
|
|
|
|
], |
|
|
|
|
'session' => |
|
|
|
|
[ |
|
|
|
|
'user' => |
|
|
|
|
[ |
|
|
|
|
'id' => $user->getId(), |
|
|
|
|
'sensitive' => $user->isSensitive(), |
|
|
|
|
'moderator' => $user->isModerator(), |
|
|
|
|
'owner' => $user->getId() === $torrent->getUserId(), |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
// @TODO Page |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
|
|
return $this->render( |
|
|
|
|