module.config.php 21 KB
Newer Older
Bertrand Gauthier's avatar
Bertrand Gauthier committed
1
2
3
<?php
namespace UnicaenApp;

4
5
6
7
return [
    'asset_manager'   => [
        'resolver_configs' => [
            'paths' => [
8
                __DIR__ . '/../public',
9
10
11
12
13
            ],
        ],
    ],
    'router'          => [
        'routes' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
14
            // Base “route”, which describes the base match needed, the root of the tree
15
            'home'             => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
16
                // The Literal route is for doing exact matching of the URI path
17
18
                'type'    => 'Zend\Mvc\Router\Http\Literal',
                'options' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
19
                    'route'    => '/',
20
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
21
22
                        'controller' => 'Application\Controller\Index',
                        'action'     => 'index',
23
24
25
                    ],
                ],
            ],
26
            // A propos
27
28
29
            'apropos'          => [
                'type'     => 'Zend\Mvc\Router\Http\Literal',
                'options'  => [
30
                    'route'    => '/apropos',
31
                    'defaults' => [
32
33
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'apropos',
34
35
                    ],
                ],
36
                'priority' => 9999,
37
            ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
38
            // Contact
39
40
41
            'contact'          => [
                'type'     => 'Zend\Mvc\Router\Http\Literal',
                'options'  => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
42
                    'route'    => '/contact',
43
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
44
45
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'contact',
46
47
                    ],
                ],
48
                'priority' => 9999,
49
            ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
50
            // Plan de navigation
51
52
53
            'plan'             => [
                'type'     => 'Zend\Mvc\Router\Http\Literal',
                'options'  => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
54
                    'route'    => '/plan',
55
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
56
57
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'plan',
58
59
                    ],
                ],
60
                'priority' => 9999,
61
            ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
62
            // Mentions légales
63
64
65
            'mentions-legales' => [
                'type'     => 'Zend\Mvc\Router\Http\Literal',
                'options'  => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
66
                    'route'    => '/mentions-legales',
67
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
68
69
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'mentions-legales',
70
71
                    ],
                ],
72
                'priority' => 9999,
73
            ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
74
            // Informatique et libertés
75
76
77
            'il'               => [
                'type'     => 'Zend\Mvc\Router\Http\Literal',
                'options'  => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
78
                    'route'    => '/informatique-et-libertes',
79
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
80
81
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'informatique-et-libertes',
82
83
                    ],
                ],
84
                'priority' => 9999,
85
            ],
86
            // Rafraîchissement de la session
