module.config.php 31.8 KB
Newer Older
Bertrand Gauthier's avatar
Bertrand Gauthier committed
1
<?php
2

Bertrand Gauthier's avatar
Bertrand Gauthier committed
3
4
namespace UnicaenApp;

5
use UnicaenApp\Controller\CacheControllerFactory;
6
7
use UnicaenApp\Controller\ConsoleController;
use UnicaenApp\Controller\ConsoleControllerFactory;
8
use UnicaenApp\Controller\InstadiaControllerFactory;
9
10
use UnicaenApp\Form\View\Helper\FormControlGroup;
use UnicaenApp\Form\View\Helper\FormControlGroupFactory;
11
12
use UnicaenApp\HostLocalization\HostLocalization;
use UnicaenApp\HostLocalization\HostLocalizationFactory;
13
14
use UnicaenApp\Message\View\Helper\MessageHelper;
use UnicaenApp\Message\View\Helper\MessageHelperFactory;
15
16
use UnicaenApp\Mvc\RedirectResponse;
use UnicaenApp\Mvc\RedirectResponseFactory;
17
use UnicaenApp\ORM\Query\Functions\Chr;
18
19
use UnicaenApp\ORM\Query\Functions\CompriseEntre;
use UnicaenApp\ORM\Query\Functions\PasHistorise;
20
use UnicaenApp\ORM\Query\Functions\Replace;
21
use UnicaenApp\Service\InstadiaServiceFactory;
22
23
use UnicaenApp\Service\Mailer\MailerService;
use UnicaenApp\Service\Mailer\MailerServiceFactory;
24
25
use UnicaenApp\Service\SQL\RunSQLService;
use UnicaenApp\Service\SQL\RunSQLServiceFactory;
26
use UnicaenApp\ServiceManager\ServiceLocatorAwareInitializer;
27
28
29
30
31
use UnicaenApp\View\Helper\AppInfos;
use UnicaenApp\View\Helper\AppInfosFactory;
use UnicaenApp\View\Helper\AppLink;
use UnicaenApp\View\Helper\AppLinkFactory;
use UnicaenApp\View\Helper\HeadLink;
32
use UnicaenApp\View\Helper\HeadLinkFactory;
33
use UnicaenApp\View\Helper\HeadScript;
34
use UnicaenApp\View\Helper\HeadScriptFactory;
35
use UnicaenApp\View\Helper\InlineScript;
36
use UnicaenApp\View\Helper\InlineScriptFactory;
37
use UnicaenApp\View\Helper\InstadiaViewHelper;
38
use UnicaenApp\View\Helper\InstadiaViewHelperFactory;
39
use UnicaenApp\View\Helper\MessageCollectorHelper;
40
use UnicaenApp\View\Helper\MessageCollectorHelperFactory;
41
42
43
44
45
use UnicaenApp\View\Helper\Messenger;
use UnicaenApp\View\Helper\MessengerFactory;
use UnicaenApp\View\Helper\QueryParams;
use UnicaenApp\View\Helper\QueryParamsHelperFactory;
use UnicaenApp\View\Helper\Upload\UploaderHelper;
46
use UnicaenApp\View\Helper\Upload\UploaderHelperFactory;
47
use UnicaenApp\View\Helper\UserProfileSelect;
48
use UnicaenApp\View\Helper\UserProfileSelectFactory;
49
use Zend\Mvc\Console\Router\Simple;
50

51
52
53
return [
    'router'          => [
        'routes' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
54
            // Base “route”, which describes the base match needed, the root of the tree
55
            'home'             => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
56
                // The Literal route is for doing exact matching of the URI path
57
                'type'    => 'Literal',
58
                'options' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
59
                    'route'    => '/',
60
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
61
62
                        'controller' => 'Application\Controller\Index',
                        'action'     => 'index',
63
64
65
                    ],
                ],
            ],
66
            // A propos
