public function removeAction($mediaId)
    {
        $media = $this->getMedia($mediaId);
        $request = $this->getRequest();
        if ($request->request->get('confirm') === 'yes' || $request->get('confirm') === 'yes')
        {
            $this->get('fulgurio_light_cms.media_library')->remove($media);
            $em = $this->getDoctrine()->getManager();
            $em->remove($media);
            $em->flush();
            return $this->redirect($this->generateUrl('AdminMedias'));
        }
        else if ($request->request->get('confirm') === 'no')
        {
            return $this->redirect($this->generateUrl('AdminMedias', array('mediaId' => $mediaId)));
        }
        $templateName = $request->isXmlHttpRequest() ? 'FulgurioLightCMSBundle::adminConfirmAjax.html.twig' : 'FulgurioLightCMSBundle::adminConfirm.html.twig';
        return $this->render($templateName, array(
            'action' => $this->generateUrl('AdminMediasRemove', array('mediaId' => $mediaId)),
            'confirmationMessage' => $this->get('translator')->trans('fulgurio.lightcms.medias.delete_confirm_message', array('%FILENAME%' => $media->getOriginalName()), 'admin'),
        ));
    }
public function removeAction($mediaId)
    {
        $media = $this->getMedia($mediaId);
        $request = $this->getRequest();
        if ($request->request->get('confirm') === 'yes' || $request->get('confirm') === 'yes')
        {
            $this->get('fulgurio_light_cms.media_library')->remove($media);
            $em = $this->getDoctrine()->getManager();
            $em->remove($media);
            $em->flush();
            return $this->redirect($this->generateUrl('AdminMedias'));
        }
        else if ($request->request->get('confirm') === 'no')
        {
            return $this->redirect($this->generateUrl('AdminMedias', array('mediaId' => $mediaId)));
        }
        $templateName = $request->isXmlHttpRequest() ? 'FulgurioLightCMSBundle::adminConfirmAjax.html.twig' : 'FulgurioLightCMSBundle::adminConfirm.html.twig';
        return $this->render($templateName, array(
            'action' => $this->generateUrl('AdminMediasRemove', array('mediaId' => $mediaId)),
            'confirmationMessage' => $this->get('translator')->trans('fulgurio.lightcms.medias.delete_confirm_message', array('%FILENAME%' => $media->getOriginalName()), 'admin'),
        ));
    }
public function removeAction ( $ mediaId ) { $ media = $ this -> getMedia ( $ mediaId ) ; $ request = $ this -> getRequest ( ) ; if ( $ request -> request -> get ( 'confirm' ) === 'yes' || $ request -> get ( 'confirm' ) === 'yes' ) { $ this -> get ( 'fulgurio_light_cms.media_library' ) -> remove ( $ media ) ; $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> remove ( $ media ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'AdminMedias' ) ) ; } else if ( $ request -> request -> get ( 'confirm' ) === 'no' ) { return $ this -> redirect ( $ this -> generateUrl ( 'AdminMedias' , array ( 'mediaId' => $ mediaId ) ) ) ; } $ templateName = $ request -> isXmlHttpRequest ( ) ? 'FulgurioLightCMSBundle::adminConfirmAjax.html.twig' : 'FulgurioLightCMSBundle::adminConfirm.html.twig' ; return $ this -> render ( $ templateName , array ( 'action' => $ this -> generateUrl ( 'AdminMediasRemove' , array ( 'mediaId' => $ mediaId ) ) , 'confirmationMessage' => $ this -> get ( 'translator' ) -> trans ( 'fulgurio.lightcms.medias.delete_confirm_message' , array ( '%FILENAME%' => $ media -> getOriginalName ( ) ) , 'admin' ) , ) ) ; }
Remove media, with confirm form

@param number $mediaId
Remove media with confirm form