87
88
89
            'refresh-session'  => [
                'type'    => 'Zend\Mvc\Router\Http\Literal',
                'options' => [
90
                    'route'    => '/refresh-session',
91
                    'defaults' => [
92
93
                        'controller' => 'UnicaenApp\Controller\Application',
                        'action'     => 'refresh-session',
94
95
96
                    ],
                ],
            ],
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
            'cache' => [
                'type'    => 'Zend\Mvc\Router\Http\Literal',
                'options' => [
                    'route' => '/cache',
                    'defaults' => [
                        'controller' => 'UnicaenApp\Controller\Cache',
                    ],
                ],
                'may_terminate' => false,
                'child_routes'  => [
                    'js' => [
                        'type'    => 'Zend\Mvc\Router\Http\Segment',
                        'options' => [
                            'route' => '/js[/:version]',
                            'defaults' => [
                                'action' => 'js'
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                    'css' => [
                        'type'    => 'Zend\Mvc\Router\Http\Segment',
                        'options' => [
                            'route' => '/css[/:version]',
                            'defaults' => [
                                'action' => 'css'
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                ],
            ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
129
130
131
132
            // 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
133
            'application'      => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
134
                // The Literal route is for doing exact matching of the URI path
135
136
                'type'          => 'Literal',
                'options'       => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
137
                    'route'    => '/application',
138
                    'defaults' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
139
140
141
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Index',
                        'action'        => 'index',
142
143
                    ],
                ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
144
145
146
                // 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)
147
148
                'child_routes'  => [
                    'default' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
149
150
                        // A Segment route allows matching any segment of a URI path
                        'type'    => 'Segment',
151
152
153
                        'options' => [
                            'route'       => '/[:controller[/:action]]',
                            'constraints' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
154
155
                                'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
156
157
                            ],
                            'defaults'    => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
158
//                                'action' => 'index',
159
160
161
162
163
164
165
166
167
168
169
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
    'service_manager' => [
        'factories'          => [
            'translator'                  => 'Zend\I18n\Translator\TranslatorServiceFactory',
            'navigation'                  => 'Zend\Navigation\Service\DefaultNavigationFactory',
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
            // 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
186
187
188
189

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

191
            'MessageCollector'            => 'UnicaenApp\Service\MessageCollectorFactory',
192

193
194
195
196
197
198
            'MessageConfig'               => 'UnicaenApp\Message\MessageConfigFactory',
            'MessageRepository'           => 'UnicaenApp\Message\MessageRepositoryFactory',
            'MessageService'              => 'UnicaenApp\Message\MessageServiceFactory',
        ],
        'invokables'         => [
            'UnicaenApp\HistoriqueListener' => 'UnicaenApp\ORM\Event\Listeners\HistoriqueListener',
199
        ],
200
        'abstract_factories' => [
201
            'UnicaenApp\Service\Doctrine\MultipleDbAbstractFactory',
202
203
204
205
206
207
208
        ],
        'initializers'       => [
            'UnicaenApp\Service\EntityManagerAwareInitializer',
        ],
    ],
    'form_elements'   => [
        'invokables'   => [
209
            'UploadForm' => 'UnicaenApp\Controller\Plugin\Upload\UploadForm',
210
211
        ],
        'initializers' => [
212
            'UnicaenApp\Service\EntityManagerAwareInitializer',
213
214
        ],
    ],
215
216
217
218
219
    'hydrators' => [
        'initializers' => [
            'UnicaenApp\Service\EntityManagerAwareInitializer',
        ],
    ],
220
221
    'view_helpers'    => [
        'factories'    => [
222
223
224
225
            'appInfos'          => 'UnicaenApp\View\Helper\AppInfosFactory',
            'appLink'           => 'UnicaenApp\View\Helper\AppLinkFactory',
            'userProfileSelect' => 'UnicaenAuth\View\Helper\UserProfileSelectFactory',
            'Message'           => 'UnicaenApp\Message\View\Helper\MessageHelperFactory',
226
227
        ],
        'invokables'   => [
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
            'appConnection'         => 'UnicaenApp\View\Helper\AppConnection',
            'messenger'             => 'UnicaenApp\View\Helper\Messenger',
            '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',
            'formControlGroup'      => 'UnicaenApp\Form\View\Helper\FormControlGroup',
            'formDate'              => 'UnicaenApp\Form\View\Helper\FormDate',
            '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',
            'messageCollector'      => 'UnicaenApp\View\Helper\MessageCollectorHelper',
            /* Nouvelles aides de vue qui surchargent les anciennent pour exploiter des directives de configuration */
            'headScript'            => 'UnicaenApp\View\Helper\HeadScript',
            'inlineScript'          => 'UnicaenApp\View\Helper\InlineScript',
            'headLink'              => 'UnicaenApp\View\Helper\HeadLink',
249
250
251
252
            'Uploader'                  => 'UnicaenApp\View\Helper\Upload\UploaderHelper',
            'formAdvancedMultiCheckbox' => 'UnicaenApp\Form\View\Helper\FormAdvancedMultiCheckbox',
            'historique'                => 'UnicaenApp\View\Helper\HistoriqueViewHelper',
            'tabajax'                   => 'UnicaenApp\View\Helper\TabAjax\TabAjaxViewHelper',
253
            'tag'                       => 'UnicaenApp\View\Helper\TagViewHelper',
254
255
        ],
        'initializers' => [
256
            'UnicaenApp\Service\EntityManagerAwareInitializer',
257
258
259
260
261
        ],
    ],
    'translator'      => [
        'translation_file_patterns' => [
            [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
262
                'type'     => 'phparray',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
263
                'base_dir' => __DIR__ . '/../language',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
264
                'pattern'  => '/%s/Zend_Captcha.php',
265
266
            ],
            [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
267
                'type'     => 'phparray',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
268
                'base_dir' => __DIR__ . '/../language',
Bertrand Gauthier's avatar
Bertrand Gauthier committed
269
                'pattern'  => '/%s/Zend_Validate.php',
270
271
            ],
            [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
272
273
274
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
275
276
277
278
279
            ],
        ],
    ],
    'controllers'     => [
        'invokables' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
280
            'UnicaenApp\Controller\Application' => 'UnicaenApp\Controller\ApplicationController',
281
            'UnicaenApp\Controller\Cache'       => 'UnicaenApp\Controller\CacheController',
282
283
284
        ],
    ],
    'view_manager'    => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
285
        // RouteNotFoundStrategy configuration
286
        'display_not_found_reason' => false, // display 404 reason in template
Bertrand Gauthier's avatar
Bertrand Gauthier committed
287
288
        'not_found_template'       => 'error/404', // e.g. '404'
        // ExceptionStrategy configuration
289
        'display_exceptions'       => false,
Bertrand Gauthier's avatar
Bertrand Gauthier committed
290
291
292
293
294
        'exception_template'       => 'error/index',
        // Doctype with which to seed the Doctype helper
        'doctype'                  => 'HTML5',
        // TemplateMapResolver configuration
        // template/path pairs
295
296
297
298
299
300
301
302
303
304
        '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
305
        // TemplatePathStack configuration
306
        'template_path_stack'      => [
307
            __DIR__ . '/../view',
308
        ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
309
        // Layout template name
310
        'layout'                   => 'layout/layout', // e.g., 'layout/layout'
Bertrand Gauthier's avatar
Bertrand Gauthier committed
311
        // Additional strategies to attach
312
        'strategies'               => [
313
            'ViewJsonStrategy', // register JSON renderer strategy
Laurent Lécluse's avatar
Laurent Lécluse committed
314
            'ViewCsvStrategy', // register CSV renderer strategy
315
316
317
            //            'ViewFeedStrategy', // register Feed renderer strategy
        ],
    ],
Bertrand Gauthier's avatar
Bertrand Gauthier committed
318
    // All navigation-related configuration is collected in the 'navigation' key
319
    'navigation'      => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
320
        // The DefaultNavigationFactory we configured uses 'default' as the sitemap key
321
        'default' => [
Bertrand Gauthier's avatar
Bertrand Gauthier committed
322
            // And finally, here is where we define our page hierarchy
323
324
325
326
327
328
329
            'home' => [
                'label' => _("Accueil"),
                'title' => _("Page d'accueil de l'application"),
                'route' => 'home',
                'order' => -100, // make sure home is the first page
                'pages' => [
                    'etab'                     => [
330
331
                        'label'    => _("Université de Caen Normandie"),
                        'title'    => _("Page d'accueil du site de l'Université de Caen Normandie"),
332
333
334
335
336
                        '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)
337
                        'order'    => 1000,
338
339
                    ],
                    'apropos'                  => [
340
341
342
                        'label'    => _("À propos"),
                        'title'    => _("À propos de cette application"),
                        'route'    => 'apropos',
343
                        'class'    => 'apropos',
344
345
346
347
                        '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',
348
                        'order'    => 1001,
349
350
                    ],
                    'contact'                  => [
351
352
353
                        'label'    => _("Contact"),
                        'title'    => _("Contact concernant l'application"),
                        'route'    => 'contact',
354
                        'class'    => 'contact',
355
356
357
358
                        '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',
359
                        'order'    => 1002,
360
361
                    ],
                    'plan'                     => [
362
363
364
                        'label'    => _("Plan de navigation"),
                        'title'    => _("Plan de navigation au sein de l'application"),
                        'route'    => 'plan',
365
                        'class'    => 'plan',
366
367
368
369
                        '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',
370
                        'order'    => 1003,
371
372
                    ],
                    'mentions-legales'         => [
373
374
375
                        'label'    => _("Mentions légales"),
                        'title'    => _("Mentions légales"),
                        'uri'      => 'http://www.unicaen.fr/outils-portail-institutionnel/mentions-legales/',
376
                        'class'    => 'ml',
377
378
379
380
                        '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',
381
                        'order'    => 1004,
382
383
                    ],
                    'informatique-et-libertes' => [
384
385
386
                        'label'    => _("Informatique et libertés"),
                        'title'    => _("Informatique et libertés"),
                        'uri'      => 'http://www.unicaen.fr/outils-portail-institutionnel/informatique-et-libertes/',
387
                        'class'    => 'il',
388
389
390
391
                        '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',
392
                        'order'    => 1005,
393
394
395
396
397
                    ],
                ],
            ],
        ],
    ],
398
399
    'public_files' => [
        'head_scripts'  => [
400
401
            1 => 'https://gest.unicaen.fr/public/jquery-1.11.3.min.js',
	        2 => 'https://gest.unicaen.fr/public/jquery-ui-1.11.4/jquery-ui.min.js',
402
403
        ],
        'inline_scripts'  => [
404
	        1 => 'https://gest.unicaen.fr/public/bootstrap-3.3.5/js/bootstrap.min.js',
405
            2 => '/js/app.js',
406
407
            3 => '/js/util.js',
            4 => '/js/unicaen.js',
408
409
        ],
        'stylesheets' => [
410
411
412
413
414
            1 => 'https://gest.unicaen.fr/public/jquery-ui-1.11.4/jquery-ui.min.css',
    	    2 => 'https://gest.unicaen.fr/public/jquery-ui-1.11.4/jquery-ui.structure.min.css',
	        3 => 'https://gest.unicaen.fr/public/jquery-ui-1.11.4/jquery-ui.theme.min.css',
            4 => 'https://gest.unicaen.fr/public/bootstrap-3.3.5/css/bootstrap.min.css',
            5 => 'https://gest.unicaen.fr/public/bootstrap-3.3.5/css/bootstrap-theme.min.css',
415
416
            6 => '/css/unicaen.css',
            7 => '/css/app.css',
417
        ],
418
419
420
421
422
423
424
425
426
427
428
429
        'cache_enabled' => false,
    ],
    'bjyauthorize' => [
        'guards' => [
            'BjyAuthorize\Guard\Controller' => [
                [
                    'controller' => 'UnicaenApp\Controller\Cache',
                    'action' => ['js', 'css'],
                    'roles' => [],
                ],
            ],
        ],
430
    ],
431
];