From 193aeac25c23e03992fc8d6eb48a9e07c5dd00c2 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Fri, 21 Sep 2012 16:09:38 +0200 Subject: [PATCH] Update lightbox controller --- lib/Alchemy/Phrasea/Application/Lightbox.php | 46 ++------------------ 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/lib/Alchemy/Phrasea/Application/Lightbox.php b/lib/Alchemy/Phrasea/Application/Lightbox.php index 38c0d22a05..c8774c0413 100644 --- a/lib/Alchemy/Phrasea/Application/Lightbox.php +++ b/lib/Alchemy/Phrasea/Application/Lightbox.php @@ -11,10 +11,10 @@ namespace Alchemy\Phrasea\Application; +use Alchemy\Phrasea\Controller\Exception as ControllerException; use Silex\ControllerProviderInterface; use Silex\Application as SilexApplication; use Symfony\Component\HttpFoundation\Response; -use Alchemy\Phrasea\Controller\Exception as ControllerException; class Lightbox implements ControllerProviderInterface { @@ -427,7 +427,7 @@ class Lightbox implements ControllerProviderInterface /* @var $basket \Entities\Basket */ $participant = $basket->getValidation()->getParticipant($user, $app); - $evt_mngr = \eventsmanager_broker::getInstance($app); + $evt_mngr = $app['events-manager']; $expires = new \DateTime('+10 days'); $url = $app['phraseanet.appbox']->get_registry()->get('GV_ServerName') @@ -462,46 +462,6 @@ class Lightbox implements ControllerProviderInterface } )->assert('ssel_id', '\d+'); - $app->error(function($e) use($app) { - - $registry = $app['phraseanet.registry']; - - $template = 'lightbox/error.html.twig'; - - if ($e instanceof Exception_Feed_EntryNotFound) { - $message = _('Feed entry not found'); - } else { - $message = _('Le panier demande nexiste plus'); - } - - - if ($registry->get('GV_debug')) { - $options = array( - 'module' => 'validation', - 'module_name' => _('admin::monitor: module validation'), - 'error' => sprintf( - '%s in %s on line %s ' - , $e->getMessage() - , $e->getFile() - , $e->getLine() - ), - 'message' => $message, - ); - } else { - $options = array( - 'module' => 'validation', - 'module_name' => _('admin::monitor: module validation'), - 'error' => '', - 'message' => $message, - ); - } - $output = $app['twig']->render($template, $options); - $response = new Response($output, 404, array('X-Status-Code' => 404)); - $response->setCharset('UTF-8'); - - return $response; - }); - return $controllers; } -} +} \ No newline at end of file