share(function (PhraseaApplication $app) { return (new PushController($app)) ->setDataboxLoggerLocator($app['phraseanet.logger']) ->setDispatcher($app['dispatcher']) ->setEntityManagerLocator(new LazyLocator($app, 'orm.em')) ->setUserQueryFactory(new LazyLocator($app, 'phraseanet.user-query')) ; }); } public function boot(Application $app) { // no-op } public function connect(Application $app) { $controllers = $this->createAuthenticatedCollection($app); $firewall = $this->getFirewall($app); $controllers->before(function () use ($firewall) { $firewall->requireRight(\ACL::CANPUSH); }); $controllers->post('/sendform/', 'controller.prod.push:postFormAction'); $controllers->post('/validateform/', 'controller.prod.push:validateFormAction'); $controllers->post('/send/', 'controller.prod.push:sendAction') ->bind('prod_push_send'); $controllers->post('/validate/', 'controller.prod.push:validateAction') ->bind('prod_push_validate'); $controllers->get('/user/{usr_id}/', 'controller.prod.push:getUserAction') ->assert('usr_id', '\d+'); $controllers->get('/list/{list_id}/', 'controller.prod.push:getListAction') ->bind('prod_push_lists_list') ->assert('list_id', '\d+'); $controllers->post('/add-user/', 'controller.prod.push:addUserAction') ->bind('prod_push_do_add_user'); $controllers->get('/add-user/', 'controller.prod.push:getAddUserFormAction') ->bind('prod_push_add_user'); $controllers->get('/search-user/', 'controller.prod.push:searchUserAction'); $controllers->match('/edit-list/{list_id}/', 'controller.prod.push:editListAction') ->bind('prod_push_list_edit') ->assert('list_id', '\d+'); return $controllers; } }