|
@@ -7,6 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
|
7
|
7
|
use Muzich\CoreBundle\Security\Context as SecurityContext;
|
8
|
8
|
use Muzich\CoreBundle\Propagator\EventElement;
|
9
|
9
|
use Muzich\CoreBundle\Form\Playlist\PrivateLinksForm;
|
|
10
|
+use Muzich\CoreBundle\Entity\Playlist;
|
10
|
11
|
|
11
|
12
|
class EditController extends Controller
|
12
|
13
|
{
|
|
@@ -45,7 +46,24 @@ class EditController extends Controller
|
45
|
46
|
|
46
|
47
|
$this->persist($element);
|
47
|
48
|
$this->flush();
|
48
|
|
- return $this->jsonSuccessResponse();
|
|
49
|
+ return $this->jsonSuccessResponse(array(
|
|
50
|
+ 'element_remove_links' => $this->getRemoveLinksForPlaylist($playlist)
|
|
51
|
+ ));
|
|
52
|
+ }
|
|
53
|
+
|
|
54
|
+ protected function getRemoveLinksForPlaylist(Playlist $playlist)
|
|
55
|
+ {
|
|
56
|
+ $element_remove_urls = array();
|
|
57
|
+ foreach ($playlist->getElements() as $index => $element_data)
|
|
58
|
+ {
|
|
59
|
+ $element_remove_urls[] = $this->generateUrl('playlist_remove_element', array(
|
|
60
|
+ 'playlist_id' => $playlist->getId(),
|
|
61
|
+ 'index' => $index,
|
|
62
|
+ 'token' => $this->getToken()
|
|
63
|
+ ));
|
|
64
|
+ }
|
|
65
|
+
|
|
66
|
+ return $element_remove_urls;
|
49
|
67
|
}
|
50
|
68
|
|
51
|
69
|
public function addElementAction($playlist_id, $element_id)
|