@@ 315-326 (lines=12) @@ | ||
312 | * |
|
313 | * @throws AccessDeniedException |
|
314 | */ |
|
315 | public function publishAction(Request $request, $id) |
|
316 | { |
|
317 | $this->init($request); |
|
318 | /* @var Node $node */ |
|
319 | $node = $this->em->getRepository(Node::class)->find($id); |
|
320 | ||
321 | $nodeTranslation = $node->getNodeTranslation($this->locale, true); |
|
322 | $request = $this->get('request_stack')->getCurrentRequest(); |
|
323 | $this->nodePublisher->chooseHowToPublish($request, $nodeTranslation, $this->translator); |
|
324 | ||
325 | return $this->redirect($this->generateUrl('KunstmaanNodeBundle_nodes_edit', array('id' => $node->getId()))); |
|
326 | } |
|
327 | ||
328 | /** |
|
329 | * @Route( |
|
@@ 343-354 (lines=12) @@ | ||
340 | * |
|
341 | * @throws AccessDeniedException |
|
342 | */ |
|
343 | public function unPublishAction(Request $request, $id) |
|
344 | { |
|
345 | $this->init($request); |
|
346 | /* @var Node $node */ |
|
347 | $node = $this->em->getRepository(Node::class)->find($id); |
|
348 | ||
349 | $nodeTranslation = $node->getNodeTranslation($this->locale, true); |
|
350 | $request = $this->get('request_stack')->getCurrentRequest(); |
|
351 | $this->nodePublisher->chooseHowToUnpublish($request, $nodeTranslation, $this->translator); |
|
352 | ||
353 | return $this->redirect($this->generateUrl('KunstmaanNodeBundle_nodes_edit', array('id' => $node->getId()))); |
|
354 | } |
|
355 | ||
356 | /** |
|
357 | * @Route( |
|
@@ 371-387 (lines=17) @@ | ||
368 | * |
|
369 | * @throws AccessDeniedException |
|
370 | */ |
|
371 | public function unSchedulePublishAction(Request $request, $id) |
|
372 | { |
|
373 | $this->init($request); |
|
374 | ||
375 | /* @var Node $node */ |
|
376 | $node = $this->em->getRepository(Node::class)->find($id); |
|
377 | ||
378 | $nodeTranslation = $node->getNodeTranslation($this->locale, true); |
|
379 | $this->nodePublisher->unSchedulePublish($nodeTranslation); |
|
380 | ||
381 | $this->addFlash( |
|
382 | FlashTypes::SUCCESS, |
|
383 | $this->get('translator')->trans('kuma_node.admin.unschedule.flash.success') |
|
384 | ); |
|
385 | ||
386 | return $this->redirect($this->generateUrl('KunstmaanNodeBundle_nodes_edit', array('id' => $id))); |
|
387 | } |
|
388 | ||
389 | /** |
|
390 | * @Route( |