67
            'apropos'          => [
68
                'type'     => 'Literal',
69
                'options'  => [
70
                    'route'    => '/apropos',
71
                    'defaults' => [
72
73
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'apropos',
74
75
                    ],
                ],
76
                'priority' => 9999,
77
            ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
78
            // Contact
79
            'contact'          => [
80
                'type'     => 'Literal',
81
                'options'  => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
82
                    'route'    => '/contact',
83
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
84
85
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'contact',
86
87
                    ],
                ],
88
                'priority' => 9999,
89
            ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
90
            // Plan de navigation
91
            'plan'             => [
92
                'type'     => 'Literal',
93
                'options'  => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
94
                    'route'    => '/plan',
95
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
96
97
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'plan',
98
99
                    ],
                ],
100
                'priority' => 9999,
101
            ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
102
            // Mentions légales
103
            'mentions-legales' => [
104
                'type'     => 'Literal',
105
                'options'  => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
106
                    'route'    => '/mentions-legales',
107
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
108
109
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'mentions-legales',
110
111
                    ],
                ],
112
                'priority' => 9999,
113
            ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
114
            // Informatique et libertés
115
            'il'               => [
116
                'type'     => 'Literal',
117
                'options'  => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
118
                    'route'    => '/informatique-et-libertes',
119
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
120
121
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'informatique-et-libertes',
122
123
                    ],
                ],
124
                'priority' => 9999,
125
            ],
126
            // Rafraîchissement de la session
127
            'refresh-session'  => [
128
                'type'    => 'Literal',
129
                'options' => [
130
                    'route'    => '/refresh-session',
131
                    'defaults' => [
132
133
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'refresh-session',
134
135
                    ],
                ],
136
            ],
137
138
139
140
141
142
143
144
145
146
147
            //            // Rendu du menu secondaire
            //            'menu-secondaire' => [
            //                'type'          => 'Literal',
            //                'options'       => [
            //                    'route'       => '/menu-secondaire',
            //                    'defaults'    => [
            //                        'controller' => 'UnicaenApp\Controller\Application',
            //                        'action'     => 'menu-secondaire',
            //                    ],
            //                ],
            //            ],
148
            // Test d'envoi de mail par l'appli
149
150
151
152
153
            'test-envoi-mail'  => [
                'type'    => 'Literal',
                'options' => [
                    'route'    => '/test-envoi-mail',
                    'defaults' => [
154
155
156
157
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'test-envoi-mail',
                    ],
                ],
158
            ],
