mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
Fix CS
This commit is contained in:
@@ -182,7 +182,7 @@ class Application extends SilexApplication
|
||||
|
||||
$this['charset'] = 'UTF-8';
|
||||
|
||||
$this['debug'] = $this->share(function(Application $app) {
|
||||
$this['debug'] = $this->share(function (Application $app) {
|
||||
return Application::ENV_PROD !== $app->getEnvironment();
|
||||
});
|
||||
|
||||
@@ -209,7 +209,7 @@ class Application extends SilexApplication
|
||||
});
|
||||
|
||||
$this->register(new MediaAlchemystServiceProvider());
|
||||
$this['media-alchemyst.configuration'] = $this->share(function(Application $app) {
|
||||
$this['media-alchemyst.configuration'] = $this->share(function (Application $app) {
|
||||
$configuration = array();
|
||||
|
||||
foreach (array(
|
||||
@@ -240,7 +240,7 @@ class Application extends SilexApplication
|
||||
|
||||
return $configuration;
|
||||
});
|
||||
$this['media-alchemyst.logger'] = $this->share(function(Application $app) {
|
||||
$this['media-alchemyst.logger'] = $this->share(function (Application $app) {
|
||||
return $app['monolog'];
|
||||
});
|
||||
|
||||
@@ -344,7 +344,7 @@ class Application extends SilexApplication
|
||||
return $transport;
|
||||
});
|
||||
|
||||
$this['imagine.factory'] = $this->share(function(Application $app) {
|
||||
$this['imagine.factory'] = $this->share(function (Application $app) {
|
||||
if ($app['phraseanet.registry']->get('GV_imagine_driver') != '') {
|
||||
return $app['phraseanet.registry']->get('GV_imagine_driver');
|
||||
}
|
||||
@@ -362,7 +362,7 @@ class Application extends SilexApplication
|
||||
});
|
||||
|
||||
$app = $this;
|
||||
$this['phraseanet.logger'] = $this->protect(function($databox) use ($app) {
|
||||
$this['phraseanet.logger'] = $this->protect(function ($databox) use ($app) {
|
||||
try {
|
||||
return \Session_Logger::load($app, $databox);
|
||||
} catch (\Exception_Session_LoggerNotFound $e) {
|
||||
@@ -370,12 +370,12 @@ class Application extends SilexApplication
|
||||
}
|
||||
});
|
||||
|
||||
$this['date-formatter'] = $this->share(function(Application $app) {
|
||||
$this['date-formatter'] = $this->share(function (Application $app) {
|
||||
return new \phraseadate($app);
|
||||
});
|
||||
|
||||
$this['xpdf.pdftotext'] = $this->share(
|
||||
$this->extend('xpdf.pdftotext', function(PdfToText $pdftotext, Application $app){
|
||||
$this->extend('xpdf.pdftotext', function (PdfToText $pdftotext, Application $app) {
|
||||
if ($app['phraseanet.registry']->get('GV_pdfmaxpages')) {
|
||||
$pdftotext->setPageQuantity($app['phraseanet.registry']->get('GV_pdfmaxpages'));
|
||||
}
|
||||
@@ -385,7 +385,7 @@ class Application extends SilexApplication
|
||||
);
|
||||
|
||||
$this['dispatcher'] = $this->share(
|
||||
$this->extend('dispatcher', function($dispatcher, Application $app){
|
||||
$this->extend('dispatcher', function ($dispatcher, Application $app) {
|
||||
$dispatcher->addListener(KernelEvents::REQUEST, array($app, 'initSession'), 254);
|
||||
$dispatcher->addListener(KernelEvents::RESPONSE, array($app, 'addUTF8Charset'), -128);
|
||||
$dispatcher->addSubscriber(new LogoutSubscriber());
|
||||
@@ -535,7 +535,7 @@ class Application extends SilexApplication
|
||||
|
||||
private function setupUrlGenerator()
|
||||
{
|
||||
$this['url_generator'] = $this->share($this->extend('url_generator', function($urlGenerator, $app) {
|
||||
$this['url_generator'] = $this->share($this->extend('url_generator', function ($urlGenerator, $app) {
|
||||
if ($app['phraseanet.configuration']->isSetup()) {
|
||||
$data = parse_url($app['phraseanet.configuration']['main']['servername']);
|
||||
|
||||
|
@@ -22,7 +22,7 @@ use Alchemy\Phrasea\Core\Event\Subscriber\ApiExceptionHandlerSubscriber;
|
||||
use Silex\Application as SilexApplication;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
return call_user_func(function($environment = PhraseaApplication::ENV_PROD) {
|
||||
return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
|
||||
|
||||
$app = new PhraseaApplication($environment);
|
||||
$app->loadPlugins();
|
||||
@@ -34,7 +34,7 @@ return call_user_func(function($environment = PhraseaApplication::ENV_PROD) {
|
||||
$app->register(new \API_V1_Timer());
|
||||
$app['dispatcher']->dispatch(PhraseaEvents::API_LOAD_START, new ApiLoadStartEvent());
|
||||
|
||||
$app->get('/api/', function(Request $request, SilexApplication $app) {
|
||||
$app->get('/api/', function (Request $request, SilexApplication $app) {
|
||||
$apiAdapter = new \API_V1_adapter($app);
|
||||
|
||||
$result = new \API_V1_result($app, $request, $apiAdapter);
|
||||
|
@@ -20,7 +20,7 @@ use Alchemy\Phrasea\Core\Event\Subscriber\DebuggerSubscriber;
|
||||
use Silex\Provider\WebProfilerServiceProvider;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
return call_user_func(function($environment = PhraseaApplication::ENV_PROD) {
|
||||
return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
|
||||
|
||||
$app = new PhraseaApplication($environment);
|
||||
$app->loadPlugins();
|
||||
@@ -57,7 +57,7 @@ return call_user_func(function($environment = PhraseaApplication::ENV_PROD) {
|
||||
}
|
||||
|
||||
$app['dispatcher'] = $app->share(
|
||||
$app->extend('dispatcher', function($dispatcher, PhraseaApplication $app){
|
||||
$app->extend('dispatcher', function ($dispatcher, PhraseaApplication $app) {
|
||||
$dispatcher->addSubscriber(new BridgeExceptionSubscriber($app));
|
||||
$dispatcher->addSubscriber(new FirewallSubscriber());
|
||||
$dispatcher->addSubscriber(new JsonRequestSubscriber());
|
||||
|
@@ -46,7 +46,7 @@ class CLI extends Application
|
||||
return new Console\Application($name, $version);
|
||||
});
|
||||
|
||||
$this['dispatcher']->addListener('phraseanet.notification.sent', function() use ($app) {
|
||||
$this['dispatcher']->addListener('phraseanet.notification.sent', function () use ($app) {
|
||||
$app['swiftmailer.spooltransport']->getSpool()->flushQueue($app['swiftmailer.transport']);
|
||||
});
|
||||
|
||||
|
@@ -39,14 +39,14 @@ abstract class Command extends SymfoCommand implements CommandInterface
|
||||
$handler = new StreamHandler('php://stdout');
|
||||
|
||||
$this->container['monolog'] = $this->container->share(
|
||||
$this->container->extend('monolog', function($logger, $app) use ($handler) {
|
||||
$this->container->extend('monolog', function ($logger, $app) use ($handler) {
|
||||
$logger->pushHandler($handler);
|
||||
|
||||
return $logger;
|
||||
})
|
||||
);
|
||||
$this->container['task-manager.logger'] = $this->container->share(
|
||||
$this->container->extend('task-manager.logger', function($logger, $app) use ($handler) {
|
||||
$this->container->extend('task-manager.logger', function ($logger, $app) use ($handler) {
|
||||
$logger->pushHandler($handler);
|
||||
|
||||
return $logger;
|
||||
|
@@ -25,7 +25,7 @@ class Collection implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAccessToModule('admin')
|
||||
->requireRightOnBase($app['request']->attributes->get('bas_id'), 'canadmin');
|
||||
});
|
||||
|
@@ -23,7 +23,7 @@ class ConnectedUsers implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAccessToModule('Admin');
|
||||
});
|
||||
|
||||
|
@@ -31,7 +31,7 @@ class Dashboard implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAdmin();
|
||||
});
|
||||
|
||||
|
@@ -28,7 +28,7 @@ class Databox implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAccessToModule('admin')
|
||||
->requireAccessToSbas($request->attributes->get('databox_id'));
|
||||
});
|
||||
@@ -65,7 +65,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/delete/', $this->call('deleteBase'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_delete');
|
||||
|
||||
@@ -84,7 +84,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/unmount/', $this->call('unmountDatabase'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_unmount');
|
||||
|
||||
@@ -103,7 +103,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/empty/', $this->call('emptyDatabase'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_empty');
|
||||
|
||||
@@ -122,7 +122,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->get('/{databox_id}/collections/order/', $this->call('getReorder'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_display_collections_order');
|
||||
|
||||
@@ -141,7 +141,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/collections/order/', $this->call('setReorder'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_submit_collections_order');
|
||||
|
||||
@@ -160,7 +160,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/collection/', $this->call('createCollection'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})
|
||||
->bind('admin_database_submit_collection');
|
||||
@@ -180,13 +180,13 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->get('/{databox_id}/cgus/', $this->call('getDatabaseCGU'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_modify_struct');
|
||||
})->bind('admin_database_display_cgus');
|
||||
|
||||
$controllers->post('/{databox_id}/labels/', $this->call('setLabels'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_databox_labels');
|
||||
|
||||
@@ -205,7 +205,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/cgus/', $this->call('updateDatabaseCGU'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_modify_struct');
|
||||
})->bind('admin_database_submit_cgus');
|
||||
|
||||
@@ -224,7 +224,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->get('/{databox_id}/informations/documents/', $this->call('progressBarInfos'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_display_document_information');
|
||||
|
||||
@@ -243,7 +243,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->get('/{databox_id}/informations/details/', $this->call('getDetails'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_display_document_details');
|
||||
|
||||
@@ -263,7 +263,7 @@ class Databox implements ControllerProviderInterface
|
||||
$controllers->post('/{databox_id}/collection/{collection_id}/mount/', $this->call('mountCollection'))
|
||||
->assert('databox_id', '\d+')
|
||||
->assert('collection_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_mount_collection');
|
||||
|
||||
@@ -282,7 +282,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->get('/{databox_id}/collection/', $this->call('getNewCollection'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_display_new_collection_form');
|
||||
|
||||
@@ -301,7 +301,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/logo/', $this->call('sendLogoPdf'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_submit_logo');
|
||||
|
||||
@@ -320,7 +320,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/logo/delete/', $this->call('deleteLogoPdf'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_delete_logo');
|
||||
|
||||
@@ -339,7 +339,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/clear-logs/', $this->call('clearLogs'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_clear_logs');
|
||||
|
||||
@@ -358,7 +358,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/reindex/', $this->call('reindex'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_reindex');
|
||||
|
||||
@@ -377,7 +377,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/indexable/', $this->call('setIndexable'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_set_indexable');
|
||||
|
||||
@@ -396,7 +396,7 @@ class Databox implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/{databox_id}/view-name/', $this->call('changeViewName'))
|
||||
->assert('databox_id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage');
|
||||
})->bind('admin_database_rename');
|
||||
|
||||
|
@@ -29,7 +29,7 @@ class Databoxes implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAccessToModule('admin');
|
||||
});
|
||||
|
||||
@@ -64,7 +64,7 @@ class Databoxes implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/', $this->call('createDatabase'))
|
||||
->bind('admin_database_new')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAdmin();
|
||||
});
|
||||
|
||||
@@ -83,7 +83,7 @@ class Databoxes implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/mount/', $this->call('databaseMount'))
|
||||
->bind('admin_database_mount')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAdmin();
|
||||
});
|
||||
|
||||
@@ -102,7 +102,7 @@ class Databoxes implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/upgrade/', $this->call('databasesUpgrade'))
|
||||
->bind('admin_databases_upgrade')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAdmin();
|
||||
});
|
||||
|
||||
|
@@ -27,7 +27,7 @@ class Fields implements ControllerProviderInterface
|
||||
|
||||
$app['admin.fields.controller'] = $this;
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']
|
||||
->requireAccessToModule('admin')
|
||||
->requireRight('bas_modify_struct');
|
||||
|
@@ -29,12 +29,12 @@ class Publications implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAccessToModule('admin')
|
||||
->requireRight('bas_chupub');
|
||||
});
|
||||
|
||||
$controllers->get('/list/', function(PhraseaApplication $app) {
|
||||
$controllers->get('/list/', function (PhraseaApplication $app) {
|
||||
|
||||
$feeds = \Feed_Collection::load_all(
|
||||
$app, $app['authentication']->getUser()
|
||||
@@ -44,7 +44,7 @@ class Publications implements ControllerProviderInterface
|
||||
->render('admin/publications/list.html.twig', array('feeds' => $feeds));
|
||||
})->bind('admin_feeds_list');
|
||||
|
||||
$controllers->post('/create/', function(PhraseaApplication $app, Request $request) {
|
||||
$controllers->post('/create/', function (PhraseaApplication $app, Request $request) {
|
||||
|
||||
$feed = \Feed_Adapter::create(
|
||||
$app, $app['authentication']->getUser(), $request->request->get('title'), $request->request->get('subtitle')
|
||||
@@ -59,7 +59,7 @@ class Publications implements ControllerProviderInterface
|
||||
return $app->redirectPath('admin_feeds_list');
|
||||
})->bind('admin_feeds_create');
|
||||
|
||||
$controllers->get('/feed/{id}/', function(PhraseaApplication $app, Request $request, $id) {
|
||||
$controllers->get('/feed/{id}/', function (PhraseaApplication $app, Request $request, $id) {
|
||||
$feed = new \Feed_Adapter($app, $id);
|
||||
|
||||
return $app['twig']
|
||||
@@ -68,7 +68,7 @@ class Publications implements ControllerProviderInterface
|
||||
->bind('admin_feeds_feed')
|
||||
->assert('id', '\d+');
|
||||
|
||||
$controllers->post('/feed/{id}/update/', function(PhraseaApplication $app, Request $request, $id) {
|
||||
$controllers->post('/feed/{id}/update/', function (PhraseaApplication $app, Request $request, $id) {
|
||||
|
||||
$feed = new \Feed_Adapter($app, $id);
|
||||
|
||||
@@ -84,7 +84,7 @@ class Publications implements ControllerProviderInterface
|
||||
$feed->set_public($request->request->get('public'));
|
||||
|
||||
return $app->redirectPath('admin_feeds_list');
|
||||
})->before(function(Request $request) use ($app) {
|
||||
})->before(function (Request $request) use ($app) {
|
||||
$feed = new \Feed_Adapter($app, $request->attributes->get('id'));
|
||||
|
||||
if (!$feed->is_owner($app['authentication']->getUser())) {
|
||||
@@ -94,7 +94,7 @@ class Publications implements ControllerProviderInterface
|
||||
->bind('admin_feeds_feed_update')
|
||||
->assert('id', '\d+');
|
||||
|
||||
$controllers->post('/feed/{id}/iconupload/', function(PhraseaApplication $app, Request $request, $id) {
|
||||
$controllers->post('/feed/{id}/iconupload/', function (PhraseaApplication $app, Request $request, $id) {
|
||||
$datas = array(
|
||||
'success' => false,
|
||||
'message' => '',
|
||||
@@ -162,7 +162,7 @@ class Publications implements ControllerProviderInterface
|
||||
->bind('admin_feeds_feed_icon')
|
||||
->assert('id', '\d+');
|
||||
|
||||
$controllers->post('/feed/{id}/addpublisher/', function(PhraseaApplication $app, $id) {
|
||||
$controllers->post('/feed/{id}/addpublisher/', function (PhraseaApplication $app, $id) {
|
||||
$error = '';
|
||||
try {
|
||||
$request = $app['request'];
|
||||
@@ -178,7 +178,7 @@ class Publications implements ControllerProviderInterface
|
||||
->bind('admin_feeds_feed_add_publisher')
|
||||
->assert('id', '\d+');
|
||||
|
||||
$controllers->post('/feed/{id}/removepublisher/', function(PhraseaApplication $app, $id) {
|
||||
$controllers->post('/feed/{id}/removepublisher/', function (PhraseaApplication $app, $id) {
|
||||
try {
|
||||
$request = $app['request'];
|
||||
|
||||
@@ -196,7 +196,7 @@ class Publications implements ControllerProviderInterface
|
||||
->bind('admin_feeds_feed_remove_publisher')
|
||||
->assert('id', '\d+');
|
||||
|
||||
$controllers->post('/feed/{id}/delete/', function(PhraseaApplication $app, $id) {
|
||||
$controllers->post('/feed/{id}/delete/', function (PhraseaApplication $app, $id) {
|
||||
$feed = new \Feed_Adapter($app, $id);
|
||||
$feed->delete();
|
||||
|
||||
|
@@ -29,11 +29,11 @@ class Root implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAccessToModule('admin');
|
||||
});
|
||||
|
||||
$controllers->get('/', function(Application $app, Request $request) {
|
||||
$controllers->get('/', function (Application $app, Request $request) {
|
||||
try {
|
||||
\User_Adapter::updateClientInfos($app, 3);
|
||||
} catch (SessionNotFound $e) {
|
||||
@@ -101,7 +101,7 @@ class Root implements ControllerProviderInterface
|
||||
));
|
||||
})->bind('admin');
|
||||
|
||||
$controllers->get('/tree/', function(Application $app, Request $request) {
|
||||
$controllers->get('/tree/', function (Application $app, Request $request) {
|
||||
try {
|
||||
\User_Adapter::updateClientInfos($app, 3);
|
||||
} catch (SessionNotFound $e) {
|
||||
@@ -161,7 +161,7 @@ class Root implements ControllerProviderInterface
|
||||
return $app['twig']->render('admin/tree.html.twig', $params);
|
||||
})->bind('admin_display_tree');
|
||||
|
||||
$controllers->get('/test-paths/', function(Application $app, Request $request) {
|
||||
$controllers->get('/test-paths/', function (Application $app, Request $request) {
|
||||
|
||||
if (!$request->isXmlHttpRequest() || !array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) {
|
||||
$app->abort(400, _('Bad request format, only JSON is allowed'));
|
||||
@@ -195,7 +195,7 @@ class Root implements ControllerProviderInterface
|
||||
})
|
||||
->bind('admin_test_paths');
|
||||
|
||||
$controllers->get('/structure/{databox_id}/', function(Application $app, Request $request, $databox_id) {
|
||||
$controllers->get('/structure/{databox_id}/', function (Application $app, Request $request, $databox_id) {
|
||||
if (!$app['authentication']->getUser()->ACL()->has_right_on_sbas($databox_id, 'bas_modify_struct')) {
|
||||
$app->abort(403);
|
||||
}
|
||||
@@ -222,7 +222,7 @@ class Root implements ControllerProviderInterface
|
||||
})->assert('databox_id', '\d+')
|
||||
->bind('database_display_stucture');
|
||||
|
||||
$controllers->post('/structure/{databox_id}/', function(Application $app, Request $request, $databox_id) {
|
||||
$controllers->post('/structure/{databox_id}/', function (Application $app, Request $request, $databox_id) {
|
||||
if (!$app['authentication']->getUser()->ACL()->has_right_on_sbas($databox_id, 'bas_modify_struct')) {
|
||||
$app->abort(403);
|
||||
}
|
||||
@@ -248,7 +248,7 @@ class Root implements ControllerProviderInterface
|
||||
})->assert('databox_id', '\d+')
|
||||
->bind('database_submit_stucture');
|
||||
|
||||
$controllers->get('/statusbit/{databox_id}/', function(Application $app, Request $request, $databox_id) {
|
||||
$controllers->get('/statusbit/{databox_id}/', function (Application $app, Request $request, $databox_id) {
|
||||
if (!$app['authentication']->getUser()->ACL()->has_right_on_sbas($databox_id, 'bas_modify_struct')) {
|
||||
$app->abort(403);
|
||||
}
|
||||
@@ -259,7 +259,7 @@ class Root implements ControllerProviderInterface
|
||||
})->assert('databox_id', '\d+')
|
||||
->bind('database_display_statusbit');
|
||||
|
||||
$controllers->get('/statusbit/{databox_id}/status/{bit}/', function(Application $app, Request $request, $databox_id, $bit) {
|
||||
$controllers->get('/statusbit/{databox_id}/status/{bit}/', function (Application $app, Request $request, $databox_id, $bit) {
|
||||
if (!$app['authentication']->getUser()->ACL()->has_right_on_sbas($databox_id, 'bas_modify_struct')) {
|
||||
$app->abort(403);
|
||||
}
|
||||
@@ -314,7 +314,7 @@ class Root implements ControllerProviderInterface
|
||||
->assert('bit', '\d+')
|
||||
->bind('database_display_statusbit_form');
|
||||
|
||||
$controllers->post('/statusbit/{databox_id}/status/{bit}/delete/', function(Application $app, Request $request, $databox_id, $bit) {
|
||||
$controllers->post('/statusbit/{databox_id}/status/{bit}/delete/', function (Application $app, Request $request, $databox_id, $bit) {
|
||||
if (!$request->isXmlHttpRequest() || !array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) {
|
||||
$app->abort(400, _('Bad request format, only JSON is allowed'));
|
||||
}
|
||||
@@ -337,7 +337,7 @@ class Root implements ControllerProviderInterface
|
||||
->assert('databox_id', '\d+')
|
||||
->assert('bit', '\d+');
|
||||
|
||||
$controllers->post('/statusbit/{databox_id}/status/{bit}/', function(Application $app, Request $request, $databox_id, $bit) {
|
||||
$controllers->post('/statusbit/{databox_id}/status/{bit}/', function (Application $app, Request $request, $databox_id, $bit) {
|
||||
if (!$app['authentication']->getUser()->ACL()->has_right_on_sbas($databox_id, 'bas_modify_struct')) {
|
||||
$app->abort(403);
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ class Setup implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAdmin();
|
||||
});
|
||||
|
||||
|
@@ -28,12 +28,12 @@ class Subdefs implements ControllerProviderInterface
|
||||
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAccessToModule('admin')
|
||||
->requireRightOnSbas($request->attributes->get('sbas_id'), 'bas_modify_struct');
|
||||
});
|
||||
|
||||
$controllers->get('/{sbas_id}/', function(Application $app, $sbas_id) {
|
||||
$controllers->get('/{sbas_id}/', function (Application $app, $sbas_id) {
|
||||
$databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id);
|
||||
|
||||
return $app['twig']->render('admin/subdefs.html.twig', array(
|
||||
@@ -44,7 +44,7 @@ class Subdefs implements ControllerProviderInterface
|
||||
->bind('admin_subdefs_subdef')
|
||||
->assert('sbas_id', '\d+');
|
||||
|
||||
$controllers->post('/{sbas_id}/', function(Application $app, Request $request, $sbas_id) {
|
||||
$controllers->post('/{sbas_id}/', function (Application $app, Request $request, $sbas_id) {
|
||||
$delete_subdef = $request->request->get('delete_subdef');
|
||||
$toadd_subdef = $request->request->get('add_subdef');
|
||||
$Parmsubdefs = $request->request->get('subdefs', array());
|
||||
|
@@ -25,15 +25,15 @@ class TaskManager implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRight('taskmanager');
|
||||
});
|
||||
|
||||
$controllers->get('/', function(Application $app, Request $request) {
|
||||
$controllers->get('/', function (Application $app, Request $request) {
|
||||
return $app->redirectPath('admin_tasks_list');
|
||||
})->bind('admin_tasks');
|
||||
|
||||
$controllers->get('/tasks/', function(Application $app, Request $request) {
|
||||
$controllers->get('/tasks/', function (Application $app, Request $request) {
|
||||
|
||||
if ($request->getContentType() == 'json') {
|
||||
return $app->json($app['task-manager']->toArray());
|
||||
@@ -48,7 +48,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
}
|
||||
})->bind('admin_tasks_list');
|
||||
|
||||
$controllers->post('/tasks/create/', function(Application $app, Request $request) {
|
||||
$controllers->post('/tasks/create/', function (Application $app, Request $request) {
|
||||
if (!class_exists($className = $request->request->get('tcl'))) {
|
||||
$app->abort(400, sprintf('Unknown task %s', $className));
|
||||
}
|
||||
@@ -68,7 +68,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
/*
|
||||
* route /admin/scheduler/stop
|
||||
*/
|
||||
$controllers->get('/scheduler/stop', function(Application $app, Request $request) use ($app) {
|
||||
$controllers->get('/scheduler/stop', function (Application $app, Request $request) use ($app) {
|
||||
try {
|
||||
$app['task-manager']->setSchedulerState(\task_manager::STATE_TOSTOP);
|
||||
|
||||
@@ -80,7 +80,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
return $app->json(array('success' => false));
|
||||
})->bind('admin_tasks_scheduler_stop');
|
||||
|
||||
$controllers->get('/scheduler/log', function(Application $app, Request $request) {
|
||||
$controllers->get('/scheduler/log', function (Application $app, Request $request) {
|
||||
$logdir = $app['root.path'] . '/logs/';
|
||||
|
||||
$rname = '/scheduler((\.log)|(-.*\.log))$/';
|
||||
@@ -102,7 +102,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
return $app->redirectPath('admin_tasks_scheduler_log');
|
||||
}
|
||||
|
||||
return $app->stream(function() use ($finder, $app) {
|
||||
return $app->stream(function () use ($finder, $app) {
|
||||
foreach ($finder->getIterator() as $file) {
|
||||
printf("<h4>%s\n", $file->getRealPath());
|
||||
printf(" <a href=\"".$app->path('admin_tasks_scheduler_log', array('clr' => $file->getFilename()))."\">%s</a>"
|
||||
@@ -118,7 +118,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
}, 200, array('Content-Type' => 'text/html'));
|
||||
})->bind('admin_tasks_scheduler_log');
|
||||
|
||||
$controllers->get('/task/{id}/log', function(Application $app, Request $request, $id) {
|
||||
$controllers->get('/task/{id}/log', function (Application $app, Request $request, $id) {
|
||||
$logdir = $app['root.path'] . '/logs/';
|
||||
|
||||
$rname = '/task_' . $id . '((\.log)|(-.*\.log))$/';
|
||||
@@ -140,7 +140,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
return $app->redirectPath('admin_tasks_task_log', array('id' => $id));
|
||||
}
|
||||
|
||||
return $app->stream(function() use ($finder, $id) {
|
||||
return $app->stream(function () use ($finder, $id) {
|
||||
foreach ($finder->getIterator() as $file) {
|
||||
printf("<h4>%s\n", $file->getRealPath());
|
||||
printf(" <a href=\"/admin/task-manager/task/%s/log?clr=%s\">%s</a>"
|
||||
@@ -158,7 +158,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
});
|
||||
})->bind('admin_tasks_task_log');
|
||||
|
||||
$controllers->get('/task/{id}/delete', function(Application $app, Request $request, $id) {
|
||||
$controllers->get('/task/{id}/delete', function (Application $app, Request $request, $id) {
|
||||
|
||||
try {
|
||||
$task = $app['task-manager']->getTask($id);
|
||||
@@ -175,7 +175,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
}
|
||||
})->bind('admin_tasks_task_delete');
|
||||
|
||||
$controllers->get('/task/{id}/tostart', function(Application $app, Request $request, $id) {
|
||||
$controllers->get('/task/{id}/tostart', function (Application $app, Request $request, $id) {
|
||||
|
||||
$ret = false;
|
||||
try {
|
||||
@@ -192,7 +192,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
return $app->json($ret);
|
||||
})->bind('admin_tasks_task_start');
|
||||
|
||||
$controllers->get('/task/{id}/tostop', function(Application $app, Request $request, $id) {
|
||||
$controllers->get('/task/{id}/tostop', function (Application $app, Request $request, $id) {
|
||||
|
||||
$ret = false;
|
||||
try {
|
||||
@@ -213,7 +213,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
return $app->json($ret);
|
||||
})->bind('admin_tasks_task_stop');
|
||||
|
||||
$controllers->get('/task/{id}/resetcrashcounter/', function(Application $app, Request $request, $id) {
|
||||
$controllers->get('/task/{id}/resetcrashcounter/', function (Application $app, Request $request, $id) {
|
||||
|
||||
try {
|
||||
$task = $app['task-manager']->getTask($id);
|
||||
@@ -230,7 +230,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
* route /admin/task-manager/task/{id}/save
|
||||
* return json
|
||||
*/
|
||||
$controllers->post('/task/{id}/save/', function(Application $app, Request $request, $id) {
|
||||
$controllers->post('/task/{id}/save/', function (Application $app, Request $request, $id) {
|
||||
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
$dom->strictErrorChecking = true;
|
||||
@@ -259,7 +259,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
* route /admin/task-manager/task/{id}/facility/
|
||||
* call callback(s) of a task, for ex. to transform gui(form) to xml settings
|
||||
*/
|
||||
$controllers->post('/task/{id}/facility/', function(Application $app, Request $request, $id) {
|
||||
$controllers->post('/task/{id}/facility/', function (Application $app, Request $request, $id) {
|
||||
|
||||
$ret = '';
|
||||
try {
|
||||
@@ -299,7 +299,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
return $ret;
|
||||
})->bind('admin_tasks_task_facility');
|
||||
|
||||
$controllers->get('/task/{id}', function(Application $app, Request $request, $id) {
|
||||
$controllers->get('/task/{id}', function (Application $app, Request $request, $id) {
|
||||
|
||||
$task = $app['task-manager']->getTask($id);
|
||||
|
||||
@@ -315,7 +315,7 @@ class TaskManager implements ControllerProviderInterface
|
||||
* route /admin/task/checkxml/
|
||||
* check if the xml is valid
|
||||
*/
|
||||
$controllers->post('/task/checkxml/', function(Application $app, Request $request) {
|
||||
$controllers->post('/task/checkxml/', function (Application $app, Request $request) {
|
||||
$ret = array('ok' => true, 'err' => null);
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
$dom->strictErrorChecking = true;
|
||||
|
@@ -29,24 +29,24 @@ class Users implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAccessToModule('admin')
|
||||
->requireRight('manageusers');
|
||||
});
|
||||
|
||||
$controllers->post('/rights/', function(Application $app) {
|
||||
$controllers->post('/rights/', function (Application $app) {
|
||||
$rights = new UserHelper\Edit($app, $app['request']);
|
||||
|
||||
return $app['twig']->render('admin/editusers.html.twig', $rights->get_users_rights());
|
||||
});
|
||||
|
||||
$controllers->get('/rights/', function(Application $app) {
|
||||
$controllers->get('/rights/', function (Application $app) {
|
||||
$rights = new UserHelper\Edit($app, $app['request']);
|
||||
|
||||
return $app['twig']->render('admin/editusers.html.twig', $rights->get_users_rights());
|
||||
});
|
||||
|
||||
$controllers->post('/rights/reset/', function(Application $app, Request $request) {
|
||||
$controllers->post('/rights/reset/', function (Application $app, Request $request) {
|
||||
try {
|
||||
$datas = array('error' => false);
|
||||
|
||||
@@ -60,14 +60,14 @@ class Users implements ControllerProviderInterface
|
||||
return $app->json($datas);
|
||||
})->bind('admin_users_rights_reset');
|
||||
|
||||
$controllers->post('/delete/', function(Application $app) {
|
||||
$controllers->post('/delete/', function (Application $app) {
|
||||
$module = new UserHelper\Edit($app, $app['request']);
|
||||
$module->delete_users();
|
||||
|
||||
return $app->redirectPath('admin_users_search');
|
||||
});
|
||||
|
||||
$controllers->post('/rights/apply/', function(Application $app) {
|
||||
$controllers->post('/rights/apply/', function (Application $app) {
|
||||
$datas = array('error' => true);
|
||||
|
||||
try {
|
||||
@@ -88,58 +88,58 @@ class Users implements ControllerProviderInterface
|
||||
return $app->json($datas);
|
||||
})->bind('admin_users_rights_apply');
|
||||
|
||||
$controllers->post('/rights/quotas/', function(Application $app) {
|
||||
$controllers->post('/rights/quotas/', function (Application $app) {
|
||||
$rights = new UserHelper\Edit($app, $app['request']);
|
||||
|
||||
return $app['twig']->render('admin/editusers_quotas.html.twig', $rights->get_quotas());
|
||||
});
|
||||
|
||||
$controllers->post('/rights/quotas/apply/', function(Application $app) {
|
||||
$controllers->post('/rights/quotas/apply/', function (Application $app) {
|
||||
$rights = new UserHelper\Edit($app, $app['request']);
|
||||
$rights->apply_quotas();
|
||||
|
||||
return $app->json(array('message' => '', 'error' => false));
|
||||
});
|
||||
|
||||
$controllers->post('/rights/time/', function(Application $app) {
|
||||
$controllers->post('/rights/time/', function (Application $app) {
|
||||
$rights = new UserHelper\Edit($app, $app['request']);
|
||||
|
||||
return $app['twig']->render('admin/editusers_timelimit.html.twig', $rights->get_time());
|
||||
});
|
||||
|
||||
$controllers->post('/rights/time/sbas/', function(Application $app) {
|
||||
$controllers->post('/rights/time/sbas/', function (Application $app) {
|
||||
$rights = new UserHelper\Edit($app, $app['request']);
|
||||
|
||||
return $app['twig']->render('admin/editusers_timelimit_sbas.html.twig', $rights->get_time_sbas());
|
||||
});
|
||||
|
||||
$controllers->post('/rights/time/apply/', function(Application $app) {
|
||||
$controllers->post('/rights/time/apply/', function (Application $app) {
|
||||
$rights = new UserHelper\Edit($app, $app['request']);
|
||||
$rights->apply_time();
|
||||
|
||||
return $app->json(array('message' => '', 'error' => false));
|
||||
});
|
||||
|
||||
$controllers->post('/rights/masks/', function(Application $app) {
|
||||
$controllers->post('/rights/masks/', function (Application $app) {
|
||||
$rights = new UserHelper\Edit($app, $app['request']);
|
||||
|
||||
return $app['twig']->render('admin/editusers_masks.html.twig', $rights->get_masks());
|
||||
});
|
||||
|
||||
$controllers->post('/rights/masks/apply/', function(Application $app) {
|
||||
$controllers->post('/rights/masks/apply/', function (Application $app) {
|
||||
$rights = new UserHelper\Edit($app, $app['request']);
|
||||
$rights->apply_masks();
|
||||
|
||||
return $app->json(array('message' => '', 'error' => false));
|
||||
});
|
||||
|
||||
$controllers->match('/search/', function(Application $app) {
|
||||
$controllers->match('/search/', function (Application $app) {
|
||||
$users = new UserHelper\Manage($app, $app['request']);
|
||||
|
||||
return $app['twig']->render('admin/users.html.twig', $users->search());
|
||||
})->bind('admin_users_search');
|
||||
|
||||
$controllers->post('/search/export/', function() use ($app) {
|
||||
$controllers->post('/search/export/', function () use ($app) {
|
||||
$request = $app['request'];
|
||||
|
||||
$users = new UserHelper\Manage($app, $app['request']);
|
||||
@@ -195,7 +195,7 @@ class Users implements ControllerProviderInterface
|
||||
return $response;
|
||||
})->bind('admin_users_search_export');
|
||||
|
||||
$controllers->post('/apply_template/', function() use ($app) {
|
||||
$controllers->post('/apply_template/', function () use ($app) {
|
||||
$users = new UserHelper\Edit($app, $app['request']);
|
||||
|
||||
$users->apply_template();
|
||||
@@ -203,7 +203,7 @@ class Users implements ControllerProviderInterface
|
||||
return $app->redirectPath('admin_users_search');
|
||||
})->bind('admin_users_apply_template');
|
||||
|
||||
$controllers->get('/typeahead/search/', function(Application $app) {
|
||||
$controllers->get('/typeahead/search/', function (Application $app) {
|
||||
$request = $app['request'];
|
||||
|
||||
$user_query = new \User_Query($app);
|
||||
@@ -241,7 +241,7 @@ class Users implements ControllerProviderInterface
|
||||
return $app->json($datas);
|
||||
});
|
||||
|
||||
$controllers->post('/create/', function(Application $app) {
|
||||
$controllers->post('/create/', function (Application $app) {
|
||||
|
||||
$datas = array('error' => false, 'message' => '', 'data' => null);
|
||||
try {
|
||||
@@ -264,7 +264,7 @@ class Users implements ControllerProviderInterface
|
||||
return $app->json($datas);
|
||||
});
|
||||
|
||||
$controllers->post('/export/csv/', function(Application $app) {
|
||||
$controllers->post('/export/csv/', function (Application $app) {
|
||||
$request = $app['request'];
|
||||
$user_query = new \User_Query($app);
|
||||
|
||||
@@ -339,7 +339,7 @@ class Users implements ControllerProviderInterface
|
||||
return $response;
|
||||
})->bind('admin_users_export_csv');
|
||||
|
||||
$controllers->get('/demands/', function(Application $app, Request $request) {
|
||||
$controllers->get('/demands/', function (Application $app, Request $request) {
|
||||
|
||||
$lastMonth = time() - (3 * 4 * 7 * 24 * 60 * 60);
|
||||
$sql = "DELETE FROM demand WHERE date_modif < :date";
|
||||
@@ -396,7 +396,7 @@ class Users implements ControllerProviderInterface
|
||||
));
|
||||
})->bind('users_display_demands');
|
||||
|
||||
$controllers->post('/demands/', function(Application $app, Request $request) {
|
||||
$controllers->post('/demands/', function (Application $app, Request $request) {
|
||||
|
||||
$templates = $deny = $accept = $options = array();
|
||||
|
||||
@@ -571,11 +571,11 @@ class Users implements ControllerProviderInterface
|
||||
return $app->redirectPath('users_display_demands', array('success' => 1));
|
||||
})->bind('users_submit_demands');
|
||||
|
||||
$controllers->get('/import/file/', function(Application $app, Request $request) {
|
||||
$controllers->get('/import/file/', function (Application $app, Request $request) {
|
||||
return $app['twig']->render('admin/user/import/file.html.twig');
|
||||
})->bind('users_display_import_file');
|
||||
|
||||
$controllers->post('/import/file/', function(Application $app, Request $request) {
|
||||
$controllers->post('/import/file/', function (Application $app, Request $request) {
|
||||
if ((null === $file = $request->files->get('files')) || !$file->isValid()) {
|
||||
return $app->redirectPath('users_display_import_file', array('error' => 'file-invalid'));
|
||||
}
|
||||
@@ -593,7 +593,7 @@ class Users implements ControllerProviderInterface
|
||||
|
||||
$roughColumns = array_shift($lines);
|
||||
|
||||
$columnsSanitized = array_map(function($columnName) {
|
||||
$columnsSanitized = array_map(function ($columnName) {
|
||||
return trim(mb_strtolower($columnName));
|
||||
}, $roughColumns);
|
||||
|
||||
@@ -727,7 +727,7 @@ class Users implements ControllerProviderInterface
|
||||
));
|
||||
})->bind('users_submit_import_file');
|
||||
|
||||
$controllers->post('/import/', function(Application $app, Request $request) {
|
||||
$controllers->post('/import/', function (Application $app, Request $request) {
|
||||
$nbCreation = 0;
|
||||
|
||||
if ((null === $serializedColumns = $request->request->get('sr_columns')) || ('' === $serializedColumns)) {
|
||||
@@ -859,7 +859,7 @@ class Users implements ControllerProviderInterface
|
||||
return $app->redirectPath('admin_users_search', array('user-updated' => $nbCreation));
|
||||
})->bind('users_submit_import');
|
||||
|
||||
$controllers->get('/import/example/csv/', function(Application $app, Request $request) {
|
||||
$controllers->get('/import/example/csv/', function (Application $app, Request $request) {
|
||||
|
||||
$file = new \SplFileInfo($app['root.path'] . '/lib/Fixtures/exampleImportUsers.csv');
|
||||
|
||||
@@ -878,7 +878,7 @@ class Users implements ControllerProviderInterface
|
||||
return $response;
|
||||
})->bind('users_import_csv');
|
||||
|
||||
$controllers->get('/import/example/rtf/', function(Application $app, Request $request) {
|
||||
$controllers->get('/import/example/rtf/', function (Application $app, Request $request) {
|
||||
|
||||
$file = new \SplFileInfo($app['root.path'] . '/lib/Fixtures/Fields.rtf');
|
||||
|
||||
|
@@ -28,7 +28,7 @@ class Oauth2 implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$app['oauth'] = $app->share(function($app) {
|
||||
$app['oauth'] = $app->share(function ($app) {
|
||||
return new \API_OAuth2_Adapter($app);
|
||||
});
|
||||
|
||||
@@ -38,7 +38,7 @@ class Oauth2 implements ControllerProviderInterface
|
||||
* Authorization endpoint - used to obtain authorization from the
|
||||
* resource owner via user-agent redirection.
|
||||
*/
|
||||
$authorize_func = function() use ($app) {
|
||||
$authorize_func = function () use ($app) {
|
||||
$request = $app['request'];
|
||||
$oauth2_adapter = $app['oauth'];
|
||||
|
||||
@@ -145,7 +145,7 @@ class Oauth2 implements ControllerProviderInterface
|
||||
* TOKEN ENDPOINT
|
||||
* Token endpoint - used to exchange an authorization grant for an access token.
|
||||
*/
|
||||
$controllers->post('/token', function(\Silex\Application $app, Request $request) {
|
||||
$controllers->post('/token', function (\Silex\Application $app, Request $request) {
|
||||
if ( ! $request->isSecure()) {
|
||||
throw new HttpException(400, 'This route requires the use of the https scheme', null, array('content-type' => 'application/json'));
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ class V1 implements ControllerProviderInterface
|
||||
* @ throws \API_V1_exception_unauthorized
|
||||
* @ throws \API_V1_exception_forbidden
|
||||
*/
|
||||
$controllers->before(function($request) use ($app) {
|
||||
$controllers->before(function ($request) use ($app) {
|
||||
$context = new Context(Context::CONTEXT_OAUTH2_TOKEN);
|
||||
$app['dispatcher']->dispatch(PhraseaEvents::PRE_AUTHENTICATE, new PreAuthenticate($request, $context));
|
||||
|
||||
@@ -165,7 +165,7 @@ class V1 implements ControllerProviderInterface
|
||||
/**
|
||||
* Method Not Allowed Closure
|
||||
*/
|
||||
$bad_request_exception = function() {
|
||||
$bad_request_exception = function () {
|
||||
throw new \API_V1_exception_badrequest();
|
||||
};
|
||||
|
||||
@@ -189,7 +189,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters :
|
||||
*
|
||||
*/
|
||||
$controllers->get('/monitor/scheduler/', function(SilexApplication $app, Request $request) {
|
||||
$controllers->get('/monitor/scheduler/', function (SilexApplication $app, Request $request) {
|
||||
return $app['api']->get_scheduler($app)->get_response();
|
||||
})->before($mustBeAdmin);
|
||||
|
||||
@@ -203,7 +203,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters :
|
||||
*
|
||||
*/
|
||||
$controllers->get('/monitor/tasks/', function(SilexApplication $app, Request $request) {
|
||||
$controllers->get('/monitor/tasks/', function (SilexApplication $app, Request $request) {
|
||||
return $app['api']->get_task_list($app)->get_response();
|
||||
})->before($mustBeAdmin);
|
||||
|
||||
@@ -217,7 +217,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters :
|
||||
*
|
||||
*/
|
||||
$controllers->get('/monitor/task/{task_id}/', function(SilexApplication $app, Request $request, $task_id) {
|
||||
$controllers->get('/monitor/task/{task_id}/', function (SilexApplication $app, Request $request, $task_id) {
|
||||
return $app['api']->get_task($app, $task_id)->get_response();
|
||||
})->before($mustBeAdmin)->assert('task_id', '\d+');
|
||||
|
||||
@@ -232,7 +232,7 @@ class V1 implements ControllerProviderInterface
|
||||
* - name (string) change the name of the task
|
||||
* - autostart (boolean) start task when scheduler starts
|
||||
*/
|
||||
$controllers->post('/monitor/task/{task_id}/', function(SilexApplication $app, Request $request, $task_id) {
|
||||
$controllers->post('/monitor/task/{task_id}/', function (SilexApplication $app, Request $request, $task_id) {
|
||||
return $app['api']->set_task_property($app, $task_id)->get_response();
|
||||
})->before($mustBeAdmin)->assert('task_id', '\d+');
|
||||
|
||||
@@ -246,7 +246,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters :
|
||||
*
|
||||
*/
|
||||
$controllers->post('/monitor/task/{task_id}/start/', function(SilexApplication $app, Request $request, $task_id) {
|
||||
$controllers->post('/monitor/task/{task_id}/start/', function (SilexApplication $app, Request $request, $task_id) {
|
||||
return $app['api']->start_task($app, $task_id)->get_response();
|
||||
})->before($mustBeAdmin);
|
||||
|
||||
@@ -260,7 +260,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters :
|
||||
*
|
||||
*/
|
||||
$controllers->post('/monitor/task/{task_id}/stop/', function(SilexApplication $app, Request $request, $task_id) {
|
||||
$controllers->post('/monitor/task/{task_id}/stop/', function (SilexApplication $app, Request $request, $task_id) {
|
||||
return $app['api']->stop_task($app, $task_id)->get_response();
|
||||
})->before($mustBeAdmin);
|
||||
|
||||
@@ -274,7 +274,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters :
|
||||
*
|
||||
*/
|
||||
$controllers->get('/monitor/phraseanet/', function(SilexApplication $app, Request $request) {
|
||||
$controllers->get('/monitor/phraseanet/', function (SilexApplication $app, Request $request) {
|
||||
return $app['api']->get_phraseanet_monitor($app)->get_response();
|
||||
})->before($mustBeAdmin);
|
||||
|
||||
@@ -286,7 +286,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters :
|
||||
*
|
||||
*/
|
||||
$controllers->get('/databoxes/list/', function(SilexApplication $app, Request $request) {
|
||||
$controllers->get('/databoxes/list/', function (SilexApplication $app, Request $request) {
|
||||
return $app['api']->get_databoxes($request)->get_response();
|
||||
});
|
||||
|
||||
@@ -298,7 +298,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters ;
|
||||
* DATABOX_ID : required INT
|
||||
*/
|
||||
$controllers->get('/databoxes/{databox_id}/collections/', function(SilexApplication $app, $databox_id) {
|
||||
$controllers->get('/databoxes/{databox_id}/collections/', function (SilexApplication $app, $databox_id) {
|
||||
return $app['api']
|
||||
->get_databox_collections($app['request'], $databox_id)
|
||||
->get_response();
|
||||
@@ -315,7 +315,7 @@ class V1 implements ControllerProviderInterface
|
||||
* DATABOX_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->get('/databoxes/{databox_id}/status/', function(SilexApplication $app, $databox_id) {
|
||||
$controllers->get('/databoxes/{databox_id}/status/', function (SilexApplication $app, $databox_id) {
|
||||
return $app['api']
|
||||
->get_databox_status($app['request'], $databox_id)
|
||||
->get_response();
|
||||
@@ -331,7 +331,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters ;
|
||||
* DATABOX_ID : required INT
|
||||
*/
|
||||
$controllers->get('/databoxes/{databox_id}/metadatas/', function(SilexApplication $app, $databox_id) {
|
||||
$controllers->get('/databoxes/{databox_id}/metadatas/', function (SilexApplication $app, $databox_id) {
|
||||
return $app['api']
|
||||
->get_databox_metadatas($app['request'], $databox_id)
|
||||
->get_response();
|
||||
@@ -347,7 +347,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters ;
|
||||
* DATABOX_ID : required INT
|
||||
*/
|
||||
$controllers->get('/databoxes/{databox_id}/termsOfUse/', function(SilexApplication $app, $databox_id) {
|
||||
$controllers->get('/databoxes/{databox_id}/termsOfUse/', function (SilexApplication $app, $databox_id) {
|
||||
return $app['api']
|
||||
->get_databox_terms($app['request'], $databox_id)
|
||||
->get_response();
|
||||
@@ -355,11 +355,11 @@ class V1 implements ControllerProviderInterface
|
||||
|
||||
$controllers->get('/databoxes/{any_id}/termsOfUse/', $bad_request_exception);
|
||||
|
||||
$controllers->get('/quarantine/list/', function(SilexApplication $app, Request $request) {
|
||||
$controllers->get('/quarantine/list/', function (SilexApplication $app, Request $request) {
|
||||
return $app['api']->list_quarantine($app, $request)->get_response();
|
||||
});
|
||||
|
||||
$controllers->get('/quarantine/item/{lazaret_id}/', function($lazaret_id, SilexApplication $app, Request $request) {
|
||||
$controllers->get('/quarantine/item/{lazaret_id}/', function ($lazaret_id, SilexApplication $app, Request $request) {
|
||||
return $app['api']->list_quarantine_item($lazaret_id, $app, $request)->get_response();
|
||||
});
|
||||
|
||||
@@ -371,7 +371,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters :
|
||||
*
|
||||
*/
|
||||
$controllers->post('/records/add/', function(SilexApplication $app, Request $request) {
|
||||
$controllers->post('/records/add/', function (SilexApplication $app, Request $request) {
|
||||
return $app['api']->add_record($app, $request)->get_response();
|
||||
});
|
||||
|
||||
@@ -391,7 +391,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Array containing an array of records and stories collection
|
||||
*
|
||||
*/
|
||||
$controllers->match('/search/', function() use ($app) {
|
||||
$controllers->match('/search/', function () use ($app) {
|
||||
return $app['api']->search($app['request'])->get_response();
|
||||
});
|
||||
|
||||
@@ -411,11 +411,11 @@ class V1 implements ControllerProviderInterface
|
||||
* Array of record objects
|
||||
*
|
||||
*/
|
||||
$controllers->match('/records/search/', function(SilexApplication $app) {
|
||||
$controllers->match('/records/search/', function (SilexApplication $app) {
|
||||
return $app['api']->search_records($app['request'])->get_response();
|
||||
});
|
||||
|
||||
$controllers->get('/records/{databox_id}/{record_id}/caption/', function(SilexApplication $app, $databox_id, $record_id) {
|
||||
$controllers->get('/records/{databox_id}/{record_id}/caption/', function (SilexApplication $app, $databox_id, $record_id) {
|
||||
return $app['api']
|
||||
->caption_records($app['request'], $databox_id, $record_id)
|
||||
->get_response();
|
||||
@@ -433,7 +433,7 @@ class V1 implements ControllerProviderInterface
|
||||
* RECORD_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->get('/records/{databox_id}/{record_id}/metadatas/', function(SilexApplication $app, $databox_id, $record_id) {
|
||||
$controllers->get('/records/{databox_id}/{record_id}/metadatas/', function (SilexApplication $app, $databox_id, $record_id) {
|
||||
return $app['api']
|
||||
->get_record_metadatas($app['request'], $databox_id, $record_id)
|
||||
->get_response();
|
||||
@@ -451,7 +451,7 @@ class V1 implements ControllerProviderInterface
|
||||
* RECORD_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->get('/records/{databox_id}/{record_id}/status/', function(SilexApplication $app, $databox_id, $record_id) {
|
||||
$controllers->get('/records/{databox_id}/{record_id}/status/', function (SilexApplication $app, $databox_id, $record_id) {
|
||||
return $app['api']
|
||||
->get_record_status($app['request'], $databox_id, $record_id)
|
||||
->get_response();
|
||||
@@ -469,7 +469,7 @@ class V1 implements ControllerProviderInterface
|
||||
* RECORD_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->get('/records/{databox_id}/{record_id}/related/', function(SilexApplication $app, $databox_id, $record_id) {
|
||||
$controllers->get('/records/{databox_id}/{record_id}/related/', function (SilexApplication $app, $databox_id, $record_id) {
|
||||
return $app['api']
|
||||
->get_record_related($app['request'], $databox_id, $record_id)
|
||||
->get_response();
|
||||
@@ -487,7 +487,7 @@ class V1 implements ControllerProviderInterface
|
||||
* RECORD_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->get('/records/{databox_id}/{record_id}/embed/', function(SilexApplication $app, $databox_id, $record_id) {
|
||||
$controllers->get('/records/{databox_id}/{record_id}/embed/', function (SilexApplication $app, $databox_id, $record_id) {
|
||||
return $app['api']
|
||||
->get_record_embed($app['request'], $databox_id, $record_id)
|
||||
->get_response();
|
||||
@@ -505,7 +505,7 @@ class V1 implements ControllerProviderInterface
|
||||
* RECORD_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->post('/records/{databox_id}/{record_id}/setmetadatas/', function(SilexApplication $app, $databox_id, $record_id) {
|
||||
$controllers->post('/records/{databox_id}/{record_id}/setmetadatas/', function (SilexApplication $app, $databox_id, $record_id) {
|
||||
return $app['api']
|
||||
->set_record_metadatas($app['request'], $databox_id, $record_id)
|
||||
->get_response();
|
||||
@@ -523,7 +523,7 @@ class V1 implements ControllerProviderInterface
|
||||
* RECORD_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->post('/records/{databox_id}/{record_id}/setstatus/', function(SilexApplication $app, $databox_id, $record_id) {
|
||||
$controllers->post('/records/{databox_id}/{record_id}/setstatus/', function (SilexApplication $app, $databox_id, $record_id) {
|
||||
return $app['api']
|
||||
->set_record_status($app['request'], $databox_id, $record_id)
|
||||
->get_response();
|
||||
@@ -541,7 +541,7 @@ class V1 implements ControllerProviderInterface
|
||||
* RECORD_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->post('/records/{databox_id}/{record_id}/setcollection/', function(SilexApplication $app, $databox_id, $record_id) {
|
||||
$controllers->post('/records/{databox_id}/{record_id}/setcollection/', function (SilexApplication $app, $databox_id, $record_id) {
|
||||
return $app['api']
|
||||
->set_record_collection($app['request'], $databox_id, $record_id)
|
||||
->get_response();
|
||||
@@ -549,7 +549,7 @@ class V1 implements ControllerProviderInterface
|
||||
|
||||
$controllers->post('/records/{wrong_databox_id}/{wrong_record_id}/setcollection/', $bad_request_exception);
|
||||
|
||||
$controllers->get('/records/{databox_id}/{record_id}/', function(SilexApplication $app, $databox_id, $record_id) {
|
||||
$controllers->get('/records/{databox_id}/{record_id}/', function (SilexApplication $app, $databox_id, $record_id) {
|
||||
return $app['api']
|
||||
->get_record($app['request'], $databox_id, $record_id)
|
||||
->get_response();
|
||||
@@ -565,7 +565,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters :
|
||||
*
|
||||
*/
|
||||
$controllers->get('/baskets/list/', function(SilexApplication $app) {
|
||||
$controllers->get('/baskets/list/', function (SilexApplication $app) {
|
||||
return $app['api']->search_baskets($app['request'])->get_response();
|
||||
});
|
||||
|
||||
@@ -577,7 +577,7 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters :
|
||||
*
|
||||
*/
|
||||
$controllers->post('/baskets/add/', function(SilexApplication $app) {
|
||||
$controllers->post('/baskets/add/', function (SilexApplication $app) {
|
||||
return $app['api']->create_basket($app['request'])->get_response();
|
||||
});
|
||||
|
||||
@@ -590,7 +590,7 @@ class V1 implements ControllerProviderInterface
|
||||
* BASKET_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->get('/baskets/{basket_id}/content/', function(SilexApplication $app, $basket_id) {
|
||||
$controllers->get('/baskets/{basket_id}/content/', function (SilexApplication $app, $basket_id) {
|
||||
return $app['api']->get_basket($app['request'], $basket_id)->get_response();
|
||||
})->assert('basket_id', '\d+');
|
||||
|
||||
@@ -605,7 +605,7 @@ class V1 implements ControllerProviderInterface
|
||||
* BASKET_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->post('/baskets/{basket_id}/setname/', function(SilexApplication $app, $basket_id) {
|
||||
$controllers->post('/baskets/{basket_id}/setname/', function (SilexApplication $app, $basket_id) {
|
||||
return $app['api']
|
||||
->set_basket_title($app['request'], $basket_id)
|
||||
->get_response();
|
||||
@@ -622,7 +622,7 @@ class V1 implements ControllerProviderInterface
|
||||
* BASKET_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->post('/baskets/{basket_id}/setdescription/', function(SilexApplication $app, $basket_id) {
|
||||
$controllers->post('/baskets/{basket_id}/setdescription/', function (SilexApplication $app, $basket_id) {
|
||||
return $app['api']
|
||||
->set_basket_description($app['request'], $basket_id)
|
||||
->get_response();
|
||||
@@ -639,7 +639,7 @@ class V1 implements ControllerProviderInterface
|
||||
* BASKET_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->post('/baskets/{basket_id}/delete/', function(SilexApplication $app, $basket_id) {
|
||||
$controllers->post('/baskets/{basket_id}/delete/', function (SilexApplication $app, $basket_id) {
|
||||
return $app['api']->delete_basket($app['request'], $basket_id)->get_response();
|
||||
})->assert('basket_id', '\d+');
|
||||
|
||||
@@ -653,19 +653,19 @@ class V1 implements ControllerProviderInterface
|
||||
* Parameters :
|
||||
*
|
||||
*/
|
||||
$controllers->get('/feeds/list/', function(SilexApplication $app) {
|
||||
$controllers->get('/feeds/list/', function (SilexApplication $app) {
|
||||
return $app['api']
|
||||
->search_publications($app['request'], $app['authentication']->getUser())
|
||||
->get_response();
|
||||
});
|
||||
|
||||
$controllers->get('/feeds/content/', function(SilexApplication $app) {
|
||||
$controllers->get('/feeds/content/', function (SilexApplication $app) {
|
||||
return $app['api']
|
||||
->get_publications($app['request'], $app['authentication']->getUser())
|
||||
->get_response();
|
||||
});
|
||||
|
||||
$controllers->get('/feeds/entry/{entry_id}/', function(SilexApplication $app, $entry_id) {
|
||||
$controllers->get('/feeds/entry/{entry_id}/', function (SilexApplication $app, $entry_id) {
|
||||
return $app['api']
|
||||
->get_feed_entry($app['request'], $entry_id, $app['authentication']->getUser())
|
||||
->get_response();
|
||||
@@ -682,7 +682,7 @@ class V1 implements ControllerProviderInterface
|
||||
* PUBLICATION_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->get('/feeds/{feed_id}/content/', function(SilexApplication $app, $feed_id) {
|
||||
$controllers->get('/feeds/{feed_id}/content/', function (SilexApplication $app, $feed_id) {
|
||||
return $app['api']
|
||||
->get_publication($app['request'], $feed_id, $app['authentication']->getUser())
|
||||
->get_response();
|
||||
@@ -700,7 +700,7 @@ class V1 implements ControllerProviderInterface
|
||||
* RECORD_ID : required INT
|
||||
*
|
||||
*/
|
||||
$controllers->get('/stories/{databox_id}/{story_id}/embed/', function($databox_id, $story_id) use ($app) {
|
||||
$controllers->get('/stories/{databox_id}/{story_id}/embed/', function ($databox_id, $story_id) use ($app) {
|
||||
$result = $app['api']->get_story_embed($app['request'], $databox_id, $story_id);
|
||||
|
||||
return $result->get_response();
|
||||
@@ -709,7 +709,7 @@ class V1 implements ControllerProviderInterface
|
||||
|
||||
$controllers->get('/stories/{any_id}/{anyother_id}/embed/', $bad_request_exception);
|
||||
|
||||
$controllers->get('/stories/{databox_id}/{story_id}/', function($databox_id, $story_id) use ($app) {
|
||||
$controllers->get('/stories/{databox_id}/{story_id}/', function ($databox_id, $story_id) use ($app) {
|
||||
$result = $app['api']->get_story($app['request'], $databox_id, $story_id);
|
||||
|
||||
return $result->get_response();
|
||||
@@ -717,7 +717,7 @@ class V1 implements ControllerProviderInterface
|
||||
|
||||
$controllers->get('/stories/{any_id}/{anyother_id}/', $bad_request_exception);
|
||||
|
||||
$controllers->get('/stories/{databox_id}/{story_id}/', function($databox_id, $story_id) use ($app) {
|
||||
$controllers->get('/stories/{databox_id}/{story_id}/', function ($databox_id, $story_id) use ($app) {
|
||||
$result = $app['api']->get_story($app['request'], $databox_id, $story_id);
|
||||
|
||||
return $result->get_response();
|
||||
|
@@ -25,7 +25,7 @@ class Baskets implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function() use ($app) {
|
||||
$controllers->before(function () use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
@@ -260,7 +260,7 @@ class Baskets implements ControllerProviderInterface
|
||||
$selectedBasket = $app['EM']->getRepository('\Entities\Basket')->findUserBasket($app, $selectedBasketId, $app['authentication']->getUser(), true);
|
||||
}
|
||||
|
||||
$basketCollections = $baskets->partition(function($key, $basket) {
|
||||
$basketCollections = $baskets->partition(function ($key, $basket) {
|
||||
return (Boolean) $basket->getPusherId();
|
||||
});
|
||||
|
||||
|
@@ -26,7 +26,7 @@ class Root implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
if (!$app['authentication']->isAuthenticated() && null !== $request->query->get('nolog')) {
|
||||
return $app->redirectPath('login_authenticate_as_guest', array('redirect' => 'client'));
|
||||
}
|
||||
@@ -151,9 +151,9 @@ class Root implements ControllerProviderInterface
|
||||
$result = $app['phraseanet.SE']->query($query, ($currentPage - 1) * $perPage, $perPage);
|
||||
|
||||
foreach ($options->getDataboxes() as $databox) {
|
||||
$colls = array_map(function(\collection $collection) {
|
||||
$colls = array_map(function (\collection $collection) {
|
||||
return $collection->get_coll_id();
|
||||
}, array_filter($options->getCollections(), function(\collection $collection) use ($databox) {
|
||||
}, array_filter($options->getCollections(), function (\collection $collection) use ($databox) {
|
||||
return $collection->get_databox()->get_sbas_id() == $databox->get_sbas_id();
|
||||
}));
|
||||
|
||||
@@ -406,7 +406,7 @@ class Root implements ControllerProviderInterface
|
||||
$iterator = $finder
|
||||
->directories()
|
||||
->depth(0)
|
||||
->filter(function(\SplFileInfo $fileinfo) {
|
||||
->filter(function (\SplFileInfo $fileinfo) {
|
||||
return ctype_xdigit($fileinfo->getBasename());
|
||||
})
|
||||
->in($cssPath);
|
||||
|
@@ -31,13 +31,13 @@ class Datafiles extends AbstractDelivery
|
||||
|
||||
$that = $this;
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
if (!$app['authentication']->isAuthenticated()) {
|
||||
$app->abort(403, 'You are not autorized to see this');
|
||||
}
|
||||
});
|
||||
|
||||
$controllers->get('/{sbas_id}/{record_id}/{subdef}/', function($sbas_id, $record_id, $subdef, PhraseaApplication $app) use ($that) {
|
||||
$controllers->get('/{sbas_id}/{record_id}/{subdef}/', function ($sbas_id, $record_id, $subdef, PhraseaApplication $app) use ($that) {
|
||||
|
||||
$databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id);
|
||||
$record = new \record_adapter($app, $sbas_id, $record_id);
|
||||
|
@@ -25,7 +25,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
if (!$request->query->has('LOG')) {
|
||||
return;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
}
|
||||
});
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
@@ -92,7 +92,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
})
|
||||
->bind('lightbox');
|
||||
|
||||
$controllers->get('/ajax/NOTE_FORM/{sselcont_id}/', function(SilexApplication $app, $sselcont_id) {
|
||||
$controllers->get('/ajax/NOTE_FORM/{sselcont_id}/', function (SilexApplication $app, $sselcont_id) {
|
||||
|
||||
if (!$app['browser']->isMobile()) {
|
||||
return new Response('');
|
||||
@@ -112,7 +112,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
->bind('lightbox_ajax_note_form')
|
||||
->assert('sselcont_id', '\d+');
|
||||
|
||||
$controllers->get('/ajax/LOAD_BASKET_ELEMENT/{sselcont_id}/', function(SilexApplication $app, $sselcont_id) {
|
||||
$controllers->get('/ajax/LOAD_BASKET_ELEMENT/{sselcont_id}/', function (SilexApplication $app, $sselcont_id) {
|
||||
/* @var $repository \Repositories\BasketElementRepository */
|
||||
$repository = $app['EM']->getRepository('\Entities\BasketElement');
|
||||
|
||||
@@ -158,7 +158,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
->bind('lightbox_ajax_load_basketelement')
|
||||
->assert('sselcont_id', '\d+');
|
||||
|
||||
$controllers->get('/ajax/LOAD_FEED_ITEM/{entry_id}/{item_id}/', function(SilexApplication $app, $entry_id, $item_id) {
|
||||
$controllers->get('/ajax/LOAD_FEED_ITEM/{entry_id}/{item_id}/', function (SilexApplication $app, $entry_id, $item_id) {
|
||||
|
||||
$entry = \Feed_Entry_Adapter::load_from_id($app, $entry_id);
|
||||
$item = new \Feed_Entry_Item($app['phraseanet.appbox'], $entry, $item_id);
|
||||
@@ -339,7 +339,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
->bind('lightbox_feed_entry')
|
||||
->assert('entry_id', '\d+');
|
||||
|
||||
$controllers->get('/ajax/LOAD_REPORT/{ssel_id}/', function(SilexApplication $app, $ssel_id) {
|
||||
$controllers->get('/ajax/LOAD_REPORT/{ssel_id}/', function (SilexApplication $app, $ssel_id) {
|
||||
|
||||
$template = 'lightbox/basket_content_report.html.twig';
|
||||
|
||||
@@ -400,7 +400,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
->bind('lightbox_ajax_set_note')
|
||||
->assert('sselcont_id', '\d+');
|
||||
|
||||
$controllers->post('/ajax/SET_ELEMENT_AGREEMENT/{sselcont_id}/', function(SilexApplication $app, $sselcont_id) {
|
||||
$controllers->post('/ajax/SET_ELEMENT_AGREEMENT/{sselcont_id}/', function (SilexApplication $app, $sselcont_id) {
|
||||
$request = $app['request'];
|
||||
$agreement = $request->request->get('agreement');
|
||||
|
||||
@@ -463,7 +463,7 @@ class Lightbox implements ControllerProviderInterface
|
||||
->bind('lightbox_ajax_set_element_agreement')
|
||||
->assert('sselcont_id', '\d+');
|
||||
|
||||
$controllers->post('/ajax/SET_RELEASE/{ssel_id}/', function(SilexApplication $app, $ssel_id) {
|
||||
$controllers->post('/ajax/SET_RELEASE/{ssel_id}/', function (SilexApplication $app, $ssel_id) {
|
||||
|
||||
$repository = $app['EM']->getRepository('\Entities\Basket');
|
||||
|
||||
|
@@ -45,7 +45,7 @@ class Permalink extends AbstractDelivery
|
||||
return $record;
|
||||
};
|
||||
|
||||
$deliverPermaview = function($sbas_id, $record_id, $token, $subdef, PhraseaApplication $app) use ($retrieveRecord) {
|
||||
$deliverPermaview = function ($sbas_id, $record_id, $token, $subdef, PhraseaApplication $app) use ($retrieveRecord) {
|
||||
$databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id);
|
||||
|
||||
$record = $retrieveRecord($app, $databox, $token, $record_id, $subdef);
|
||||
@@ -61,7 +61,7 @@ class Permalink extends AbstractDelivery
|
||||
return $app['twig']->render('overview.html.twig', $params);
|
||||
};
|
||||
|
||||
$deliverPermalink = function(PhraseaApplication $app, $sbas_id, $record_id, $token, $subdef) use ($that, $retrieveRecord) {
|
||||
$deliverPermalink = function (PhraseaApplication $app, $sbas_id, $record_id, $token, $subdef) use ($that, $retrieveRecord) {
|
||||
$databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id);
|
||||
|
||||
$record = $retrieveRecord($app, $databox, $token, $record_id, $subdef);
|
||||
@@ -113,7 +113,7 @@ class Permalink extends AbstractDelivery
|
||||
return $response;
|
||||
};
|
||||
|
||||
$controllers->get('/v1/{sbas_id}/{record_id}/caption/', function(PhraseaApplication $app, Request $request, $sbas_id, $record_id) {
|
||||
$controllers->get('/v1/{sbas_id}/{record_id}/caption/', function (PhraseaApplication $app, Request $request, $sbas_id, $record_id) {
|
||||
$token = $request->query->get('token');
|
||||
|
||||
$databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id);
|
||||
@@ -138,7 +138,7 @@ class Permalink extends AbstractDelivery
|
||||
->assert('sbas_id', '\d+')
|
||||
->assert('record_id', '\d+');
|
||||
|
||||
$controllers->get('/v1/{label}/{sbas_id}/{record_id}/{token}/{subdef}/view/', function(PhraseaApplication $app, $label, $sbas_id, $record_id, $token, $subdef) use ($deliverPermaview) {
|
||||
$controllers->get('/v1/{label}/{sbas_id}/{record_id}/{token}/{subdef}/view/', function (PhraseaApplication $app, $label, $sbas_id, $record_id, $token, $subdef) use ($deliverPermaview) {
|
||||
return $deliverPermaview($sbas_id, $record_id, $token, $subdef, $app);
|
||||
})
|
||||
->bind('permalinks_permaview_old')
|
||||
@@ -154,7 +154,7 @@ class Permalink extends AbstractDelivery
|
||||
->assert('sbas_id', '\d+')
|
||||
->assert('record_id', '\d+');
|
||||
|
||||
$controllers->get('/v1/{label}/{sbas_id}/{record_id}/{token}/{subdef}/', function(PhraseaApplication $app, $label, $sbas_id, $record_id, $token, $subdef) use ($deliverPermalink) {
|
||||
$controllers->get('/v1/{label}/{sbas_id}/{record_id}/{token}/{subdef}/', function (PhraseaApplication $app, $label, $sbas_id, $record_id, $token, $subdef) use ($deliverPermalink) {
|
||||
return $deliverPermalink($app, $sbas_id, $record_id, $token, $subdef);
|
||||
})
|
||||
->bind('permalinks_permalink_old')
|
||||
|
@@ -33,7 +33,7 @@ class Basket implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
|
@@ -23,7 +23,7 @@ class Bridge implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRight('bas_chupub');
|
||||
});
|
||||
|
||||
|
@@ -26,7 +26,7 @@ class Download implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
|
@@ -30,13 +30,13 @@ class Edit implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']
|
||||
->requireNotGuest()
|
||||
->requireRight('modifyrecord');
|
||||
});
|
||||
|
||||
$controllers->post('/', function(Application $app, Request $request) {
|
||||
$controllers->post('/', function (Application $app, Request $request) {
|
||||
|
||||
$records = RecordsRequest::fromRequest($app, $request, RecordsRequest::FLATTEN_YES_PRESERVE_STORIES, array('canmodifrecord'));
|
||||
|
||||
@@ -228,7 +228,7 @@ class Edit implements ControllerProviderInterface
|
||||
return $app['twig']->render('prod/actions/edit_default.html.twig', $params);
|
||||
});
|
||||
|
||||
$controllers->get('/vocabulary/{vocabulary}/', function(Application $app, Request $request, $vocabulary) {
|
||||
$controllers->get('/vocabulary/{vocabulary}/', function (Application $app, Request $request, $vocabulary) {
|
||||
$datas = array('success' => false, 'message' => '', 'results' => array());
|
||||
|
||||
$sbas_id = (int) $request->query->get('sbas_id');
|
||||
@@ -267,7 +267,7 @@ class Edit implements ControllerProviderInterface
|
||||
return $app->json($datas);
|
||||
});
|
||||
|
||||
$controllers->post('/apply/', function(Application $app, Request $request) {
|
||||
$controllers->post('/apply/', function (Application $app, Request $request) {
|
||||
|
||||
$records = RecordsRequest::fromRequest($app, $request, RecordsRequest::FLATTEN_YES_PRESERVE_STORIES, array('canmodifrecord'));
|
||||
|
||||
|
@@ -32,7 +32,7 @@ class Export implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotGuest();
|
||||
});
|
||||
|
||||
|
@@ -31,14 +31,14 @@ class Feed implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
/**
|
||||
* I got a selection of docs, which publications are available forthese docs ?
|
||||
*/
|
||||
$controllers->post('/requestavailable/', function(Application $app, Request $request) {
|
||||
$controllers->post('/requestavailable/', function (Application $app, Request $request) {
|
||||
$feeds = \Feed_Collection::load_all($app, $app['authentication']->getUser());
|
||||
$publishing = RecordsRequest::fromRequest($app, $request, true, array(), array('bas_chupub'));
|
||||
|
||||
@@ -48,7 +48,7 @@ class Feed implements ControllerProviderInterface
|
||||
/**
|
||||
* I've selected a publication for my docs, let's publish them
|
||||
*/
|
||||
$controllers->post('/entry/create/', function(Application $app, Request $request) {
|
||||
$controllers->post('/entry/create/', function (Application $app, Request $request) {
|
||||
try {
|
||||
$feed = new \Feed_Adapter($app, $request->request->get('feed_id'));
|
||||
$publisher = \Feed_Publisher_Adapter::getPublisher($app['phraseanet.appbox'], $feed, $app['authentication']->getUser());
|
||||
@@ -73,11 +73,11 @@ class Feed implements ControllerProviderInterface
|
||||
return $app->json($datas);
|
||||
})
|
||||
->bind('prod_feeds_entry_create')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRight('bas_chupub');
|
||||
});
|
||||
|
||||
$controllers->get('/entry/{id}/edit/', function(Application $app, Request $request, $id) {
|
||||
$controllers->get('/entry/{id}/edit/', function (Application $app, Request $request, $id) {
|
||||
$entry = \Feed_Entry_Adapter::load_from_id($app, $id);
|
||||
|
||||
if (!$entry->is_publisher($app['authentication']->getUser())) {
|
||||
@@ -92,11 +92,11 @@ class Feed implements ControllerProviderInterface
|
||||
})
|
||||
->bind('feed_entry_edit')
|
||||
->assert('id', '\d+')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRight('bas_chupub');
|
||||
});
|
||||
|
||||
$controllers->post('/entry/{id}/update/', function(Application $app, Request $request, $id) {
|
||||
$controllers->post('/entry/{id}/update/', function (Application $app, Request $request, $id) {
|
||||
$datas = array('error' => true, 'message' => '', 'datas' => '');
|
||||
try {
|
||||
$app['phraseanet.appbox']->get_connection()->beginTransaction();
|
||||
@@ -167,11 +167,11 @@ class Feed implements ControllerProviderInterface
|
||||
return $app->json($datas);
|
||||
})
|
||||
->bind('prod_feeds_entry_update')
|
||||
->assert('id', '\d+')->before(function(Request $request) use ($app) {
|
||||
->assert('id', '\d+')->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRight('bas_chupub');
|
||||
});
|
||||
|
||||
$controllers->post('/entry/{id}/delete/', function(Application $app, Request $request, $id) {
|
||||
$controllers->post('/entry/{id}/delete/', function (Application $app, Request $request, $id) {
|
||||
$datas = array('error' => true, 'message' => '');
|
||||
try {
|
||||
$app['phraseanet.appbox']->get_connection()->beginTransaction();
|
||||
@@ -198,11 +198,11 @@ class Feed implements ControllerProviderInterface
|
||||
return $app->json($datas);
|
||||
})
|
||||
->bind('feed_entry_delete')
|
||||
->assert('id', '\d+')->before(function(Request $request) use ($app) {
|
||||
->assert('id', '\d+')->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRight('bas_chupub');
|
||||
});
|
||||
|
||||
$controllers->get('/', function(Application $app, Request $request) {
|
||||
$controllers->get('/', function (Application $app, Request $request) {
|
||||
$request = $app['request'];
|
||||
$page = (int) $request->query->get('page');
|
||||
$page = $page > 0 ? $page : 1;
|
||||
@@ -220,7 +220,7 @@ class Feed implements ControllerProviderInterface
|
||||
return new Response($datas);
|
||||
})->bind('prod_feeds');
|
||||
|
||||
$controllers->get('/feed/{id}/', function(Application $app, Request $request, $id) {
|
||||
$controllers->get('/feed/{id}/', function (Application $app, Request $request, $id) {
|
||||
$page = (int) $request->query->get('page');
|
||||
$page = $page > 0 ? $page : 1;
|
||||
|
||||
@@ -234,7 +234,7 @@ class Feed implements ControllerProviderInterface
|
||||
->bind('prod_feeds_feed')
|
||||
->assert('id', '\d+');
|
||||
|
||||
$controllers->get('/subscribe/aggregated/', function(Application $app, Request $request) {
|
||||
$controllers->get('/subscribe/aggregated/', function (Application $app, Request $request) {
|
||||
$renew = ($request->query->get('renew') === 'true');
|
||||
|
||||
$feeds = \Feed_Collection::load_all($app, $app['authentication']->getUser());
|
||||
@@ -249,7 +249,7 @@ class Feed implements ControllerProviderInterface
|
||||
return $app->json($output);
|
||||
})->bind('prod_feeds_subscribe_aggregated');
|
||||
|
||||
$controllers->get('/subscribe/{id}/', function(Application $app, Request $request, $id) {
|
||||
$controllers->get('/subscribe/{id}/', function (Application $app, Request $request, $id) {
|
||||
$renew = ($request->query->get('renew') === 'true');
|
||||
$feed = \Feed_Adapter::load_with_user($app, $app['authentication']->getUser(), $id);
|
||||
|
||||
|
@@ -26,7 +26,7 @@ class Language implements ControllerProviderInterface
|
||||
{
|
||||
$controller = $app['controllers_factory'];
|
||||
|
||||
$controller->get("/", function(Application $app) {
|
||||
$controller->get("/", function (Application $app) {
|
||||
|
||||
$out = array();
|
||||
$out['thesaurusBasesChanged'] = _('prod::recherche: Attention : la liste des bases selectionnees pour la recherche a ete changee.');
|
||||
|
@@ -42,7 +42,7 @@ class Lazaret implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication()
|
||||
->requireRight('addrecord');
|
||||
});
|
||||
@@ -275,7 +275,7 @@ class Lazaret implements ControllerProviderInterface
|
||||
/* @var $record \record_adapter */
|
||||
|
||||
//Post record creation
|
||||
$callBack = function($element, $visa, $code) use (&$record) {
|
||||
$callBack = function ($element, $visa, $code) use (&$record) {
|
||||
$record = $element;
|
||||
};
|
||||
|
||||
|
@@ -28,7 +28,7 @@ class MoveCollection implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication()
|
||||
->requireRight('addrecord')
|
||||
->requireRight('deleterecord');
|
||||
@@ -44,7 +44,7 @@ class MoveCollection implements ControllerProviderInterface
|
||||
{
|
||||
$records = RecordsRequest::fromRequest($app, $request, false, array('candeleterecord'));
|
||||
|
||||
$sbas_ids = array_map(function(\databox $databox) {
|
||||
$sbas_ids = array_map(function (\databox $databox) {
|
||||
return $databox->get_sbas_id();
|
||||
}, $records->databoxes());
|
||||
|
||||
|
@@ -35,7 +35,7 @@ class Order implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication()
|
||||
->requireRight('order');
|
||||
});
|
||||
@@ -54,7 +54,7 @@ class Order implements ControllerProviderInterface
|
||||
* return : HTML Response
|
||||
*/
|
||||
$controllers->get('/', $this->call('displayOrders'))
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireOrdersAdmin();
|
||||
})
|
||||
->bind('prod_orders');
|
||||
@@ -89,7 +89,7 @@ class Order implements ControllerProviderInterface
|
||||
* return : HTML Response
|
||||
*/
|
||||
$controllers->get('/{order_id}/', $this->call('displayOneOrder'))
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireOrdersAdmin();
|
||||
})
|
||||
->bind('prod_order')
|
||||
@@ -109,7 +109,7 @@ class Order implements ControllerProviderInterface
|
||||
* return : HTML Response | JSON Response
|
||||
*/
|
||||
$controllers->post('/{order_id}/send/', $this->call('sendOrder'))
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireOrdersAdmin();
|
||||
})
|
||||
->bind('prod_order_send')
|
||||
@@ -129,7 +129,7 @@ class Order implements ControllerProviderInterface
|
||||
* return : HTML Response | JSON Response
|
||||
*/
|
||||
$controllers->post('/{order_id}/deny/', $this->call('denyOrder'))
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireOrdersAdmin();
|
||||
})
|
||||
->bind('prod_order_deny')
|
||||
@@ -180,7 +180,7 @@ class Order implements ControllerProviderInterface
|
||||
}
|
||||
}
|
||||
|
||||
$noAdmins = $collectionHasOrderAdmins->forAll(function($key, $hasAdmin) {
|
||||
$noAdmins = $collectionHasOrderAdmins->forAll(function ($key, $hasAdmin) {
|
||||
return false === $hasAdmin;
|
||||
});
|
||||
|
||||
|
@@ -29,14 +29,14 @@ class Printer implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->post('/', function(Application $app) {
|
||||
$controllers->post('/', function (Application $app) {
|
||||
$printer = new RecordHelper\Printer($app, $app['request']);
|
||||
|
||||
return $app['twig']->render('prod/actions/printer_default.html.twig', array('printer' => $printer, 'message' => ''));
|
||||
}
|
||||
);
|
||||
|
||||
$controllers->post('/print.pdf', function(Application $app) {
|
||||
$controllers->post('/print.pdf', function (Application $app) {
|
||||
$printer = new RecordHelper\Printer($app, $app['request']);
|
||||
|
||||
$request = $app['request'];
|
||||
|
@@ -28,7 +28,7 @@ class Property implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotGuest();
|
||||
});
|
||||
|
||||
|
@@ -29,7 +29,7 @@ class Push implements ControllerProviderInterface
|
||||
|
||||
protected function getUserFormatter()
|
||||
{
|
||||
return function(\User_Adapter $user) {
|
||||
return function (\User_Adapter $user) {
|
||||
$subtitle = array_filter(array($user->get_job(), $user->get_company()));
|
||||
|
||||
return array(
|
||||
@@ -48,7 +48,7 @@ class Push implements ControllerProviderInterface
|
||||
{
|
||||
$userFormatter = $this->getUserFormatter();
|
||||
|
||||
return function(\Entities\UsrList $List) use ($userFormatter, $app) {
|
||||
return function (\Entities\UsrList $List) use ($userFormatter, $app) {
|
||||
$entries = array();
|
||||
|
||||
foreach ($List->getEntries() as $entry) {
|
||||
@@ -71,7 +71,7 @@ class Push implements ControllerProviderInterface
|
||||
|
||||
protected function getUsersInSelectionExtractor()
|
||||
{
|
||||
return function(array $selection) {
|
||||
return function (array $selection) {
|
||||
$Users = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
|
||||
foreach ($selection as $record) {
|
||||
@@ -99,7 +99,7 @@ class Push implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication()
|
||||
->requireRight('push');
|
||||
});
|
||||
@@ -110,7 +110,7 @@ class Push implements ControllerProviderInterface
|
||||
|
||||
$userSelection = $this->getUsersInSelectionExtractor();
|
||||
|
||||
$controllers->post('/sendform/', function(Application $app) use ($userSelection) {
|
||||
$controllers->post('/sendform/', function (Application $app) use ($userSelection) {
|
||||
$push = new RecordHelper\Push($app, $app['request']);
|
||||
|
||||
$repository = $app['EM']->getRepository('\Entities\UsrList');
|
||||
@@ -128,7 +128,7 @@ class Push implements ControllerProviderInterface
|
||||
return $app['twig']->render('prod/actions/Push.html.twig', $params);
|
||||
});
|
||||
|
||||
$controllers->post('/validateform/', function(Application $app) use ($userSelection) {
|
||||
$controllers->post('/validateform/', function (Application $app) use ($userSelection) {
|
||||
$push = new RecordHelper\Push($app, $app['request']);
|
||||
|
||||
$repository = $app['EM']->getRepository('\Entities\UsrList');
|
||||
@@ -146,7 +146,7 @@ class Push implements ControllerProviderInterface
|
||||
return $app['twig']->render('prod/actions/Push.html.twig', $params);
|
||||
});
|
||||
|
||||
$controllers->post('/send/', function(Application $app) {
|
||||
$controllers->post('/send/', function (Application $app) {
|
||||
$request = $app['request'];
|
||||
|
||||
$ret = array(
|
||||
@@ -261,7 +261,7 @@ class Push implements ControllerProviderInterface
|
||||
return $app->json($ret);
|
||||
})->bind('prod_push_send');
|
||||
|
||||
$controllers->post('/validate/', function(Application $app) {
|
||||
$controllers->post('/validate/', function (Application $app) {
|
||||
$request = $app['request'];
|
||||
|
||||
$ret = array(
|
||||
@@ -463,7 +463,7 @@ class Push implements ControllerProviderInterface
|
||||
return $app->json($ret);
|
||||
})->bind('prod_push_validate');
|
||||
|
||||
$controllers->get('/user/{usr_id}/', function(Application $app, $usr_id) use ($userFormatter) {
|
||||
$controllers->get('/user/{usr_id}/', function (Application $app, $usr_id) use ($userFormatter) {
|
||||
$datas = null;
|
||||
|
||||
$request = $app['request'];
|
||||
@@ -487,7 +487,7 @@ class Push implements ControllerProviderInterface
|
||||
return $app->json($datas);
|
||||
})->assert('usr_id', '\d+');
|
||||
|
||||
$controllers->get('/list/{list_id}/', function(Application $app, $list_id) use ($listFormatter) {
|
||||
$controllers->get('/list/{list_id}/', function (Application $app, $list_id) use ($listFormatter) {
|
||||
$datas = null;
|
||||
|
||||
$repository = $app['EM']->getRepository('\Entities\UsrList');
|
||||
@@ -503,7 +503,7 @@ class Push implements ControllerProviderInterface
|
||||
->bind('prod_push_lists_list')
|
||||
->assert('list_id', '\d+');
|
||||
|
||||
$controllers->post('/add-user/', function(Application $app, Request $request) use ($userFormatter) {
|
||||
$controllers->post('/add-user/', function (Application $app, Request $request) use ($userFormatter) {
|
||||
$result = array('success' => false, 'message' => '', 'user' => null);
|
||||
|
||||
try {
|
||||
@@ -568,13 +568,13 @@ class Push implements ControllerProviderInterface
|
||||
return $app->json($result);
|
||||
})->bind('prod_push_do_add_user');
|
||||
|
||||
$controllers->get('/add-user/', function(Application $app, Request $request) {
|
||||
$controllers->get('/add-user/', function (Application $app, Request $request) {
|
||||
$params = array('callback' => $request->query->get('callback'));
|
||||
|
||||
return $app['twig']->render('prod/User/Add.html.twig', $params);
|
||||
})->bind('prod_push_add_user');
|
||||
|
||||
$controllers->get('/search-user/', function(Application $app) use ($userFormatter, $listFormatter) {
|
||||
$controllers->get('/search-user/', function (Application $app) use ($userFormatter, $listFormatter) {
|
||||
$request = $app['request'];
|
||||
|
||||
$query = new \User_Query($app);
|
||||
@@ -611,7 +611,7 @@ class Push implements ControllerProviderInterface
|
||||
return $app->json($datas);
|
||||
});
|
||||
|
||||
$controllers->match('/edit-list/{list_id}/', function(Application $app, Request $request, $list_id) {
|
||||
$controllers->match('/edit-list/{list_id}/', function (Application $app, Request $request, $list_id) {
|
||||
|
||||
$repository = $app['EM']->getRepository('\Entities\UsrList');
|
||||
|
||||
|
@@ -30,7 +30,7 @@ class Query implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
@@ -119,9 +119,9 @@ class Query implements ControllerProviderInterface
|
||||
$result = $app['phraseanet.SE']->query($query, (($page - 1) * $perPage), $perPage);
|
||||
|
||||
foreach ($options->getDataboxes() as $databox) {
|
||||
$colls = array_map(function(\collection $collection) {
|
||||
$colls = array_map(function (\collection $collection) {
|
||||
return $collection->get_coll_id();
|
||||
}, array_filter($options->getCollections(), function(\collection $collection) use ($databox) {
|
||||
}, array_filter($options->getCollections(), function (\collection $collection) use ($databox) {
|
||||
return $collection->get_databox()->get_sbas_id() == $databox->get_sbas_id();
|
||||
}));
|
||||
|
||||
|
@@ -28,7 +28,7 @@ class Records implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotGuest();
|
||||
});
|
||||
|
||||
|
@@ -31,7 +31,7 @@ class Root implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
if (!$app['authentication']->isAuthenticated() && null !== $request->query->get('nolog')) {
|
||||
return $app->redirectPath('login_authenticate_as_guest');
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class Root implements ControllerProviderInterface
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
$controllers->get('/', function(Application $app) {
|
||||
$controllers->get('/', function (Application $app) {
|
||||
try {
|
||||
\User_Adapter::updateClientInfos($app, 1);
|
||||
} catch (SessionNotFound $e) {
|
||||
@@ -56,7 +56,7 @@ class Root implements ControllerProviderInterface
|
||||
$iterator = $finder
|
||||
->directories()
|
||||
->depth(0)
|
||||
->filter(function(\SplFileInfo $fileinfo) {
|
||||
->filter(function (\SplFileInfo $fileinfo) {
|
||||
return ctype_xdigit($fileinfo->getBasename());
|
||||
})
|
||||
->in($cssPath);
|
||||
|
@@ -26,7 +26,7 @@ class Share implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotGuest();
|
||||
});
|
||||
|
||||
@@ -44,7 +44,7 @@ class Share implements ControllerProviderInterface
|
||||
* return : HTML Response
|
||||
*/
|
||||
$controllers->get('/record/{base_id}/{record_id}/', $this->call('shareRecord'))
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireRightOnSbas(\phrasea::sbasFromBas($app, $request->attributes->get('base_id')), 'bas_chupub');
|
||||
})
|
||||
->bind('share_record');
|
||||
|
@@ -31,15 +31,15 @@ class Story implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
$controllers->get('/create/', function(Application $app) {
|
||||
$controllers->get('/create/', function (Application $app) {
|
||||
return $app['twig']->render('prod/Story/Create.html.twig', array());
|
||||
})->bind('prod_stories_create');
|
||||
|
||||
$controllers->post('/', function(Application $app, Request $request) {
|
||||
$controllers->post('/', function (Application $app, Request $request) {
|
||||
/* @var $request \Symfony\Component\HttpFoundation\Request */
|
||||
$collection = \collection::get_from_base_id($app, $request->request->get('base_id'));
|
||||
|
||||
@@ -107,7 +107,7 @@ class Story implements ControllerProviderInterface
|
||||
}
|
||||
})->bind('prod_stories_do_create');
|
||||
|
||||
$controllers->get('/{sbas_id}/{record_id}/', function(Application $app, $sbas_id, $record_id) {
|
||||
$controllers->get('/{sbas_id}/{record_id}/', function (Application $app, $sbas_id, $record_id) {
|
||||
$Story = new \record_adapter($app, $sbas_id, $record_id);
|
||||
|
||||
$html = $app['twig']->render('prod/WorkZone/Story.html.twig', array('Story' => $Story));
|
||||
@@ -118,7 +118,7 @@ class Story implements ControllerProviderInterface
|
||||
->assert('sbas_id', '\d+')
|
||||
->assert('record_id', '\d+');
|
||||
|
||||
$controllers->post('/{sbas_id}/{record_id}/addElements/', function(Application $app, Request $request, $sbas_id, $record_id) {
|
||||
$controllers->post('/{sbas_id}/{record_id}/addElements/', function (Application $app, Request $request, $sbas_id, $record_id) {
|
||||
$Story = new \record_adapter($app, $sbas_id, $record_id);
|
||||
|
||||
if (!$app['authentication']->getUser()->ACL()->has_right_on_base($Story->get_base_id(), 'canmodifrecord'))
|
||||
@@ -149,7 +149,7 @@ class Story implements ControllerProviderInterface
|
||||
}
|
||||
})->assert('sbas_id', '\d+')->assert('record_id', '\d+');
|
||||
|
||||
$controllers->post('/{sbas_id}/{record_id}/delete/{child_sbas_id}/{child_record_id}/', function(Application $app, Request $request, $sbas_id, $record_id, $child_sbas_id, $child_record_id) {
|
||||
$controllers->post('/{sbas_id}/{record_id}/delete/{child_sbas_id}/{child_record_id}/', function (Application $app, Request $request, $sbas_id, $record_id, $child_sbas_id, $child_record_id) {
|
||||
$Story = new \record_adapter($app, $sbas_id, $record_id);
|
||||
|
||||
$record = new \record_adapter($app, $child_sbas_id, $child_record_id);
|
||||
@@ -179,7 +179,7 @@ class Story implements ControllerProviderInterface
|
||||
/**
|
||||
* Get the Basket reorder form
|
||||
*/
|
||||
$controllers->get('/{sbas_id}/{record_id}/reorder/', function(Application $app, $sbas_id, $record_id) {
|
||||
$controllers->get('/{sbas_id}/{record_id}/reorder/', function (Application $app, $sbas_id, $record_id) {
|
||||
$story = new \record_adapter($app, $sbas_id, $record_id);
|
||||
|
||||
if (!$story->is_grouping()) {
|
||||
@@ -197,7 +197,7 @@ class Story implements ControllerProviderInterface
|
||||
->assert('sbas_id', '\d+')
|
||||
->assert('record_id', '\d+');
|
||||
|
||||
$controllers->post('/{sbas_id}/{record_id}/reorder/', function(Application $app, $sbas_id, $record_id) {
|
||||
$controllers->post('/{sbas_id}/{record_id}/reorder/', function (Application $app, $sbas_id, $record_id) {
|
||||
$ret = array('success' => false, 'message' => _('An error occured'));
|
||||
try {
|
||||
|
||||
|
@@ -44,7 +44,7 @@ class TOU implements ControllerProviderInterface
|
||||
*/
|
||||
$controllers->post('/deny/{sbas_id}/', $this->call('denyTermsOfUse'))
|
||||
->bind('deny_tou')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
|
@@ -30,12 +30,12 @@ class Tools implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication()
|
||||
->requireRight('doctools');
|
||||
});
|
||||
|
||||
$controllers->get('/', function(Application $app, Request $request) {
|
||||
$controllers->get('/', function (Application $app, Request $request) {
|
||||
|
||||
$records = RecordsRequest::fromRequest($app, $request, false);
|
||||
|
||||
@@ -66,7 +66,7 @@ class Tools implements ControllerProviderInterface
|
||||
return $app['twig']->render('prod/actions/Tools/index.html.twig', $var);
|
||||
});
|
||||
|
||||
$controllers->post('/rotate/', function(Application $app, Request $request) {
|
||||
$controllers->post('/rotate/', function (Application $app, Request $request) {
|
||||
$return = array('success' => true, 'errorMessage' => '');
|
||||
|
||||
$records = RecordsRequest::fromRequest($app, $request, false);
|
||||
@@ -89,7 +89,7 @@ class Tools implements ControllerProviderInterface
|
||||
return $app->json($return);
|
||||
})->bind('prod_tools_rotate');
|
||||
|
||||
$controllers->post('/image/', function(Application $app, Request $request) {
|
||||
$controllers->post('/image/', function (Application $app, Request $request) {
|
||||
$return = array('success' => true);
|
||||
|
||||
$selection = RecordsRequest::fromRequest($app, $request, false, array('canmodifrecord'));
|
||||
@@ -112,7 +112,7 @@ class Tools implements ControllerProviderInterface
|
||||
return $app->json($return);
|
||||
})->bind('prod_tools_image');
|
||||
|
||||
$controllers->post('/hddoc/', function(Application $app, Request $request) {
|
||||
$controllers->post('/hddoc/', function (Application $app, Request $request) {
|
||||
$success = false;
|
||||
$message = _('An error occured');
|
||||
|
||||
@@ -173,7 +173,7 @@ class Tools implements ControllerProviderInterface
|
||||
));
|
||||
})->bind('prod_tools_hd_substitution');
|
||||
|
||||
$controllers->post('/chgthumb/', function(Application $app, Request $request) {
|
||||
$controllers->post('/chgthumb/', function (Application $app, Request $request) {
|
||||
$success = false;
|
||||
$message = _('An error occured');
|
||||
|
||||
@@ -227,7 +227,7 @@ class Tools implements ControllerProviderInterface
|
||||
));
|
||||
})->bind('prod_tools_thumbnail_substitution');
|
||||
|
||||
$controllers->post('/thumb-extractor/confirm-box/', function(Application $app, Request $request) {
|
||||
$controllers->post('/thumb-extractor/confirm-box/', function (Application $app, Request $request) {
|
||||
$return = array('error' => false, 'datas' => '');
|
||||
$template = 'prod/actions/Tools/confirm.html.twig';
|
||||
|
||||
@@ -246,7 +246,7 @@ class Tools implements ControllerProviderInterface
|
||||
return $app->json($return);
|
||||
});
|
||||
|
||||
$controllers->post('/thumb-extractor/apply/', function(Application $app, Request $request) {
|
||||
$controllers->post('/thumb-extractor/apply/', function (Application $app, Request $request) {
|
||||
$return = array('success' => false, 'message' => '');
|
||||
|
||||
try {
|
||||
|
@@ -28,7 +28,7 @@ class Tooltip implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
|
@@ -45,7 +45,7 @@ class Upload implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication()
|
||||
->requireRight('addrecord');
|
||||
});
|
||||
@@ -220,7 +220,7 @@ class Upload implements ControllerProviderInterface
|
||||
$reasons = array();
|
||||
$elementCreated = null;
|
||||
|
||||
$callback = function($element, $visa, $code) use (&$reasons, &$elementCreated) {
|
||||
$callback = function ($element, $visa, $code) use (&$reasons, &$elementCreated) {
|
||||
foreach ($visa->getResponses() as $response) {
|
||||
if (!$response->isOk()) {
|
||||
$reasons[] = $response->getMessage();
|
||||
|
@@ -33,7 +33,7 @@ class UsrLists implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
|
@@ -32,7 +32,7 @@ class WorkZone implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
|
@@ -141,7 +141,7 @@ class RecordsRequest extends ArrayCollection
|
||||
public function stories()
|
||||
{
|
||||
return new ArrayCollection(
|
||||
array_filter($this->toArray(), function(\record_adapter $record) {
|
||||
array_filter($this->toArray(), function (\record_adapter $record) {
|
||||
return $record->is_grouping();
|
||||
})
|
||||
);
|
||||
|
@@ -23,7 +23,7 @@ class Activity implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function() use ($app) {
|
||||
$controllers->before(function () use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
$app['firewall']->requireAccessToModule('report');
|
||||
});
|
||||
|
@@ -23,7 +23,7 @@ class Export implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function() use ($app) {
|
||||
$controllers->before(function () use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
$app['firewall']->requireAccessToModule('report');
|
||||
});
|
||||
|
@@ -22,7 +22,7 @@ class Informations implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function() use ($app) {
|
||||
$controllers->before(function () use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
$app['firewall']->requireAccessToModule('report');
|
||||
});
|
||||
|
@@ -23,12 +23,12 @@ class Root implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function() use ($app) {
|
||||
$controllers->before(function () use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
$app['firewall']->requireAccessToModule('report');
|
||||
});
|
||||
|
||||
$controllers->get('/', function(Application $app) {
|
||||
$controllers->get('/', function (Application $app) {
|
||||
return $app->redirectPath('report_dashboard');
|
||||
})->bind('report');
|
||||
|
||||
|
@@ -33,7 +33,7 @@ class Account implements ControllerProviderInterface
|
||||
|
||||
$app['account.controller'] = $this;
|
||||
|
||||
$controllers->before(function() use ($app) {
|
||||
$controllers->before(function () use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
|
@@ -30,7 +30,7 @@ class Developers implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function() use ($app) {
|
||||
$controllers->before(function () use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
|
@@ -51,7 +51,7 @@ class Login implements ControllerProviderInterface
|
||||
{
|
||||
$items = array();
|
||||
|
||||
foreach(\Feed_Entry_Item::loadLatest($app, 20) as $item) {
|
||||
foreach (\Feed_Entry_Item::loadLatest($app, 20) as $item) {
|
||||
$record = $item->get_record();
|
||||
$preview = $record->get_subdef('preview');
|
||||
$permalink = $preview->get_permalink();
|
||||
@@ -92,7 +92,7 @@ class Login implements ControllerProviderInterface
|
||||
|
||||
$app['login.controller'] = $this;
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
if ($request->getPathInfo() == $app->path('homepage')) {
|
||||
return;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ class Login implements ControllerProviderInterface
|
||||
|
||||
// Displays the homepage
|
||||
$controllers->get('/', 'login.controller:login')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotAuthenticated();
|
||||
|
||||
if (null !== $request->query->get('postlog')) {
|
||||
@@ -125,14 +125,14 @@ class Login implements ControllerProviderInterface
|
||||
|
||||
// Authentication end point
|
||||
$controllers->post('/authenticate/', 'login.controller:authenticate')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotAuthenticated();
|
||||
})
|
||||
->bind('login_authenticate');
|
||||
|
||||
// Guest access end point
|
||||
$controllers->match('/authenticate/guest/', 'login.controller:authenticateAsGuest')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotAuthenticated();
|
||||
})
|
||||
->bind('login_authenticate_as_guest')
|
||||
@@ -140,67 +140,67 @@ class Login implements ControllerProviderInterface
|
||||
|
||||
// Authenticate with an AuthProvider
|
||||
$controllers->get('/provider/{providerId}/authenticate/', 'login.controller:authenticateWithProvider')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotAuthenticated();
|
||||
})
|
||||
->bind('login_authentication_provider_authenticate');
|
||||
|
||||
// AuthProviders callbacks
|
||||
$controllers->get('/provider/{providerId}/callback/', 'login.controller:authenticationCallback')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotAuthenticated();
|
||||
})->bind('login_authentication_provider_callback');
|
||||
|
||||
// Logout end point
|
||||
$controllers->get('/logout/', 'login.controller:logout')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
})->bind('logout');
|
||||
|
||||
// Registration end point ; redirects to classic registration or AuthProvider registration
|
||||
$controllers->get('/register/', 'login.controller:displayRegisterForm')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotAuthenticated();
|
||||
})->bind('login_register');
|
||||
|
||||
// Classic registration end point
|
||||
$controllers->match('/register-classic/', 'login.controller:doRegistration')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotAuthenticated();
|
||||
})
|
||||
->bind('login_register_classic');
|
||||
|
||||
// Provide a JSON serialization of registration fields configuration
|
||||
$controllers->get('/registration-fields/', function(PhraseaApplication $app, Request $request) {
|
||||
$controllers->get('/registration-fields/', function (PhraseaApplication $app, Request $request) {
|
||||
return $app->json($app['registration.fields']);
|
||||
})->bind('login_registration_fields');
|
||||
|
||||
// Unlocks an email address that is currently locked
|
||||
$controllers->get('/register-confirm/', 'login.controller:registerConfirm')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotAuthenticated();
|
||||
})->bind('login_register_confirm');
|
||||
|
||||
// Displays a form to send an account unlock email again
|
||||
$controllers->get('/send-mail-confirm/', 'login.controller:sendConfirmMail')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotAuthenticated();
|
||||
})->bind('login_send_mail');
|
||||
|
||||
// Forgot password end point
|
||||
$controllers->match('/forgot-password/', 'login.controller:forgotPassword')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotAuthenticated();
|
||||
})->bind('login_forgot_password');
|
||||
|
||||
// Renew password end point
|
||||
$controllers->match('/renew-password/', 'login.controller:renewPassword')
|
||||
->before(function(Request $request) use ($app) {
|
||||
->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotAuthenticated();
|
||||
})->bind('login_renew_password');
|
||||
|
||||
// Displays Terms of use
|
||||
$controllers->get('/cgus', function(PhraseaApplication $app, Request $request) {
|
||||
$controllers->get('/cgus', function (PhraseaApplication $app, Request $request) {
|
||||
return $app['twig']->render('login/cgus.html.twig', array_merge(
|
||||
array('cgus' => \databox_cgu::getHome($app)),
|
||||
self::getDefaultTemplateVariables($app)
|
||||
|
@@ -27,7 +27,7 @@ class RSSFeeds implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$display_feed = function(Application $app, $feed, $format, $page, $user = null) {
|
||||
$display_feed = function (Application $app, $feed, $format, $page, $user = null) {
|
||||
$total = $feed->get_count_total_entries();
|
||||
$perPage = 5;
|
||||
$entries = $feed->get_entries((($page - 1) * $perPage), $perPage);
|
||||
@@ -76,7 +76,7 @@ class RSSFeeds implements ControllerProviderInterface
|
||||
return $response;
|
||||
};
|
||||
|
||||
$controllers->get('/feed/{id}/{format}/', function(Application $app, $id, $format) use ($display_feed) {
|
||||
$controllers->get('/feed/{id}/{format}/', function (Application $app, $id, $format) use ($display_feed) {
|
||||
$feed = new \Feed_Adapter($app, $id);
|
||||
|
||||
if (!$feed->is_public()) {
|
||||
@@ -94,7 +94,7 @@ class RSSFeeds implements ControllerProviderInterface
|
||||
->assert('id', '\d+')
|
||||
->assert('format', '(rss|atom)');
|
||||
|
||||
$controllers->get('/userfeed/{token}/{id}/{format}/', function(Application $app, $token, $id, $format) use ($display_feed) {
|
||||
$controllers->get('/userfeed/{token}/{id}/{format}/', function (Application $app, $token, $id, $format) use ($display_feed) {
|
||||
$token = new \Feed_Token($app, $token, $id);
|
||||
$feed = $token->get_feed();
|
||||
|
||||
@@ -109,7 +109,7 @@ class RSSFeeds implements ControllerProviderInterface
|
||||
->assert('id', '\d+')
|
||||
->assert('format', '(rss|atom)');
|
||||
|
||||
$controllers->get('/userfeed/aggregated/{token}/{format}/', function(Application $app, $token, $format) use ($display_feed) {
|
||||
$controllers->get('/userfeed/aggregated/{token}/{format}/', function (Application $app, $token, $format) use ($display_feed) {
|
||||
$token = new \Feed_TokenAggregate($app, $token);
|
||||
$feed = $token->get_feed();
|
||||
|
||||
@@ -123,7 +123,7 @@ class RSSFeeds implements ControllerProviderInterface
|
||||
->bind('feed_user_aggregated')
|
||||
->assert('format', '(rss|atom)');
|
||||
|
||||
$controllers->get('/aggregated/{format}/', function(Application $app, $format) use ($display_feed) {
|
||||
$controllers->get('/aggregated/{format}/', function (Application $app, $format) use ($display_feed) {
|
||||
$feeds = \Feed_Collection::load_public_feeds($app);
|
||||
$feed = $feeds->get_aggregate();
|
||||
|
||||
@@ -136,7 +136,7 @@ class RSSFeeds implements ControllerProviderInterface
|
||||
->bind('feed_public_aggregated')
|
||||
->assert('format', '(rss|atom)');
|
||||
|
||||
$controllers->get('/cooliris/', function(Application $app) use ($display_feed) {
|
||||
$controllers->get('/cooliris/', function (Application $app) use ($display_feed) {
|
||||
$feeds = \Feed_Collection::load_public_feeds($app);
|
||||
$feed = $feeds->get_aggregate();
|
||||
|
||||
|
@@ -39,7 +39,7 @@ class Session implements ControllerProviderInterface
|
||||
->bind('update_session');
|
||||
|
||||
$controllers->post('/delete/{id}', $this->call('deleteSession'))
|
||||
->before(function() use ($app) {
|
||||
->before(function () use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
})
|
||||
->bind('delete_session');
|
||||
|
@@ -30,7 +30,7 @@ class Setup implements ControllerProviderInterface
|
||||
|
||||
$app['controller.setup'] = $this;
|
||||
|
||||
$controllers->get('/', function(Application $app) {
|
||||
$controllers->get('/', function (Application $app) {
|
||||
return $app->redirectPath('install_root');
|
||||
})->bind('setup');
|
||||
|
||||
|
@@ -22,7 +22,7 @@ class Thesaurus implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function() use ($app) {
|
||||
$controllers->before(function () use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
$app['firewall']->requireAccessToModule('thesaurus');
|
||||
});
|
||||
|
@@ -24,7 +24,7 @@ class Xmlhttp implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function() use ($app) {
|
||||
$controllers->before(function () use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
$app['firewall']->requireAccessToModule('thesaurus');
|
||||
});
|
||||
|
@@ -26,7 +26,7 @@ class Notifications implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireNotGuest();
|
||||
});
|
||||
|
||||
|
@@ -26,7 +26,7 @@ class Preferences implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->before(function(Request $request) use ($app) {
|
||||
$controllers->before(function (Request $request) use ($app) {
|
||||
$app['firewall']->requireAuthentication();
|
||||
});
|
||||
|
||||
|
@@ -29,7 +29,7 @@ class ConnectionTest implements ControllerProviderInterface
|
||||
/**
|
||||
* @todo : check this as it would lead to a security issue
|
||||
*/
|
||||
$controllers->get('/mysql/', function(Application $app) {
|
||||
$controllers->get('/mysql/', function (Application $app) {
|
||||
|
||||
$request = $app['request'];
|
||||
$hostname = $request->query->get('hostname', '127.0.0.1');
|
||||
|
@@ -30,7 +30,7 @@ class PathFileTest implements ControllerProviderInterface
|
||||
/**
|
||||
* @todo : check this as it would lead to a security issue
|
||||
*/
|
||||
$controllers->get('/path/', function(Application $app, Request $request) {
|
||||
$controllers->get('/path/', function (Application $app, Request $request) {
|
||||
return $app->json(array(
|
||||
'exists' => file_exists($request->query->get('path'))
|
||||
, 'file' => is_file($request->query->get('path'))
|
||||
@@ -41,7 +41,7 @@ class PathFileTest implements ControllerProviderInterface
|
||||
));
|
||||
});
|
||||
|
||||
$controllers->get('/url/', function(Application $app, Request $request) {
|
||||
$controllers->get('/url/', function (Application $app, Request $request) {
|
||||
return $app->json(array('code' => \http_query::getHttpCodeFromUrl($request->query->get('url'))));
|
||||
});
|
||||
|
||||
|
@@ -20,39 +20,39 @@ class LessBuilderServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['phraseanet.less-assets'] = $app->share(function($app) {
|
||||
$app['phraseanet.less-assets'] = $app->share(function ($app) {
|
||||
return array(
|
||||
$app['root.path'] . '/www/assets/bootstrap/img/glyphicons-halflings-white.png' => $app['root.path'] . '/www/skins/build/bootstrap/img/glyphicons-halflings-white.png',
|
||||
$app['root.path'] . '/www/assets/bootstrap/img/glyphicons-halflings.png' => $app['root.path'] . '/www/skins/build/bootstrap/img/glyphicons-halflings.png',
|
||||
);
|
||||
});
|
||||
|
||||
$app['phraseanet.less-mapping.base'] = $app->share(function($app) {
|
||||
$app['phraseanet.less-mapping.base'] = $app->share(function ($app) {
|
||||
return array(
|
||||
$app['root.path'] . '/www/assets/bootstrap/less/bootstrap.less' => $app['root.path'] . '/www/skins/build/bootstrap/css/bootstrap.css',
|
||||
$app['root.path'] . '/www/assets/bootstrap/less/responsive.less' => $app['root.path'] . '/www/skins/build/bootstrap/css/bootstrap-responsive.css',
|
||||
);
|
||||
});
|
||||
|
||||
$app['phraseanet.less-mapping.customizable'] = $app->share(function($app) {
|
||||
$app['phraseanet.less-mapping.customizable'] = $app->share(function ($app) {
|
||||
return array(
|
||||
$app['root.path'] . '/www/skins/login/less/login.less' => $app['root.path'] . '/www/skins/build/login.css',
|
||||
$app['root.path'] . '/www/skins/account/account.less' => $app['root.path'] . '/www/skins/build/account.css',
|
||||
);
|
||||
});
|
||||
|
||||
$app['phraseanet.less-mapping'] = $app->share(function($app) {
|
||||
$app['phraseanet.less-mapping'] = $app->share(function ($app) {
|
||||
return array_merge(
|
||||
$app['phraseanet.less-mapping.base'],
|
||||
$app['phraseanet.less-mapping.customizable']
|
||||
);
|
||||
});
|
||||
|
||||
$app['phraseanet.less-compiler'] = $app->share(function($app) {
|
||||
$app['phraseanet.less-compiler'] = $app->share(function ($app) {
|
||||
return new LessCompiler($app['filesystem'], $app['driver.recess']);
|
||||
});
|
||||
|
||||
$app['phraseanet.less-builder'] = $app->share(function($app) {
|
||||
$app['phraseanet.less-builder'] = $app->share(function ($app) {
|
||||
return new LessBuilder($app['phraseanet.less-compiler'], $app['filesystem']);
|
||||
});
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ class PhraseaLocaleSubscriber implements EventSubscriberInterface
|
||||
)
|
||||
);
|
||||
|
||||
$this->app['locale'] = $this->app->share(function(Application $app) use ($event) {
|
||||
$this->app['locale'] = $this->app->share(function (Application $app) use ($event) {
|
||||
if (isset($app['phraseanet.registry'])) {
|
||||
$event->getRequest()->setDefaultLocale(
|
||||
$app['phraseanet.registry']->get('GV_default_lng', 'en_GB')
|
||||
|
@@ -32,15 +32,15 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['authentication'] = $app->share(function (Application $app){
|
||||
$app['authentication'] = $app->share(function (Application $app) {
|
||||
return new Authenticator($app, $app['browser'], $app['session'], $app['EM']);
|
||||
});
|
||||
|
||||
$app['authentication.token-validator'] = $app->share(function (Application $app){
|
||||
$app['authentication.token-validator'] = $app->share(function (Application $app) {
|
||||
return new TokenValidator($app);
|
||||
});
|
||||
|
||||
$app['authentication.persistent-manager'] = $app->share(function (Application $app){
|
||||
$app['authentication.persistent-manager'] = $app->share(function (Application $app) {
|
||||
return new CookieManager($app['auth.password-encoder'], $app['EM'], $app['browser']);
|
||||
});
|
||||
|
||||
@@ -128,7 +128,7 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface
|
||||
public function boot(Application $app)
|
||||
{
|
||||
$app['dispatcher'] = $app->share(
|
||||
$app->extend('dispatcher', function($dispatcher, Application $app){
|
||||
$app->extend('dispatcher', function ($dispatcher, Application $app) {
|
||||
$dispatcher->addSubscriber(new PersistentCookieSubscriber($app));
|
||||
|
||||
return $dispatcher;
|
||||
|
@@ -21,7 +21,7 @@ class BorderManagerServiceProvider implements ServiceProviderInterface
|
||||
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['border-manager'] = $app->share(function(Application $app) {
|
||||
$app['border-manager'] = $app->share(function (Application $app) {
|
||||
$borderManager = new Manager($app);
|
||||
|
||||
try {
|
||||
|
@@ -19,7 +19,7 @@ class BrowserServiceProvider implements ServiceProviderInterface
|
||||
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['browser'] = $app->share(function($app) {
|
||||
$app['browser'] = $app->share(function ($app) {
|
||||
return new \Browser();
|
||||
});
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ class CacheServiceProvider implements ServiceProviderInterface
|
||||
return new Factory();
|
||||
});
|
||||
|
||||
$app['phraseanet.cache-service'] = $app->share(function(Application $app) {
|
||||
$app['phraseanet.cache-service'] = $app->share(function (Application $app) {
|
||||
return new CacheManager(
|
||||
$app['phraseanet.cache-compiler'],
|
||||
$app['phraseanet.cache-registry'],
|
||||
@@ -41,13 +41,13 @@ class CacheServiceProvider implements ServiceProviderInterface
|
||||
);
|
||||
});
|
||||
|
||||
$app['cache'] = $app->share(function(Application $app) {
|
||||
$app['cache'] = $app->share(function (Application $app) {
|
||||
$conf = $app['phraseanet.configuration']['main']['cache'];
|
||||
|
||||
return $app['phraseanet.cache-service']->factory('cache', $conf['type'], $conf['options']);
|
||||
});
|
||||
|
||||
$app['opcode-cache'] = $app->share(function(Application $app) {
|
||||
$app['opcode-cache'] = $app->share(function (Application $app) {
|
||||
$conf = $app['phraseanet.configuration']['main']['opcodecache'];
|
||||
|
||||
return $app['phraseanet.cache-service']->factory('cache', $conf['type'], $conf['options']);
|
||||
|
@@ -32,7 +32,7 @@ class ConfigurationServiceProvider implements ServiceProviderInterface
|
||||
$app['phraseanet.configuration.config-path'] = $app['root.path'] . '/config/configuration.yml';
|
||||
$app['phraseanet.configuration.config-compiled-path'] = $app['root.path'] . '/tmp/configuration-compiled.php';
|
||||
|
||||
$app['phraseanet.configuration'] = $app->share(function(SilexApplication $app) {
|
||||
$app['phraseanet.configuration'] = $app->share(function (SilexApplication $app) {
|
||||
return new Configuration(
|
||||
$app['phraseanet.configuration.yaml-parser'],
|
||||
$app['phraseanet.configuration.compiler'],
|
||||
@@ -49,7 +49,7 @@ class ConfigurationServiceProvider implements ServiceProviderInterface
|
||||
public function boot(SilexApplication $app)
|
||||
{
|
||||
$app['dispatcher'] = $app->share(
|
||||
$app->extend('dispatcher', function($dispatcher, SilexApplication $app){
|
||||
$app->extend('dispatcher', function ($dispatcher, SilexApplication $app) {
|
||||
$dispatcher->addSubscriber(new TrustedProxySubscriber($app['phraseanet.configuration']));
|
||||
|
||||
return $dispatcher;
|
||||
|
@@ -21,7 +21,7 @@ class ConfigurationTesterServiceProvider implements ServiceProviderInterface
|
||||
|
||||
public function register(SilexApplication $app)
|
||||
{
|
||||
$app['phraseanet.configuration-tester'] = $app->share(function(Application $app) {
|
||||
$app['phraseanet.configuration-tester'] = $app->share(function (Application $app) {
|
||||
return new ConfigurationTester($app);
|
||||
});
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ class FileServeServiceProvider implements ServiceProviderInterface
|
||||
*/
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['phraseanet.xsendfile-factory'] = $app->share(function($app) {
|
||||
$app['phraseanet.xsendfile-factory'] = $app->share(function ($app) {
|
||||
return XSendFileFactory::create($app);
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@ class FileServeServiceProvider implements ServiceProviderInterface
|
||||
public function boot(Application $app)
|
||||
{
|
||||
$app['dispatcher'] = $app->share(
|
||||
$app->extend('dispatcher', function($dispatcher, Application $app){
|
||||
$app->extend('dispatcher', function ($dispatcher, Application $app) {
|
||||
$dispatcher->addSubscriber(new XSendFileSubscriber($app));
|
||||
|
||||
return $dispatcher;
|
||||
|
@@ -19,17 +19,17 @@ class LocaleServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['locale'] = $app->share(function(Application $app){
|
||||
$app['locale'] = $app->share(function (Application $app) {
|
||||
return $app['phraseanet.registry']->get('GV_default_lng', 'en_GB');
|
||||
});
|
||||
|
||||
$app['locale.I18n'] = function(Application $app){
|
||||
$app['locale.I18n'] = function (Application $app) {
|
||||
$data = explode('_', $app['locale']);
|
||||
|
||||
return $data[0];
|
||||
};
|
||||
|
||||
$app['locale.l10n'] = function(Application $app){
|
||||
$app['locale.l10n'] = function (Application $app) {
|
||||
$data = explode('_', $app['locale']);
|
||||
|
||||
return $data[1];
|
||||
|
@@ -22,7 +22,7 @@ class NotificationDelivererServiceProvider implements ServiceProviderInterface
|
||||
return $app['phraseanet.registry']->get('GV_email_prefix');
|
||||
});
|
||||
|
||||
$app['notification.deliverer'] = $app->share(function($app) {
|
||||
$app['notification.deliverer'] = $app->share(function ($app) {
|
||||
return new Deliverer(
|
||||
$app['mailer'],
|
||||
$app['dispatcher'],
|
||||
|
@@ -40,7 +40,7 @@ class ORMServiceProvider implements ServiceProviderInterface
|
||||
return new MonologSQLLogger($logger, 'yaml');
|
||||
});
|
||||
|
||||
$app['EM'] = $app->share(function(Application $app) {
|
||||
$app['EM'] = $app->share(function (Application $app) {
|
||||
|
||||
$config = new ORMConfiguration();
|
||||
|
||||
|
@@ -19,7 +19,7 @@ class PhraseaVersionServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
public function register(SilexApplication $app)
|
||||
{
|
||||
$app['phraseanet.version'] = $app->share(function(SilexApplication $app) {
|
||||
$app['phraseanet.version'] = $app->share(function (SilexApplication $app) {
|
||||
return new Version();
|
||||
});
|
||||
}
|
||||
|
@@ -19,19 +19,19 @@ class PhraseanetServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
public function register(SilexApplication $app)
|
||||
{
|
||||
$app['phraseanet.appbox'] = $app->share(function(SilexApplication $app) {
|
||||
$app['phraseanet.appbox'] = $app->share(function (SilexApplication $app) {
|
||||
return new \appbox($app);
|
||||
});
|
||||
|
||||
$app['phraseanet.registry'] = $app->share(function(SilexApplication $app) {
|
||||
$app['phraseanet.registry'] = $app->share(function (SilexApplication $app) {
|
||||
return new \registry($app);
|
||||
});
|
||||
|
||||
$app['firewall'] = $app->share(function(SilexApplication $app) {
|
||||
$app['firewall'] = $app->share(function (SilexApplication $app) {
|
||||
return new Firewall($app);
|
||||
});
|
||||
|
||||
$app['events-manager'] = $app->share(function(SilexApplication $app) {
|
||||
$app['events-manager'] = $app->share(function (SilexApplication $app) {
|
||||
$events = new \eventsmanager_broker($app);
|
||||
$events->start();
|
||||
|
||||
|
@@ -23,7 +23,7 @@ class PluginServiceProvider implements ServiceProviderInterface
|
||||
public function boot(Application $app)
|
||||
{
|
||||
$app['twig'] = $app->share(
|
||||
$app->extend('twig', function($twig, Application $app){
|
||||
$app->extend('twig', function ($twig, Application $app) {
|
||||
$function = new \Twig_SimpleFunction('plugin_asset', array('Alchemy\Phrasea\Plugin\Management\AssetsManager', 'twigPluginAsset'));
|
||||
$twig->addFunction($function);
|
||||
|
||||
|
@@ -20,11 +20,11 @@ class RegistrationServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['registration.fields'] = $app->share(function (Application $app){
|
||||
$app['registration.fields'] = $app->share(function (Application $app) {
|
||||
return isset($app['phraseanet.configuration']['registration-fields']) ? $app['phraseanet.configuration']['registration-fields'] : array();
|
||||
});
|
||||
|
||||
$app['registration.enabled'] = $app->share(function (Application $app){
|
||||
$app['registration.enabled'] = $app->share(function (Application $app) {
|
||||
require_once __DIR__ . '/../../../../classes/deprecated/inscript.api.php';
|
||||
|
||||
$bases = giveMeBases($app);
|
||||
|
@@ -22,7 +22,7 @@ class SearchEngineServiceProvider implements ServiceProviderInterface
|
||||
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['phraseanet.SE'] = $app->share(function($app) {
|
||||
$app['phraseanet.SE'] = $app->share(function ($app) {
|
||||
|
||||
$engineClass = $app['phraseanet.configuration']['main']['search-engine']['type'];
|
||||
$engineOptions = $app['phraseanet.configuration']['main']['search-engine']['options'];
|
||||
@@ -34,7 +34,7 @@ class SearchEngineServiceProvider implements ServiceProviderInterface
|
||||
return $engineClass::create($app, $engineOptions);
|
||||
});
|
||||
|
||||
$app['phraseanet.SE.logger'] = $app->share(function(Application $app) {
|
||||
$app['phraseanet.SE.logger'] = $app->share(function (Application $app) {
|
||||
return new SearchEngineLogger($app);
|
||||
});
|
||||
}
|
||||
|
@@ -20,14 +20,14 @@ class TaskManagerServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['task-manager.logger'] = $app->share(function(Application $app) {
|
||||
$app['task-manager.logger'] = $app->share(function (Application $app) {
|
||||
$logger = new Logger('task-manager logger');
|
||||
$logger->pushHandler(new NullHandler());
|
||||
|
||||
return $logger;
|
||||
});
|
||||
|
||||
$app['task-manager'] = $app->share(function(Application $app) {
|
||||
$app['task-manager'] = $app->share(function (Application $app) {
|
||||
return new \task_manager($app, $app['task-manager.logger']);
|
||||
});
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ class TokensServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['tokens'] = $app->share(function($app) {
|
||||
$app['tokens'] = $app->share(function ($app) {
|
||||
return new \random($app);
|
||||
});
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ class UnicodeServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['unicode'] = $app->share(function($app) {
|
||||
$app['unicode'] = $app->share(function ($app) {
|
||||
return new \unicode();
|
||||
});
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ class Printer extends RecordHelper
|
||||
{
|
||||
parent::__construct($app, $Request);
|
||||
|
||||
$grep = function(\record_adapter $record) {
|
||||
$grep = function (\record_adapter $record) {
|
||||
|
||||
try {
|
||||
return $record->get_thumbnail()->get_type() == \media_subdef::TYPE_IMAGE ||
|
||||
|
@@ -19,7 +19,7 @@ class TagProvider extends ExiftoolTagProvider
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this['Phraseanet'] = $this->share(function(){
|
||||
$this['Phraseanet'] = $this->share(function () {
|
||||
return array(
|
||||
'PdfText' => new \Alchemy\Phrasea\Metadata\Tag\PdfText(),
|
||||
'TfArchivedate' => new \Alchemy\Phrasea\Metadata\Tag\TfArchivedate(),
|
||||
|
@@ -697,16 +697,16 @@ class PhraseaEngine implements SearchEngineInterface
|
||||
}
|
||||
}
|
||||
if ($this->options->getFields()) {
|
||||
$this->queries[$sbas] .= ' IN (' . implode(' OR ', array_map(function(\databox_field $field) {
|
||||
$this->queries[$sbas] .= ' IN (' . implode(' OR ', array_map(function (\databox_field $field) {
|
||||
return $field->get_name();
|
||||
}, $this->options->getFields())) . ')';
|
||||
}
|
||||
if (($this->options->getMinDate() || $this->options->getMaxDate()) && $this->options->getDateFields()) {
|
||||
if ($this->options->getMinDate()) {
|
||||
$this->queries[$sbas] .= ' AND ( ' . implode(' >= ' . $this->options->getMinDate()->format('Y-m-d') . ' OR ', array_map(function(\databox_field $field){ return $field->get_name(); }, $this->options->getDateFields())) . ' >= ' . $this->options->getMinDate()->format('Y-m-d') . ' ) ';
|
||||
$this->queries[$sbas] .= ' AND ( ' . implode(' >= ' . $this->options->getMinDate()->format('Y-m-d') . ' OR ', array_map(function (\databox_field $field) { return $field->get_name(); }, $this->options->getDateFields())) . ' >= ' . $this->options->getMinDate()->format('Y-m-d') . ' ) ';
|
||||
}
|
||||
if ($this->options->getMaxDate()) {
|
||||
$this->queries[$sbas] .= ' AND ( ' . implode(' <= ' . $this->options->getMaxDate()->format('Y-m-d') . ' OR ', array_map(function(\databox_field $field){ return $field->get_name(); }, $this->options->getDateFields())) . ' <= ' . $this->options->getMaxDate()->format('Y-m-d') . ' ) ';
|
||||
$this->queries[$sbas] .= ' AND ( ' . implode(' <= ' . $this->options->getMaxDate()->format('Y-m-d') . ' OR ', array_map(function (\databox_field $field) { return $field->get_name(); }, $this->options->getDateFields())) . ' <= ' . $this->options->getMaxDate()->format('Y-m-d') . ' ) ';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -717,7 +717,7 @@ class PhraseaEngine implements SearchEngineInterface
|
||||
$this->singleParse($sbas, $this->queries[$sbas]);
|
||||
}
|
||||
|
||||
$base_ids = array_map(function(\collection $collection) {
|
||||
$base_ids = array_map(function (\collection $collection) {
|
||||
return $collection->get_base_id();
|
||||
}, $this->options->getCollections());
|
||||
|
||||
|
@@ -38,7 +38,7 @@ class SearchEngineLogger
|
||||
':date' => date("Y-m-d H:i:s"),
|
||||
':query' => $query,
|
||||
':nbresults' => $answers,
|
||||
':colls' => implode(',', array_map(function($coll_id) {
|
||||
':colls' => implode(',', array_map(function ($coll_id) {
|
||||
return (int) $coll_id;
|
||||
}, $coll_ids)),
|
||||
));
|
||||
|
@@ -473,12 +473,12 @@ class SearchEngineOptions
|
||||
$value = $value->format(DATE_ATOM);
|
||||
}
|
||||
if (in_array($key, array('date_fields', 'fields'))) {
|
||||
$value = array_map(function(\databox_field $field) {
|
||||
$value = array_map(function (\databox_field $field) {
|
||||
return $field->get_databox()->get_sbas_id() . '_' . $field->get_id();
|
||||
}, $value);
|
||||
}
|
||||
if (in_array($key, array('collections', 'business_fields'))) {
|
||||
$value = array_map(function($collection) {
|
||||
$value = array_map(function ($collection) {
|
||||
return $collection->get_base_id();
|
||||
}, $value);
|
||||
}
|
||||
@@ -529,7 +529,7 @@ class SearchEngineOptions
|
||||
}
|
||||
break;
|
||||
case in_array($key, array('date_fields', 'fields')):
|
||||
$value = array_map(function($serialized) use ($app) {
|
||||
$value = array_map(function ($serialized) use ($app) {
|
||||
$data = explode('_', $serialized);
|
||||
|
||||
return \databox_field::get_instance($app, $app['phraseanet.appbox']->get_databox($data[0]), $data[1]);
|
||||
@@ -537,7 +537,7 @@ class SearchEngineOptions
|
||||
}, $value);
|
||||
break;
|
||||
case in_array($key, array('collections', 'business_fields')):
|
||||
$value = array_map(function($base_id) use ($app) {
|
||||
$value = array_map(function ($base_id) use ($app) {
|
||||
return \collection::get_from_base_id($app, $base_id);
|
||||
}, $value);
|
||||
break;
|
||||
@@ -620,7 +620,7 @@ class SearchEngineOptions
|
||||
$options->setLocale($app['locale.I18n']);
|
||||
|
||||
if (is_array($request->get('bases'))) {
|
||||
$bas = array_map(function($base_id) use ($app) {
|
||||
$bas = array_map(function ($base_id) use ($app) {
|
||||
return \collection::get_from_base_id($app, $base_id);
|
||||
}, $request->get('bases'));
|
||||
} elseif (!$app['authentication']->isAuthenticated()) {
|
||||
@@ -629,7 +629,7 @@ class SearchEngineOptions
|
||||
$bas = $app['authentication']->getUser()->ACL()->get_granted_base();
|
||||
}
|
||||
|
||||
$bas = array_filter($bas, function($collection) use ($app) {
|
||||
$bas = array_filter($bas, function ($collection) use ($app) {
|
||||
if ($app['authentication']->isAuthenticated()) {
|
||||
return $app['authentication']->getUser()->ACL()->has_access_to_base($collection->get_base_id());
|
||||
} else {
|
||||
@@ -646,7 +646,7 @@ class SearchEngineOptions
|
||||
}
|
||||
|
||||
if ($app['authentication']->isAuthenticated() && $app['authentication']->getUser()->ACL()->has_right('modifyrecord')) {
|
||||
$BF = array_filter($bas, function($collection) use ($app) {
|
||||
$BF = array_filter($bas, function ($collection) use ($app) {
|
||||
return $app['authentication']->getUser()->ACL()->has_right_on_base($collection->get_base_id(), 'canmodifrecord');
|
||||
});
|
||||
|
||||
|
@@ -625,7 +625,7 @@ class SphinxSearchEngine implements SearchEngineInterface
|
||||
$this->sphinx->SetFilter('parent_record_id', array($options->getSearchType()));
|
||||
|
||||
if ($options->getDateFields() && ($options->getMaxDate() || $options->getMinDate())) {
|
||||
foreach (array_unique(array_map(function(\databox_field $field) {
|
||||
foreach (array_unique(array_map(function (\databox_field $field) {
|
||||
return $field->get_name();
|
||||
}, $options->getDateFields())) as $field) {
|
||||
|
||||
|
@@ -35,7 +35,7 @@ class Migration31 implements MigrationInterface
|
||||
require __DIR__ . '/../../../../../../config/_GV.php';
|
||||
$GV = require __DIR__ . '/../../../../../../lib/conf.d/_GV_template.inc';
|
||||
|
||||
$retrieve_old_credentials = function() {
|
||||
$retrieve_old_credentials = function () {
|
||||
require __DIR__ . '/../../../../../../config/connexion.inc';
|
||||
|
||||
return array(
|
||||
|
@@ -35,7 +35,7 @@ class Migration35 implements MigrationInterface
|
||||
$config['registration-fields'][$key]['required'] = (boolean) $field['required'];
|
||||
}
|
||||
|
||||
$retrieve_old_credentials = function() {
|
||||
$retrieve_old_credentials = function () {
|
||||
require __DIR__ . '/../../../../../../config/connexion.inc';
|
||||
|
||||
return array(
|
||||
@@ -52,7 +52,7 @@ class Migration35 implements MigrationInterface
|
||||
$config['main']['database'][$key] = (string) $value;
|
||||
}
|
||||
|
||||
$retrieve_old_parameters = function() {
|
||||
$retrieve_old_parameters = function () {
|
||||
require __DIR__ . '/../../../../../../config/config.inc';
|
||||
|
||||
return array(
|
||||
|
@@ -20,7 +20,7 @@
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class API_OAuth2_Exception_Redirect_Unauthorized extends API_OAuth2_Exception_Redirect
|
||||
class API_OAuth2_Exception_Redirect_TemporaryUnavailable extends API_OAuth2_Exception_Redirect
|
||||
{
|
||||
/**
|
||||
*
|
||||
@@ -39,7 +39,7 @@ class API_OAuth2_Exception_Redirect_Unauthorized extends API_OAuth2_Exception_Re
|
||||
* @param string $redirect_uri
|
||||
* @param string $state
|
||||
* @param string $error_uri
|
||||
* @return API_OAuth2_Exception_Redirect_Unauthorized
|
||||
* @return API_OAuth2_Exception_Redirect_TemporaryUnavailable
|
||||
*/
|
||||
public function __construct($redirect_uri, $state = null, $error_uri = null)
|
||||
{
|
||||
|
@@ -686,7 +686,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
|
||||
$reasons = $output = null;
|
||||
|
||||
$callback = function($element, $visa, $code) use (&$reasons, &$output) {
|
||||
$callback = function ($element, $visa, $code) use (&$reasons, &$output) {
|
||||
if (!$visa->isValid()) {
|
||||
$reasons = array();
|
||||
|
||||
@@ -899,9 +899,9 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
$search_result = $this->app['phraseanet.SE']->query($query, $offsetStart, $perPage);
|
||||
|
||||
foreach ($options->getDataboxes() as $databox) {
|
||||
$colls = array_map(function(\collection $collection) {
|
||||
$colls = array_map(function (\collection $collection) {
|
||||
return $collection->get_coll_id();
|
||||
}, array_filter($options->getCollections(), function(\collection $collection) use ($databox) {
|
||||
}, array_filter($options->getCollections(), function (\collection $collection) use ($databox) {
|
||||
return $collection->get_databox()->get_sbas_id() == $databox->get_sbas_id();
|
||||
}));
|
||||
|
||||
@@ -1905,7 +1905,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
|
||||
$caption = $story->get_caption();
|
||||
|
||||
$format = function(caption_record $caption, $dcField) {
|
||||
$format = function (caption_record $caption, $dcField) {
|
||||
|
||||
$field = $caption->get_dc_field($dcField);
|
||||
|
||||
|
@@ -173,7 +173,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function list_elements($type, $offset_start = 0, $quantity = 10)
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($type, $offset_start, $quantity ) {
|
||||
$action = function (Bridge_Api $obj) use ($type, $offset_start, $quantity) {
|
||||
return $obj->get_connector()->list_elements($type, $offset_start, $quantity);
|
||||
};
|
||||
|
||||
@@ -189,7 +189,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function list_containers($type, $offset_start = 0, $quantity = 10)
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($type, $offset_start, $quantity ) {
|
||||
$action = function (Bridge_Api $obj) use ($type, $offset_start, $quantity) {
|
||||
return $obj->get_connector()->list_containers($type, $offset_start, $quantity);
|
||||
};
|
||||
|
||||
@@ -205,7 +205,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function update_element($object, $object_id, Array $datas)
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($object, $object_id, $datas) {
|
||||
$action = function (Bridge_Api $obj) use ($object, $object_id, $datas) {
|
||||
return $obj->get_connector()->update_element($object, $object_id, $datas);
|
||||
};
|
||||
|
||||
@@ -220,7 +220,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function create_container($container_type, Request $request)
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($container_type, $request) {
|
||||
$action = function (Bridge_Api $obj) use ($container_type, $request) {
|
||||
return $obj->get_connector()->create_container($container_type, $request);
|
||||
};
|
||||
|
||||
@@ -237,7 +237,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function add_element_to_container($element_type, $element_id, $destination, $container_id)
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($element_type, $element_id, $destination, $container_id) {
|
||||
$action = function (Bridge_Api $obj) use ($element_type, $element_id, $destination, $container_id) {
|
||||
return $obj->get_connector()->add_element_to_container($element_type, $element_id, $destination, $container_id);
|
||||
};
|
||||
|
||||
@@ -252,7 +252,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function delete_object($object, $object_id)
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($object, $object_id) {
|
||||
$action = function (Bridge_Api $obj) use ($object, $object_id) {
|
||||
return $obj->get_connector()->delete_object($object, $object_id);
|
||||
};
|
||||
|
||||
@@ -265,7 +265,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function acceptable_records()
|
||||
{
|
||||
$action = function(Bridge_Api $obj) {
|
||||
$action = function (Bridge_Api $obj) {
|
||||
return $obj->get_connector()->acceptable_records();
|
||||
};
|
||||
|
||||
@@ -280,7 +280,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function get_element_from_id($element_id, $type)
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($element_id, $type) {
|
||||
$action = function (Bridge_Api $obj) use ($element_id, $type) {
|
||||
return $obj->get_connector()->get_element_from_id($element_id, $type);
|
||||
};
|
||||
|
||||
@@ -295,7 +295,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function get_container_from_id($element_id, $type)
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($element_id, $type) {
|
||||
$action = function (Bridge_Api $obj) use ($element_id, $type) {
|
||||
return $obj->get_connector()->get_container_from_id($element_id, $type);
|
||||
};
|
||||
|
||||
@@ -308,7 +308,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function get_category_list()
|
||||
{
|
||||
$action = function(Bridge_Api $obj) {
|
||||
$action = function (Bridge_Api $obj) {
|
||||
return $obj->get_connector()->get_category_list();
|
||||
};
|
||||
|
||||
@@ -323,7 +323,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function get_element_status(Bridge_Element $element)
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($element) {
|
||||
$action = function (Bridge_Api $obj) use ($element) {
|
||||
return $obj->get_connector()->get_element_status($element);
|
||||
};
|
||||
|
||||
@@ -337,7 +337,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function map_connector_to_element_status($status)
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($status) {
|
||||
$action = function (Bridge_Api $obj) use ($status) {
|
||||
return $obj->get_connector()->map_connector_to_element_status($status);
|
||||
};
|
||||
|
||||
@@ -351,7 +351,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function get_error_message_from_status($connector_status)
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($connector_status) {
|
||||
$action = function (Bridge_Api $obj) use ($connector_status) {
|
||||
return $obj->get_connector()->get_error_message_from_status($connector_status);
|
||||
};
|
||||
|
||||
@@ -366,7 +366,7 @@ class Bridge_Api
|
||||
*/
|
||||
public function upload(record_adapter $record, array $options = array())
|
||||
{
|
||||
$action = function(Bridge_Api $obj) use ($record, $options) {
|
||||
$action = function (Bridge_Api $obj) use ($record, $options) {
|
||||
return $obj->get_connector()->upload($record, $options);
|
||||
};
|
||||
|
||||
|
@@ -370,7 +370,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
||||
);
|
||||
|
||||
if ( ! $this->is_valid_object_id($object_id))
|
||||
throw new Bridge_Exception_InvalidObjectId($object_id);
|
||||
throw new Bridge_Exception_ActionInvalidObjectId($object_id);
|
||||
|
||||
switch ($object) {
|
||||
case self::ELEMENT_TYPE_VIDEO :
|
||||
@@ -804,7 +804,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
||||
public function check_upload_constraints(Array $datas, record_adapter $record)
|
||||
{
|
||||
$errors = $this->check_record_constraints($record);
|
||||
$check = function($field) use (&$errors, $datas, $record) {
|
||||
$check = function ($field) use (&$errors, $datas, $record) {
|
||||
$key = $record->get_serialize_key();
|
||||
$required = ! ! $field["required"];
|
||||
$name = $field["name"];
|
||||
@@ -830,7 +830,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
||||
public function check_update_constraints(Array $datas)
|
||||
{
|
||||
$errors = array();
|
||||
$check = function($field) use (&$errors, $datas) {
|
||||
$check = function ($field) use (&$errors, $datas) {
|
||||
$required = ! ! $field["required"];
|
||||
$name = $field["name"];
|
||||
$length = (int) $field["length"];
|
||||
|
@@ -697,7 +697,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
public function check_upload_constraints(array $datas, record_adapter $record)
|
||||
{
|
||||
$errors = $this->check_record_constraints($record);
|
||||
$check = function($field) use (&$errors, $datas, $record) {
|
||||
$check = function ($field) use (&$errors, $datas, $record) {
|
||||
$key = $record->get_serialize_key();
|
||||
$name = $field['name'];
|
||||
$length = (int) $field['length'];
|
||||
@@ -720,7 +720,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
public function check_update_constraints(Array $datas)
|
||||
{
|
||||
$errors = array();
|
||||
$check = function($field) use (&$errors, $datas) {
|
||||
$check = function ($field) use (&$errors, $datas) {
|
||||
$name = $field['name'];
|
||||
$length = (int) $field['length'];
|
||||
$required = ! ! $field['required'];
|
||||
|
@@ -304,7 +304,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
}
|
||||
|
||||
if ( ! $this->is_valid_object_id($object_id))
|
||||
throw new Bridge_Exception_InvalidObjectId($object_id);
|
||||
throw new Bridge_Exception_ActionInvalidObjectId($object_id);
|
||||
|
||||
switch ($object) {
|
||||
case "video" :
|
||||
@@ -912,7 +912,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
{
|
||||
$errors = $this->check_record_constraints($record);
|
||||
|
||||
$check = function($field) use (&$errors, $datas, $record) {
|
||||
$check = function ($field) use (&$errors, $datas, $record) {
|
||||
$key = $record->get_serialize_key();
|
||||
$name = $field['name'];
|
||||
$length = (int) $field['length'];
|
||||
@@ -939,7 +939,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
public function check_update_constraints(Array $datas)
|
||||
{
|
||||
$errors = array();
|
||||
$check = function($field) use (&$errors, $datas) {
|
||||
$check = function ($field) use (&$errors, $datas) {
|
||||
$name = $field['name'];
|
||||
$length = (int) $field['length'];
|
||||
$required = ! ! $field['required'];
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class Bridge_Exception_InvalidObjectId extends Bridge_Exception
|
||||
class Bridge_Exception_ActionInvalidObjectId extends Bridge_Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user