initiate phraseanet service admin

This commit is contained in:
aynsix
2020-07-28 10:50:46 +03:00
parent 7cb92db256
commit 206f1f5941
6 changed files with 80 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ namespace Alchemy\Phrasea\Application;
use Alchemy\EmbedProvider\EmbedServiceProvider; use Alchemy\EmbedProvider\EmbedServiceProvider;
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\ControllerProvider as Providers; use Alchemy\Phrasea\ControllerProvider as Providers;
use Alchemy\Phrasea\PhraseanetService\Provider\PSAdminServiceprovider;
use Alchemy\Phrasea\Report\ControllerProvider\ProdReportControllerProvider; use Alchemy\Phrasea\Report\ControllerProvider\ProdReportControllerProvider;
use Alchemy\Phrasea\WorkerManager\Provider\ControllerServiceProvider as WorkerManagerProvider; use Alchemy\Phrasea\WorkerManager\Provider\ControllerServiceProvider as WorkerManagerProvider;
use Assert\Assertion; use Assert\Assertion;
@@ -30,6 +31,7 @@ class RouteLoader
'/admin/subdefs' => Providers\Admin\Subdefs::class, '/admin/subdefs' => Providers\Admin\Subdefs::class,
'/admin/task-manager' => Providers\Admin\TaskManager::class, '/admin/task-manager' => Providers\Admin\TaskManager::class,
'/admin/worker-manager' => WorkerManagerProvider::class, '/admin/worker-manager' => WorkerManagerProvider::class,
'/admin/phraseanet-service' => PSAdminServiceprovider::class,
'/admin/users' => Providers\Admin\Users::class, '/admin/users' => Providers\Admin\Users::class,
'/client/' => Providers\Client\Root::class, '/client/' => Providers\Client\Root::class,
'/datafiles' => Providers\Datafiles::class, '/datafiles' => Providers\Datafiles::class,

View File

@@ -3,6 +3,7 @@
namespace Alchemy\Phrasea\ControllerProvider; namespace Alchemy\Phrasea\ControllerProvider;
use Alchemy\EmbedProvider\EmbedServiceProvider; use Alchemy\EmbedProvider\EmbedServiceProvider;
use Alchemy\Phrasea\PhraseanetService\Provider\PSAdminServiceprovider;
use Silex\Application; use Silex\Application;
use Silex\ServiceProviderInterface; use Silex\ServiceProviderInterface;
@@ -55,6 +56,7 @@ class ControllerProviderServiceProvider implements ServiceProviderInterface
Admin\Subdefs::class => [], Admin\Subdefs::class => [],
Admin\TaskManager::class => [], Admin\TaskManager::class => [],
\Alchemy\Phrasea\WorkerManager\Provider\ControllerServiceProvider::class => [], \Alchemy\Phrasea\WorkerManager\Provider\ControllerServiceProvider::class => [],
PSAdminServiceprovider::class => [],
Admin\Users::class => [], Admin\Users::class => [],
Client\Root::class => [], Client\Root::class => [],
Datafiles::class => [], Datafiles::class => [],

View File

@@ -0,0 +1,15 @@
<?php
namespace Alchemy\Phrasea\PhraseanetService\Controller;
use Alchemy\Phrasea\Application as PhraseaApplication;
use Alchemy\Phrasea\Controller\Controller;
class PSAdminController extends Controller
{
public function indexAction(PhraseaApplication $app)
{
return $this->render('admin/phraseanet-service/index.html.twig');
}
}

View File

@@ -0,0 +1,59 @@
<?php
namespace Alchemy\Phrasea\PhraseanetService\Provider;
use Alchemy\Phrasea\Application as PhraseaApplication;
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
use Alchemy\Phrasea\PhraseanetService\Controller\PSAdminController;
use Silex\Application;
use Silex\ControllerCollection;
use Silex\ControllerProviderInterface;
use Silex\ServiceProviderInterface;
class PSAdminServiceprovider implements ControllerProviderInterface, ServiceProviderInterface
{
use ControllerProviderTrait;
/**
* Registers services on the given app.
*
* This method should only be used to configure services and parameters.
* It should not get services.
*/
public function register(Application $app)
{
$app['controller.ps.admin'] = $app->share(function (PhraseaApplication $app) {
return new PSAdminController($app);
});
}
/**
* Returns routes to connect to the given application.
*
* @param Application $app An Application instance
*
* @return ControllerCollection A ControllerCollection instance
*/
public function connect(Application $app)
{
$controllers = $this->createAuthenticatedCollection($app);
$controllers->match('/', 'controller.ps.admin:indexAction')
->method('GET')
->bind('ps_admin');
return $controllers;
}
/**
* Bootstraps the application.
*
* This method is called after all services are registered
* and should be used for "dynamic" configuration (whenever
* a service must be requested).
*/
public function boot(Application $app)
{
}
}

View File

@@ -0,0 +1 @@
<h1>Phraseanet Service setting</h1>

View File

@@ -23,7 +23,7 @@
</a> </a>
</li> </li>
<li> <li>
<a target="right" href="{{ path('setup_display_globals') }}" class="ajax"> <a target="right" href="{{ path('ps_admin') }}" class="ajax">
<img width="16" src="/assets/admin/images/toolbox-solid.svg" /> <img width="16" src="/assets/admin/images/toolbox-solid.svg" />
<span>{% trans %}Phraseanet setting (beta){% endtrans %}</span> <span>{% trans %}Phraseanet setting (beta){% endtrans %}</span>
</a> </a>