159
160
161
162
163
            'maintenance'      => [
                'type'    => 'Literal',
                'options' => [
                    'route'    => '/maintenance',
                    'defaults' => [
164
165
166
167
168
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'maintenance',
                    ],
                ],
            ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
169
170
171
172
173
174
175
176
177
178
179
            // Icônes fournis
            'icons'          => [
                'type'     => 'Literal',
                'options'  => [
                    'route'    => '/icons',
                    'defaults' => [
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'icons',
                    ],
                ],
            ],
180
            'cache'            => [
181
                'type'          => 'Literal',
182
183
                'options'       => [
                    'route'    => '/cache',
184
185
186
187
188
189
                    'defaults' => [
                        'controller' => 'UnicaenApp\Controller\Cache',
                    ],
                ],
                'may_terminate' => false,
                'child_routes'  => [
190
                    'js'  => [
191
                        'type'          => 'Segment',
192
193
                        'options'       => [
                            'route'    => '/js[/:version]',
194
                            'defaults' => [
195
                                'action' => 'js',
196
197
198
199
200
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                    'css' => [
201
                        'type'          => 'Segment',
202
203
                        'options'       => [
                            'route'    => '/css[/:version]',
204
                            'defaults' => [
205
                                'action' => 'css',
206
207
208
209
210
211
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                ],
            ],
212
            'instadia'         => [
213
214
215
216
217
                'type'          => 'Literal',
                'options'       => [
                    'route'    => '/instadia',
                    'defaults' => [
                        '__NAMESPACE__' => 'UnicaenApp\Controller',
218
219
                        'controller'    => 'Instadia',
                        'action'        => 'index',
220
221
222
223
                    ],
                ],
                'may_terminate' => true,
            ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
224
225
226
227
            // The following is a route to simplify getting started creating
            // new controllers and actions without needing to create a new
            // module. Simply drop new controllers in, and you can access them
            // using the path /application/:controller/:action
228
            'application'      => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
229
                // The Literal route is for doing exact matching of the URI path
230
231
                'type'          => 'Literal',
                'options'       => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
232
                    'route'    => '/application',
233
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
234
235
236
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Index',
                        'action'        => 'index',
237
238
                    ],
                ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
239
240
241
                // Hints to the router that no other segments will follow it
                'may_terminate' => true,
                // Additional routes that stem from the base “route” (i.e., build from it)
242
243
                'child_routes'  => [
                    'default' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
244
245
                        // A Segment route allows matching any segment of a URI path
                        'type'    => 'Segment',
246
247
248
                        'options' => [
                            'route'       => '/[:controller[/:action]]',
                            'constraints' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
249
250
                                'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
251
252
                            ],
                            'defaults'    => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
253
//                                'action' => 'index',
254
255
256
257
258
259
260
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
261
262
    'console'         => [
        'router'       => [
263
            'routes' => [
264
                'run-sql-script' => [
265
                    'type'    => Simple::class,
266
                    'options' => [
267
                        'route'    => 'run-sql-script --path= [--logfile=] [--connection=]',
268
269
                        'defaults' => [
                            'controller' => ConsoleController::class,
270
                            'action'     => 'runSQLScript',
271
272
273
                        ],
                    ],
                ],
274
275
                'run-sql-query'  => [
                    'type'    => Simple::class,
276
277
278
279
280
281
282
283
                    'options' => [
                        'route'    => 'run-sql-query --sql= [--logfile=] [--connection=]',
                        'defaults' => [
                            'controller' => ConsoleController::class,
                            'action'     => 'runSQLQuery',
                        ],
                    ],
                ],
284
285
286
287
288
            ],
        ],
        'view_manager' => [
            'display_not_found_reason' => true,
            'display_exceptions'       => true,
289
        ],
290
    ],
291
292
293
294
    'service_manager' => [
        'factories'          => [
            'translator'                  => 'Zend\I18n\Translator\TranslatorServiceFactory',
            'navigation'                  => 'Zend\Navigation\Service\DefaultNavigationFactory',
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
            // service de gestion de la session
            'Zend\Session\SessionManager' => 'UnicaenApp\Session\SessionManagerFactory',
            // service d'accès aux options de config de ce module
            'unicaen-app_module_options'  => 'UnicaenApp\Options\ModuleOptionsFactory',
            // mapper d'accès aux individus de l'annuaire LDAP
            'ldap_people_mapper'          => 'UnicaenApp\Mapper\Ldap\PeopleFactory',
            // mapper d'accès aux groupes de l'annuaire LDAP
            'ldap_group_mapper'           => 'UnicaenApp\Mapper\Ldap\GroupFactory',
            // mapper d'accès aux structures de l'annuaire LDAP
            'ldap_structure_mapper'       => 'UnicaenApp\Mapper\Ldap\StructureFactory',
            // service de manipulation des individus de l'annuaire LDAP
            'ldap_people_service'         => 'UnicaenApp\Service\Ldap\PeopleFactory',
            // service de manipulation des groupes de l'annuaire LDAP
            'ldap_group_service'          => 'UnicaenApp\Service\Ldap\GroupFactory',
            // service de manipulation des structures de l'annuaire LDAP
            'ldap_structure_service'      => 'UnicaenApp\Service\Ldap\StructureFactory',
Laurent Lécluse's avatar
Laurent Lécluse committed
311
312
313
314

            // Gestion des CSV
            'ViewCsvRenderer'             => 'UnicaenApp\Mvc\Service\ViewCsvRendererFactory',
            'ViewCsvStrategy'             => 'UnicaenApp\Mvc\Service\ViewCsvStrategyFactory',
315

316
317
318
319
            // Gestion des exports XML
            'ViewXmlRenderer'             => 'UnicaenApp\Mvc\Service\ViewXmlRendererFactory',
            'ViewXmlStrategy'             => 'UnicaenApp\Mvc\Service\ViewXmlStrategyFactory',

320
            'MessageCollector' => 'UnicaenApp\Service\MessageCollectorFactory',
321

322
323
324
            'MessageConfig'     => 'UnicaenApp\Message\MessageConfigFactory',
            'MessageRepository' => 'UnicaenApp\Message\MessageRepositoryFactory',
            'MessageService'    => 'UnicaenApp\Message\MessageServiceFactory',
325
326
327
328
329
330
331
332
333
334
335

            'MouchardService'              => 'UnicaenApp\Mouchard\MouchardServiceFactory',
            'MouchardListenerErrorHandler' => 'UnicaenApp\Mouchard\MouchardListenerErrorHandlerFactory',
            'MouchardListenerException'    => 'UnicaenApp\Mouchard\MouchardListenerExceptionFactory',
            'MouchardListenerMessenger'    => 'UnicaenApp\Mouchard\MouchardListenerMessengerFactory',
            'MouchardFormaterHtml'         => 'UnicaenApp\Mouchard\MouchardFormaterHtmlFactory',
            'MouchardSenderMail'           => 'UnicaenApp\Mouchard\MouchardSenderMailFactory',
            'MouchardSenderException'      => 'UnicaenApp\Mouchard\MouchardSenderExceptionFactory',
            'MouchardCompleterHttp'        => 'UnicaenApp\Mouchard\MouchardCompleterHttpFactory',
            'MouchardCompleterMvc'         => 'UnicaenApp\Mouchard\MouchardCompleterMvcFactory',

336
337
338
339
            MailerService::class    => MailerServiceFactory::class,
            RunSQLService::class    => RunSQLServiceFactory::class,
            'instadia'              => InstadiaServiceFactory::class,
            HostLocalization::class => HostLocalizationFactory::class,
340
            RedirectResponse::class => RedirectResponseFactory::class,
341
        ],
342
        'shared'             => [
343
344
345
346
347
348
349
350
            'MouchardListenerErrorHandler' => false,
            'MouchardListenerException'    => false,
            'MouchardListenerMessenger'    => false,
            'MouchardFormaterHtml'         => false,
            'MouchardSenderMail'           => false,
            'MouchardSenderException'      => false,
            'MouchardCompleterHttp'        => false,
            'MouchardCompleterMvc'         => false,
351
352
        ],
        'invokables'         => [
353
        ],
354
        'abstract_factories' => [
355
//            'UnicaenApp\Service\Doctrine\MultipleDbAbstractFactory',
356
357
        ],
        'initializers'       => [
358
            ServiceLocatorAwareInitializer::class,
359
360
            'UnicaenApp\Service\EntityManagerAwareInitializer',
        ],
361
362
363
364
        'aliases'            => [
            'MailerService'    => MailerService::class,
            'HostLocalization' => HostLocalization::class,
        ],
365
366
367
    ],
    'form_elements'   => [
        'invokables'   => [
368
            'UploadForm' => 'UnicaenApp\Controller\Plugin\Upload\UploadForm',
369
370
        ],
        'initializers' => [
371
            'UnicaenApp\Service\EntityManagerAwareInitializer',
372
373
        ],
    ],
374
    'hydrators'       => [
375
376
377
378
        'initializers' => [
            'UnicaenApp\Service\EntityManagerAwareInitializer',
        ],
    ],
379
    'view_helpers'    => [
380
        'shared'       => [
381
382
            'formControlGroup' => false,
        ],
383
        'aliases'      => [
384
385
386
387
            'appInfos'          => AppInfos::class,
            'appLink'           => AppLink::class,
            'userProfileSelect' => UserProfileSelect::class,
            'Message'           => MessageHelper::class,
388
            'message'           => MessageHelper::class,
389
390
391
392
393
394
395
396
            'messenger'         => Messenger::class,
            'queryParams'       => QueryParams::class,
            'formControlGroup'  => FormControlGroup::class,
            'headLink'          => HeadLink::class,
            'headScript'        => HeadScript::class,
            'inlineScript'      => InlineScript::class,
            'instadia'          => InstadiaViewHelper::class,
            'messageCollector'  => MessageCollectorHelper::class,
397
            'uploader'          => UploaderHelper::class,
398
399
            'Uploader'          => UploaderHelper::class,
        ],
400
        'factories'    => [
401
402
403
404
405
406
407
408
409
410
411
412
413
            AppInfos::class               => AppInfosFactory::class,
            AppLink::class                => AppLinkFactory::class,
            UserProfileSelect::class      => UserProfileSelectFactory::class,
            MessageHelper::class          => MessageHelperFactory::class,
            Messenger::class              => MessengerFactory::class,
            QueryParams::class            => QueryParamsHelperFactory::class,
            FormControlGroup::class       => FormControlGroupFactory::class,
            HeadLink::class               => HeadLinkFactory::class,
            HeadScript::class             => HeadScriptFactory::class,
            InlineScript::class           => InlineScriptFactory::class,
            InstadiaViewHelper::class     => InstadiaViewHelperFactory::class,
            MessageCollectorHelper::class => MessageCollectorHelperFactory::class,
            UploaderHelper::class         => UploaderHelperFactory::class,
414
415
        ],
        'invokables'   => [
416
417
418
419
420
421
422
423
424
            'appConnection'             => 'UnicaenApp\View\Helper\AppConnection',
            'modalAjaxDialog'           => 'UnicaenApp\View\Helper\ModalAjaxDialog',
            'confirm'                   => 'UnicaenApp\View\Helper\ConfirmHelper',
            'toggleDetails'             => 'UnicaenApp\View\Helper\ToggleDetails',
            'multipageFormFieldset'     => 'UnicaenApp\Form\View\Helper\MultipageFormFieldset',
            'multipageFormNav'          => 'UnicaenApp\Form\View\Helper\MultipageFormNav',
            'multipageFormRow'          => 'UnicaenApp\Form\View\Helper\MultipageFormRow',
            'multipageFormRecap'        => 'UnicaenApp\Form\View\Helper\MultipageFormRecap',
            'formDate'                  => 'UnicaenApp\Form\View\Helper\FormDate',
425
            'formDateTime'              => Form\View\Helper\FormDateTime::class,
426
427
428
429
430
431
            'formDateInfSup'            => 'UnicaenApp\Form\View\Helper\FormDateInfSup',
            'formRowDateInfSup'         => 'UnicaenApp\Form\View\Helper\FormRowDateInfSup',
            'formSearchAndSelect'       => 'UnicaenApp\Form\View\Helper\FormSearchAndSelect',
            'formLdapPeople'            => 'UnicaenApp\Form\View\Helper\FormLdapPeople',
            'formErrors'                => 'UnicaenApp\Form\View\Helper\FormErrors',
            'form'                      => 'UnicaenApp\Form\View\Helper\Form',
432
433
434
            'formAdvancedMultiCheckbox' => 'UnicaenApp\Form\View\Helper\FormAdvancedMultiCheckbox',
            'historique'                => 'UnicaenApp\View\Helper\HistoriqueViewHelper',
            'tabajax'                   => 'UnicaenApp\View\Helper\TabAjax\TabAjaxViewHelper',
435
            'tag'                       => 'UnicaenApp\View\Helper\TagViewHelper',
436
437
        ],
        'initializers' => [
438
            'UnicaenApp\Service\EntityManagerAwareInitializer',
439
            ServiceLocatorAwareInitializer::class,
440
441
442
443
444
        ],
    ],
    'translator'      => [
        'translation_file_patterns' => [
            [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
445
                'type'     => 'phparray',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
446
                'base_dir' => __DIR__ . '/../language',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
447
                'pattern'  => '/%s/Zend_Captcha.php',
448
449
            ],
            [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
450
                'type'     => 'phparray',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
451
                'base_dir' => __DIR__ . '/../language',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
452
                'pattern'  => '/%s/Zend_Validate.php',
453
454
            ],
            [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
455
456
457
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
458
459
460
461
            ],
        ],
    ],
    'controllers'     => [
462
        'invokables'   => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
463
            'UnicaenApp\Controller\Application' => 'UnicaenApp\Controller\ApplicationController',
464
        ],
465
466
467
        'initializers' => [
            'UnicaenApp\Service\EntityManagerAwareInitializer',
        ],
468
469
        'factories'    => [
            'UnicaenApp\Controller\Cache'    => CacheControllerFactory::class,
470
            'UnicaenApp\Controller\Instadia' => InstadiaControllerFactory::class,
471
472
            ConsoleController::class         => ConsoleControllerFactory::class,
        ],
473
    ],
474

475
    'doctrine' => [
476
477
478
479
480
481
482
483
        'driver' => [
            'orm_app_driver' => [
                'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
                'cache' => 'array',
                'paths' => [
                    __DIR__ . '/../src/UnicaenApp/Entity/Db',
                ],
            ],
484
            'orm_default'    => [
485
486
487
488
489
490
                'class'   => 'Doctrine\ORM\Mapping\Driver\DriverChain',
                'drivers' => [
                    'UnicaenApp\Entity\Db' => 'orm_app_driver',
                ],
            ],
        ],
491
492
493
494
495
        'configuration' => [
            'orm_default' => [
                'string_functions' => [
                    'compriseEntre' => CompriseEntre::class,
                    'pasHistorise' => PasHistorise::class,
496
497
                    'replace' => Replace::class,
                    'chr' => Chr::class,
498
499
500
                ],
            ],
        ],
501
    ],
502

503
    'view_manager' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
504
        // RouteNotFoundStrategy configuration
505
        'display_not_found_reason' => false, // display 404 reason in template
Bertrand Gauthier's avatar
Bertrand Gauthier committed
506
507
        'not_found_template'       => 'error/404', // e.g. '404'
        // ExceptionStrategy configuration
508
        'display_exceptions'       => false,
Bertrand Gauthier's avatar
Bertrand Gauthier committed
509
510
511
512
513
        'exception_template'       => 'error/index',
        // Doctype with which to seed the Doctype helper
        'doctype'                  => 'HTML5',
        // TemplateMapResolver configuration
        // template/path pairs
514
515
516
517
518
519
520
521
522
523
        'template_map'             => [
            'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
            'error/404'     => __DIR__ . '/../view/error/404.phtml',
            'error/index'   => __DIR__ . '/../view/error/index.phtml',
            //            'unicaen-app/application/apropos'                  => __DIR__ . '/../view/application/apropos.phtml',
            //            'unicaen-app/application/contact'                  => __DIR__ . '/../view/application/contact.phtml',
            //            'unicaen-app/application/plan'                     => __DIR__ . '/../view/application/plan.phtml',
            //            'unicaen-app/application/mentions-legales'         => __DIR__ . '/../view/application/mentions-legales.phtml',
            //            'unicaen-app/application/informatique-et-libertes' => __DIR__ . '/../view/application/informatique-et-libertes.phtml',
        ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
524
        // TemplatePathStack configuration
525
        'template_path_stack'      => [
526
            __DIR__ . '/../view',
527
        ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
528
        // Layout template name
529
        'layout'                   => 'layout/layout', // e.g., 'layout/layout'
Bertrand Gauthier's avatar
Bertrand Gauthier committed
530
        // Additional strategies to attach
531
        'strategies'               => [
532
            'ViewJsonStrategy', // register JSON renderer strategy
Laurent Lécluse's avatar
Laurent Lécluse committed
533
            'ViewCsvStrategy', // register CSV renderer strategy
534
            //            'ViewXmlStrategy', // register XML renderer strategy
535
536
537
            //            'ViewFeedStrategy', // register Feed renderer strategy
        ],
    ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
538
    // All navigation-related configuration is collected in the 'navigation' key
539
    'navigation'   => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
540
        // The DefaultNavigationFactory we configured uses 'default' as the sitemap key
541
        'default' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
542
            // And finally, here is where we define our page hierarchy
543
544
545
546
547
548
549
            'home' => [
                'label' => _("Accueil"),
                'title' => _("Page d'accueil de l'application"),
                'route' => 'home',
                'order' => -100, // make sure home is the first page
                'pages' => [
                    'etab'                     => [
550
551
                        'label'    => _("Université de Caen Normandie"),
                        'title'    => _("Page d'accueil du site de l'Université de Caen Normandie"),
552
553
554
555
556
                        'uri'      => 'http://www.unicaen.fr/',
                        'class'    => 'ucbn',
                        'visible'  => false,
                        'footer'   => true, // propriété maison pour inclure cette page dans le menu de pied de page
                        'resource' => 'controller/UnicaenApp\Controller\Application:etab', // ACL (cf. module BjyAuthorize)
557
                        'order'    => 1000,
558
559
                    ],
                    'apropos'                  => [
560
561
562
                        'label'    => _("À propos"),
                        'title'    => _("À propos de cette application"),
                        'route'    => 'apropos',
563
                        'class'    => 'apropos',
564
565
566
567
                        'visible'  => false,
                        'footer'   => true, // propriété maison pour inclure cette page dans le menu de pied de page
                        'sitemap'  => true, // propriété maison pour inclure cette page dans le plan
                        'resource' => 'controller/UnicaenApp\Controller\Application:apropos',
568
                        'order'    => 1001,
569
570
                    ],
                    'contact'                  => [
571
572
573
                        'label'    => _("Contact"),
                        'title'    => _("Contact concernant l'application"),
                        'route'    => 'contact',
574
                        'class'    => 'contact',
575
576
577
578
                        'visible'  => false,
                        'footer'   => true, // propriété maison pour inclure cette page dans le menu de pied de page
                        'sitemap'  => true, // propriété maison pour inclure cette page dans le plan
                        'resource' => 'controller/UnicaenApp\Controller\Application:contact',
579
                        'order'    => 1002,
580
581
                    ],
                    'plan'                     => [
582
583
584
                        'label'    => _("Plan de navigation"),
                        'title'    => _("Plan de navigation au sein de l'application"),
                        'route'    => 'plan',
585
                        'class'    => 'plan',
586
587
588
589
                        'visible'  => false,
                        'footer'   => true, // propriété maison pour inclure cette page dans le menu de pied de page
                        'sitemap'  => true, // propriété maison pour inclure cette page dans le plan
                        'resource' => 'controller/UnicaenApp\Controller\Application:plan',
590
                        'order'    => 1003,
591
592
                    ],
                    'mentions-legales'         => [
593
594
                        'label'    => _("Mentions légales"),
                        'title'    => _("Mentions légales"),
595
                        'uri'      => 'http://www.unicaen.fr/acces-direct/mentions-legales/',
596
                        'class'    => 'ml',
597
598
599
600
                        'visible'  => false,
                        'footer'   => true, // propriété maison pour inclure cette page dans le menu de pied de page
                        'sitemap'  => true, // propriété maison pour inclure cette page dans le plan
                        'resource' => 'controller/UnicaenApp\Controller\Application:mentions-legales',
601
                        'order'    => 1004,
602
603
                    ],
                    'informatique-et-libertes' => [
604
605
606
                        'label'    => _("Vie privée"),
                        'title'    => _("Vie privée"),
                        'uri'      => 'http://www.unicaen.fr/vie-privee/',
607
                        'class'    => 'il',
608
609
610
611
                        'visible'  => false,
                        'footer'   => true, // propriété maison pour inclure cette page dans le menu de pied de page
                        'sitemap'  => true, // propriété maison pour inclure cette page dans le plan
                        'resource' => 'controller/UnicaenApp\Controller\Application:informatique-et-libertes',
612
                        'order'    => 1005,
613
614
615
616
617
                    ],
                ],
            ],
        ],
    ],
618

Bertrand Gauthier's avatar
Bertrand Gauthier committed
619
620
621
622
623
624
625
626
627
628
629
630
631
    /**
     * NB: Lors d'un `composer install` fait par une appli requérant le module "unicaen/app", le répertoire
     * `public/unicaen` de ce module doit être copié dans le répertoire "public/" de l'appli en question grâce
     * à la "post install command" suivante :
     *
     * "scripts": {
     *      "post-install-cmd": [
     *          "cp -r vendor/unicaen/app/public/unicaen public/"
     *      ]
     * }
     *
     * Les chemins ci-dessous sont donc relatifs au dossier racine de l'appli.
     */
632
    'public_files' => [
633
        'head_scripts'          => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
634
635
            '015_jquery'   => '/unicaen/app/vendor/jquery-3.6.0.min.js',
            '020_jqueryui' => '/unicaen/app/vendor/jquery-ui-1.12.1/jquery-ui.min.js',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
636
            '040_bootstrap' => '/unicaen/app/vendor/bootstrap-4.5.2/js/bootstrap.bundle.min.js',
637
        ],
638
639
        'inline_scripts'        => [
            '020_app'         => '/js/app.js',
640
641
            '030_util'        => '/unicaen/app/js/util.js',
            '040_unicaen'     => '/unicaen/app/js/unicaen.js',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
642
            '050_jquery_form' => '/unicaen/app/vendor/jquery.form.min.js' // pour l'uploader Unicaen uniquement!!,
643
        ],
644
        'stylesheets'           => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
645
646
647
            '010_jquery-ui'           => '/unicaen/app/vendor/jquery-ui-1.12.1/jquery-ui.min.css',
            '020_jquery-ui-structure' => '/unicaen/app/vendor/jquery-ui-1.12.1/jquery-ui.structure.min.css',
            '030_jquery-ui-theme'     => '/unicaen/app/vendor/jquery-ui-1.12.1/jquery-ui.theme.min.css',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
648
            '040_bootstrap'           => '/unicaen/app/vendor/bootstrap-4.5.2/css/bootstrap.min.css',
649
            '060_unicaen'             => '/unicaen/app/css/unicaen.css',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
650
            '065_unicaen-icon'        => '/unicaen/app/css/unicaen-icon.css',
651
            '070_app'                 => '/css/app.css',
652
        ],
653
        'printable_stylesheets' => [
654
        ],
655
        'cache_enabled'         => false,
656
    ],
657

658
    'bjyauthorize' => [
659
660
        'guards' => [
            'BjyAuthorize\Guard\Controller' => [
661
662
                [
                    'controller' => 'UnicaenApp\Controller\Application',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
663
                    'action'     => ['maintenance', 'icons'],
664
665
                    'roles'      => [],
                ],
666
667
                [
                    'controller' => 'UnicaenApp\Controller\Cache',
668
                    'action'     => ['js', 'css', 'printable-css'],
669
                    'roles'      => [],
670
                ],
671
672
673
674
675
                [
                    'controller' => 'UnicaenApp\Controller\Instadia',
                    'action'     => ['index'],
                    'roles'      => [],
                ],
676
677
            ],
        ],
678
    ],
679
];