Files
Phraseanet/lib/Alchemy/Phrasea/ControllerProvider/Prod/Tools.php
2015-06-01 14:56:38 +02:00

65 lines
1.9 KiB
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\ControllerProvider\Prod;
use Alchemy\Phrasea\Application as PhraseaApplication;
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
use Silex\Application;
use Silex\ControllerProviderInterface;
class Tools implements ControllerProviderInterface
{
use ControllerProviderTrait;
public function register(Application $app)
{
$app['controller.prod.tools'] = $app->share(function (PhraseaApplication $app) {
return (new ToolsController($app));
});
}
public function boot(Application $app)
{
// no-op
}
public function connect(Application $app)
{
$controllers = $this->createAuthenticatedCollection($app);
$firewall = $this->getFirewall($app);
$controllers->before(function () use ($firewall) {
$firewall->requireRight('doctools');
});
$controllers->get('/', 'controller.prod.tools:indexAction');
$controllers->post('/rotate/', 'controller.prod.tools:rotateAction')
->bind('prod_tools_rotate');
$controllers->post('/image/', 'controller.prod.tools:imageAction')
->bind('prod_tools_image');
$controllers->post('/hddoc/', 'controller.prod.tools:hddocAction')
->bind('prod_tools_hd_substitution');
$controllers->post('/chgthumb/', 'controller.prod.tools:changeThumbnailAction')
->bind('prod_tools_thumbnail_substitution');
$controllers->post('/thumb-extractor/confirm-box/', 'controller.prod.tools:submitConfirmBoxAction');
$controllers->post('/thumb-extractor/apply/', 'controller.prod.tools:applyThumbnailExtractionAction');
return $controllers;
}
}