GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Configuration::addFixtureReferenceSection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 11

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 15
rs 9.4285
cc 1
eloc 11
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the CCDNForum ForumBundle
5
 *include 'Configuration.php';
6
7
 * (c) CCDN (c) CodeConsortium <http://www.codeconsortium.com/>
8
 *
9
 * Available on github <http://www.github.com/codeconsortium/>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace CCDNForum\ForumBundle\DependencyInjection;
16
17
use Symfony\Component\Config\Definition\ConfigurationInterface;
18
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
19
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
20
21
/**
22
 * This is the class that validates and merges configuration from your app/config files
23
 *
24
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class }
25
 *
26
 * @category CCDNForum
27
 * @package  ForumBundle
28
 *
29
 * @author   Reece Fowell <[email protected]>
30
 * @license  http://opensource.org/licenses/MIT MIT
31
 * @version  Release: 2.0
32
 * @link     https://github.com/codeconsortium/CCDNForumForumBundle
33
 *
34
 */
35
class Configuration implements ConfigurationInterface
36
{
37
    /**
38
     *
39
     * @access protected
40
     * @var string $defaultValueLayoutTemplate
41
     */
42
    protected $defaultValueLayoutTemplate = 'CCDNForumForumBundle::base.html.twig';
0 ignored issues
show
Comprehensibility Naming introduced by
The variable name $defaultValueLayoutTemplate exceeds the maximum configured length of 20.

Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.

Loading history...
43
44
    /**
45
     *
46
     * @access protected
47
     * @var string $defaultValueFormTheme
48
     */
49
    protected $defaultValueFormTheme = 'form_div_layout.html.twig';
0 ignored issues
show
Comprehensibility Naming introduced by
The variable name $defaultValueFormTheme exceeds the maximum configured length of 20.

Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.

Loading history...
50
51
    /**
52
     *
53
     * @access protected
54
     * @var string $defaultValuePaginatorTheme
55
     */
56
    protected $defaultValuePaginatorTheme = null;
0 ignored issues
show
Comprehensibility Naming introduced by
The variable name $defaultValuePaginatorTheme exceeds the maximum configured length of 20.

Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.

Loading history...
57
58
    /**
59
     *
60
     * @access public
61
     * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder
62
     */
63
    public function getConfigTreeBuilder()
64
    {
65
        $treeBuilder = new TreeBuilder();
66
        $rootNode = $treeBuilder->root('ccdn_forum_forum');
67
68
        $rootNode
69
            ->children()
70
                ->arrayNode('template')
71
                    ->addDefaultsIfNotSet()
72
                    ->children()
73
                        ->scalarNode('engine')->defaultValue('twig')->end()
74
                        ->scalarNode('pager_theme')->defaultValue($this->defaultValuePaginatorTheme)->end()
75
                    ->end()
76
                ->end()
77
            ->end();
78
79
        // Class file namespaces.
80
        $this->addEntitySection($rootNode);
81
        $this->addGatewaySection($rootNode);
82
        $this->addRepositorySection($rootNode);
83
        $this->addManagerSection($rootNode);
84
        $this->addModelSection($rootNode);
85
        $this->addFormSection($rootNode);
86
        $this->addComponentSection($rootNode);
87
88
        // Configuration stuff.
89
        $this->addForumSection($rootNode);
90
        $this->addCategorySection($rootNode);
91
        $this->addBoardSection($rootNode);
92
        $this->addTopicSection($rootNode);
93
        $this->addPostSection($rootNode);
94
        $this->addItemPostSection($rootNode);
95
        $this->addSubscriptionSection($rootNode);
96
        $this->addFixtureReferenceSection($rootNode);
97
        $this->addSEOSection($rootNode);
98
99
        return $treeBuilder;
100
    }
101
102
    /**
103
     *
104
     * @access private
105
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
106
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
107
     */
108
    private function addEntitySection(ArrayNodeDefinition $node)
109
    {
110
        $node
111
            ->addDefaultsIfNotSet()
112
            ->children()
113
                ->arrayNode('entity')
114
                    ->addDefaultsIfNotSet()
115
                    ->canBeUnset()
116
                    ->children()
117
                        ->arrayNode('forum')
118
                            ->addDefaultsIfNotSet()
119
                            ->canBeUnset()
120
                            ->children()
121
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Entity\Forum')->end()
122
                            ->end()
123
                        ->end()
124
                        ->arrayNode('category')
125
                            ->addDefaultsIfNotSet()
126
                            ->canBeUnset()
127
                            ->children()
128
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Entity\Category')->end()
129
                            ->end()
130
                        ->end()
131
                        ->arrayNode('board')
132
                            ->addDefaultsIfNotSet()
133
                            ->canBeUnset()
134
                            ->children()
135
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Entity\Board')->end()
136
                            ->end()
137
                        ->end()
138
                        ->arrayNode('topic')
139
                            ->addDefaultsIfNotSet()
140
                            ->canBeUnset()
141
                            ->children()
142
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Entity\Topic')->end()
143
                            ->end()
144
                        ->end()
145
                        ->arrayNode('post')
146
                            ->addDefaultsIfNotSet()
147
                            ->canBeUnset()
148
                            ->children()
149
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Entity\Post')->end()
150
                            ->end()
151
                        ->end()
152
                        ->arrayNode('subscription')
153
                            ->addDefaultsIfNotSet()
154
                            ->canBeUnset()
155
                            ->children()
156
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Entity\Subscription')->end()
157
                            ->end()
158
                        ->end()
159
                        ->arrayNode('registry')
160
                            ->addDefaultsIfNotSet()
161
                            ->canBeUnset()
162
                            ->children()
163
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Entity\Registry')->end()
164
                            ->end()
165
                        ->end()
166
                    ->end()
167
                ->end()
168
            ->end()
169
        ;
170
171
        return $this;
172
    }
173
174
    /**
175
     *
176
     * @access private
177
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
178
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
179
     */
180
    private function addGatewaySection(ArrayNodeDefinition $node)
181
    {
182
        $node
183
            ->addDefaultsIfNotSet()
184
            ->children()
185
                ->arrayNode('gateway')
186
                    ->addDefaultsIfNotSet()
187
                    ->canBeUnset()
188
                    ->children()
189
                        ->arrayNode('forum')
190
                            ->addDefaultsIfNotSet()
191
                            ->canBeUnset()
192
                            ->children()
193
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Gateway\ForumGateway')->end()
194
                            ->end()
195
                        ->end()
196
                        ->arrayNode('category')
197
                            ->addDefaultsIfNotSet()
198
                            ->canBeUnset()
199
                            ->children()
200
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Gateway\CategoryGateway')->end()
201
                            ->end()
202
                        ->end()
203
                        ->arrayNode('board')
204
                            ->addDefaultsIfNotSet()
205
                            ->canBeUnset()
206
                            ->children()
207
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Gateway\BoardGateway')->end()
208
                            ->end()
209
                        ->end()
210
                        ->arrayNode('topic')
211
                            ->addDefaultsIfNotSet()
212
                            ->canBeUnset()
213
                            ->children()
214
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Gateway\TopicGateway')->end()
215
                            ->end()
216
                        ->end()
217
                        ->arrayNode('post')
218
                            ->addDefaultsIfNotSet()
219
                            ->canBeUnset()
220
                            ->children()
221
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Gateway\PostGateway')->end()
222
                            ->end()
223
                        ->end()
224
                        ->arrayNode('subscription')
225
                            ->addDefaultsIfNotSet()
226
                            ->canBeUnset()
227
                            ->children()
228
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Gateway\SubscriptionGateway')->end()
229
                            ->end()
230
                        ->end()
231
                        ->arrayNode('registry')
232
                            ->addDefaultsIfNotSet()
233
                            ->canBeUnset()
234
                            ->children()
235
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Gateway\RegistryGateway')->end()
236
                            ->end()
237
                        ->end()
238
                    ->end()
239
                ->end()
240
            ->end()
241
        ;
242
243
        return $this;
244
    }
245
246
    /**
247
     *
248
     * @access private
249
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
250
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
251
     */
252
    private function addRepositorySection(ArrayNodeDefinition $node)
253
    {
254
        $node
255
            ->addDefaultsIfNotSet()
256
            ->children()
257
                ->arrayNode('repository')
258
                    ->addDefaultsIfNotSet()
259
                    ->canBeUnset()
260
                    ->children()
261
                        ->arrayNode('forum')
262
                            ->addDefaultsIfNotSet()
263
                            ->canBeUnset()
264
                            ->children()
265
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Repository\ForumRepository')->end()
266
                            ->end()
267
                        ->end()
268
                        ->arrayNode('category')
269
                            ->addDefaultsIfNotSet()
270
                            ->canBeUnset()
271
                            ->children()
272
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Repository\CategoryRepository')->end()
273
                            ->end()
274
                        ->end()
275
                        ->arrayNode('board')
276
                            ->addDefaultsIfNotSet()
277
                            ->canBeUnset()
278
                            ->children()
279
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Repository\BoardRepository')->end()
280
                            ->end()
281
                        ->end()
282
                        ->arrayNode('topic')
283
                            ->addDefaultsIfNotSet()
284
                            ->canBeUnset()
285
                            ->children()
286
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Repository\TopicRepository')->end()
287
                            ->end()
288
                        ->end()
289
                        ->arrayNode('post')
290
                            ->addDefaultsIfNotSet()
291
                            ->canBeUnset()
292
                            ->children()
293
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Repository\PostRepository')->end()
294
                            ->end()
295
                        ->end()
296
                        ->arrayNode('subscription')
297
                            ->addDefaultsIfNotSet()
298
                            ->canBeUnset()
299
                            ->children()
300
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Repository\SubscriptionRepository')->end()
301
                            ->end()
302
                        ->end()
303
                        ->arrayNode('registry')
304
                            ->addDefaultsIfNotSet()
305
                            ->canBeUnset()
306
                            ->children()
307
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Repository\RegistryRepository')->end()
308
                            ->end()
309
                        ->end()
310
                    ->end()
311
                ->end()
312
            ->end()
313
        ;
314
315
        return $this;
316
    }
317
318
    /**
319
     *
320
     * @access private
321
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
322
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
323
     */
324
    private function addManagerSection(ArrayNodeDefinition $node)
325
    {
326
        $node
327
            ->addDefaultsIfNotSet()
328
            ->children()
329
                ->arrayNode('manager')
330
                    ->addDefaultsIfNotSet()
331
                    ->canBeUnset()
332
                    ->children()
333
                        ->arrayNode('forum')
334
                            ->addDefaultsIfNotSet()
335
                            ->canBeUnset()
336
                            ->children()
337
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Manager\ForumManager')->end()
338
                            ->end()
339
                        ->end()
340
                        ->arrayNode('category')
341
                            ->addDefaultsIfNotSet()
342
                            ->canBeUnset()
343
                            ->children()
344
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Manager\CategoryManager')->end()
345
                            ->end()
346
                        ->end()
347
                        ->arrayNode('board')
348
                            ->addDefaultsIfNotSet()
349
                            ->canBeUnset()
350
                            ->children()
351
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Manager\BoardManager')->end()
352
                            ->end()
353
                        ->end()
354
                        ->arrayNode('topic')
355
                            ->addDefaultsIfNotSet()
356
                            ->canBeUnset()
357
                            ->children()
358
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Manager\TopicManager')->end()
359
                            ->end()
360
                        ->end()
361
                        ->arrayNode('post')
362
                            ->addDefaultsIfNotSet()
363
                            ->canBeUnset()
364
                            ->children()
365
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Manager\PostManager')->end()
366
                            ->end()
367
                        ->end()
368
                        ->arrayNode('subscription')
369
                            ->addDefaultsIfNotSet()
370
                            ->canBeUnset()
371
                            ->children()
372
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Manager\SubscriptionManager')->end()
373
                            ->end()
374
                        ->end()
375
                        ->arrayNode('registry')
376
                            ->addDefaultsIfNotSet()
377
                            ->canBeUnset()
378
                            ->children()
379
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\Component\Manager\RegistryManager')->end()
380
                            ->end()
381
                        ->end()
382
                    ->end()
383
                ->end()
384
            ->end()
385
        ;
386
387
        return $this;
388
    }
389
390
    /**
391
     *
392
     * @access private
393
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
394
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
395
     */
396
    private function addModelSection(ArrayNodeDefinition $node)
397
    {
398
        $node
399
            ->addDefaultsIfNotSet()
400
            ->children()
401
                ->arrayNode('model')
402
                    ->addDefaultsIfNotSet()
403
                    ->canBeUnset()
404
                    ->children()
405
                        ->arrayNode('forum')
406
                            ->addDefaultsIfNotSet()
407
                            ->canBeUnset()
408
                            ->children()
409
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\FrontModel\ForumModel')->end()
410
                            ->end()
411
                        ->end()
412
                        ->arrayNode('category')
413
                            ->addDefaultsIfNotSet()
414
                            ->canBeUnset()
415
                            ->children()
416
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\FrontModel\CategoryModel')->end()
417
                            ->end()
418
                        ->end()
419
                        ->arrayNode('board')
420
                            ->addDefaultsIfNotSet()
421
                            ->canBeUnset()
422
                            ->children()
423
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\FrontModel\BoardModel')->end()
424
                            ->end()
425
                        ->end()
426
                        ->arrayNode('topic')
427
                            ->addDefaultsIfNotSet()
428
                            ->canBeUnset()
429
                            ->children()
430
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\FrontModel\TopicModel')->end()
431
                            ->end()
432
                        ->end()
433
                        ->arrayNode('post')
434
                            ->addDefaultsIfNotSet()
435
                            ->canBeUnset()
436
                            ->children()
437
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\FrontModel\PostModel')->end()
438
                            ->end()
439
                        ->end()
440
                        ->arrayNode('subscription')
441
                            ->addDefaultsIfNotSet()
442
                            ->canBeUnset()
443
                            ->children()
444
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\FrontModel\SubscriptionModel')->end()
445
                            ->end()
446
                        ->end()
447
                        ->arrayNode('registry')
448
                            ->addDefaultsIfNotSet()
449
                            ->canBeUnset()
450
                            ->children()
451
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Model\FrontModel\RegistryModel')->end()
452
                            ->end()
453
                        ->end()
454
                    ->end()
455
                ->end()
456
            ->end()
457
        ;
458
459
        return $this;
460
    }
461
462
    /**
463
     *
464
     * @access private
465
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
466
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
467
     */
468
    private function addFormSection(ArrayNodeDefinition $node)
469
    {
470
        $node
471
            ->addDefaultsIfNotSet()
472
            ->children()
473
                ->arrayNode('form')
474
                    ->addDefaultsIfNotSet()
475
                    ->canBeUnset()
476
                    ->children()
477
                        ->append($this->addFormHandlerSection())
478
                        ->append($this->addFormTypeSection())
479
                    ->end()
480
                ->end()
481
            ->end()
482
        ;
483
484
        return $this;
485
    }
486
487
    /**
488
     *
489
     * @access private
490
     * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
491
     */
492
    private function addFormHandlerSection()
493
    {
494
        $treeBuilder = new TreeBuilder();
495
        $node = $treeBuilder->root('handler');
496
497
        $node
498
            ->addDefaultsIfNotSet()
499
            ->canBeUnset()
500
            ->children()
501
                ->arrayNode('forum_create')
502
                    ->addDefaultsIfNotSet()
503
                    ->canBeUnset()
504
                    ->children()
505
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Admin\Forum\ForumCreateFormHandler')->end()
506
                    ->end()
507
                ->end()
508
                ->arrayNode('forum_update')
509
                    ->addDefaultsIfNotSet()
510
                    ->canBeUnset()
511
                    ->children()
512
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Admin\Forum\ForumUpdateFormHandler')->end()
513
                    ->end()
514
                ->end()
515
                ->arrayNode('forum_delete')
516
                    ->addDefaultsIfNotSet()
517
                    ->canBeUnset()
518
                    ->children()
519
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Admin\Forum\ForumDeleteFormHandler')->end()
520
                    ->end()
521
                ->end()
522
523
                ->arrayNode('category_create')
524
                    ->addDefaultsIfNotSet()
525
                    ->canBeUnset()
526
                    ->children()
527
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Admin\Category\CategoryCreateFormHandler')->end()
528
                    ->end()
529
                ->end()
530
                ->arrayNode('category_update')
531
                    ->addDefaultsIfNotSet()
532
                    ->canBeUnset()
533
                    ->children()
534
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Admin\Category\CategoryUpdateFormHandler')->end()
535
                    ->end()
536
                ->end()
537
                ->arrayNode('category_delete')
538
                    ->addDefaultsIfNotSet()
539
                    ->canBeUnset()
540
                    ->children()
541
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Admin\Category\CategoryDeleteFormHandler')->end()
542
                    ->end()
543
                ->end()
544
545
                ->arrayNode('board_create')
546
                    ->addDefaultsIfNotSet()
547
                    ->canBeUnset()
548
                    ->children()
549
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Admin\Board\BoardCreateFormHandler')->end()
550
                    ->end()
551
                ->end()
552
                ->arrayNode('board_update')
553
                    ->addDefaultsIfNotSet()
554
                    ->canBeUnset()
555
                    ->children()
556
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Admin\Board\BoardUpdateFormHandler')->end()
557
                    ->end()
558
                ->end()
559
                ->arrayNode('board_delete')
560
                    ->addDefaultsIfNotSet()
561
                    ->canBeUnset()
562
                    ->children()
563
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Admin\Board\BoardDeleteFormHandler')->end()
564
                    ->end()
565
                ->end()
566
567
                ->arrayNode('topic_create')
568
                    ->addDefaultsIfNotSet()
569
                    ->canBeUnset()
570
                    ->children()
571
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\User\Topic\TopicCreateFormHandler')->end()
572
                    ->end()
573
                ->end()
574
                ->arrayNode('topic_update')
575
                    ->addDefaultsIfNotSet()
576
                    ->canBeUnset()
577
                    ->children()
578
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\User\Topic\TopicUpdateFormHandler')->end()
579
                    ->end()
580
                ->end()
581
                ->arrayNode('topic_delete')
582
                    ->addDefaultsIfNotSet()
583
                    ->canBeUnset()
584
                    ->children()
585
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Moderator\Topic\TopicDeleteFormHandler')->end()
586
                    ->end()
587
                ->end()
588
589
                ->arrayNode('change_topics_board')
590
                    ->addDefaultsIfNotSet()
591
                    ->canBeUnset()
592
                    ->children()
593
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Moderator\Topic\TopicChangeBoardFormHandler')->end()
594
                    ->end()
595
                ->end()
596
597
                ->arrayNode('post_create')
598
                    ->addDefaultsIfNotSet()
599
                    ->canBeUnset()
600
                    ->children()
601
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\User\Post\PostCreateFormHandler')->end()
602
                    ->end()
603
                ->end()
604
                ->arrayNode('post_update')
605
                    ->addDefaultsIfNotSet()
606
                    ->canBeUnset()
607
                    ->children()
608
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\User\Post\PostUpdateFormHandler')->end()
609
                    ->end()
610
                ->end()
611
                ->arrayNode('post_delete')
612
                    ->addDefaultsIfNotSet()
613
                    ->canBeUnset()
614
                    ->children()
615
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\User\Post\PostDeleteFormHandler')->end()
616
                    ->end()
617
                ->end()
618
                ->arrayNode('post_unlock')
619
                    ->addDefaultsIfNotSet()
620
                    ->canBeUnset()
621
                    ->children()
622
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Handler\Moderator\Post\PostUnlockFormHandler')->end()
623
                    ->end()
624
                ->end()
625
            ->end()
626
        ;
627
628
        return $node;
629
    }
630
631
    /**
632
     *
633
     * @access private
634
     * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
635
     */
636
    private function addFormTypeSection()
637
    {
638
        $treeBuilder = new TreeBuilder();
639
        $node = $treeBuilder->root('type');
640
641
        $node
642
            ->addDefaultsIfNotSet()
643
            ->canBeUnset()
644
            ->children()
645
                ->arrayNode('forum_create')
646
                    ->addDefaultsIfNotSet()
647
                    ->canBeUnset()
648
                    ->children()
649
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Admin\Forum\ForumCreateFormType')->end()
650
                    ->end()
651
                ->end()
652
                ->arrayNode('forum_update')
653
                    ->addDefaultsIfNotSet()
654
                    ->canBeUnset()
655
                    ->children()
656
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Admin\Forum\ForumUpdateFormType')->end()
657
                    ->end()
658
                ->end()
659
                ->arrayNode('forum_delete')
660
                    ->addDefaultsIfNotSet()
661
                    ->canBeUnset()
662
                    ->children()
663
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Admin\Forum\ForumDeleteFormType')->end()
664
                    ->end()
665
                ->end()
666
667
                ->arrayNode('category_create')
668
                    ->addDefaultsIfNotSet()
669
                    ->canBeUnset()
670
                    ->children()
671
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Admin\Category\CategoryCreateFormType')->end()
672
                    ->end()
673
                ->end()
674
                ->arrayNode('category_update')
675
                    ->addDefaultsIfNotSet()
676
                    ->canBeUnset()
677
                    ->children()
678
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Admin\Category\CategoryUpdateFormType')->end()
679
                    ->end()
680
                ->end()
681
                ->arrayNode('category_delete')
682
                    ->addDefaultsIfNotSet()
683
                    ->canBeUnset()
684
                    ->children()
685
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Admin\Category\CategoryDeleteFormType')->end()
686
                    ->end()
687
                ->end()
688
689
                ->arrayNode('board_create')
690
                    ->addDefaultsIfNotSet()
691
                    ->canBeUnset()
692
                    ->children()
693
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Admin\Board\BoardCreateFormType')->end()
694
                    ->end()
695
                ->end()
696
                ->arrayNode('board_update')
697
                    ->addDefaultsIfNotSet()
698
                    ->canBeUnset()
699
                    ->children()
700
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Admin\Board\BoardUpdateFormType')->end()
701
                    ->end()
702
                ->end()
703
                ->arrayNode('board_delete')
704
                    ->addDefaultsIfNotSet()
705
                    ->canBeUnset()
706
                    ->children()
707
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Admin\Board\BoardDeleteFormType')->end()
708
                    ->end()
709
                ->end()
710
711
                ->arrayNode('topic_create')
712
                    ->addDefaultsIfNotSet()
713
                    ->canBeUnset()
714
                    ->children()
715
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\User\Topic\TopicCreateFormType')->end()
716
                    ->end()
717
                ->end()
718
                ->arrayNode('topic_update')
719
                    ->addDefaultsIfNotSet()
720
                    ->canBeUnset()
721
                    ->children()
722
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\User\Topic\TopicUpdateFormType')->end()
723
                    ->end()
724
                ->end()
725
                ->arrayNode('topic_delete')
726
                    ->addDefaultsIfNotSet()
727
                    ->canBeUnset()
728
                    ->children()
729
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Moderator\Topic\TopicDeleteFormType')->end()
730
                    ->end()
731
                ->end()
732
733
                ->arrayNode('change_topics_board')
734
                    ->addDefaultsIfNotSet()
735
                    ->canBeUnset()
736
                    ->children()
737
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Moderator\Topic\TopicChangeBoardFormType')->end()
738
                    ->end()
739
                ->end()
740
741
                ->arrayNode('post_create')
742
                    ->addDefaultsIfNotSet()
743
                    ->canBeUnset()
744
                    ->children()
745
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\User\Post\PostCreateFormType')->end()
746
                    ->end()
747
                ->end()
748
                ->arrayNode('post_update')
749
                    ->addDefaultsIfNotSet()
750
                    ->canBeUnset()
751
                    ->children()
752
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\User\Post\PostUpdateFormType')->end()
753
                    ->end()
754
                ->end()
755
                ->arrayNode('post_delete')
756
                    ->addDefaultsIfNotSet()
757
                    ->canBeUnset()
758
                    ->children()
759
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\User\Post\PostDeleteFormType')->end()
760
                    ->end()
761
                ->end()
762
                ->arrayNode('post_unlock')
763
                    ->addDefaultsIfNotSet()
764
                    ->canBeUnset()
765
                    ->children()
766
                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Form\Type\Moderator\Post\PostUnlockFormType')->end()
767
                    ->end()
768
                ->end()
769
            ->end()
770
        ;
771
772
        return $node;
773
    }
774
775
    /**
776
     *
777
     * @access private
778
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
779
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
780
     */
781
    private function addComponentSection(ArrayNodeDefinition $node)
782
    {
783
        $node
784
            ->addDefaultsIfNotSet()
785
            ->children()
786
                ->arrayNode('component')
787
                    ->addDefaultsIfNotSet()
788
                    ->canBeUnset()
789
                    ->children()
790
                        ->arrayNode('integrator')
791
                            ->addDefaultsIfNotSet()
792
                            ->canBeUnset()
793
                            ->children()
794
                                ->arrayNode('dashboard')
795
                                    ->addDefaultsIfNotSet()
796
                                    ->canBeUnset()
797
                                    ->children()
798
                                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\Integrator\DashboardIntegrator')->end()
799
                                    ->end()
800
                                ->end()
801
                            ->end()
802
                        ->end()
803
                        ->arrayNode('crumb_factory')
804
                            ->addDefaultsIfNotSet()
805
                            ->canBeUnset()
806
                            ->children()
807
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\Crumbs\Factory\CrumbFactory')->end()
808
                            ->end()
809
                        ->end()
810
                        ->arrayNode('crumb_builder')
811
                            ->addDefaultsIfNotSet()
812
                            ->canBeUnset()
813
                            ->children()
814
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\Crumbs\CrumbBuilder')->end()
815
                            ->end()
816
                        ->end()
817
818
                        ->arrayNode('security')
819
                            ->addDefaultsIfNotSet()
820
                            ->canBeUnset()
821
                            ->children()
822
                                ->arrayNode('authorizer')
823
                                    ->addDefaultsIfNotSet()
824
                                    ->canBeUnset()
825
                                    ->children()
826
                                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\Security\Authorizer')->end()
827
                                    ->end()
828
                                ->end()
829
                            ->end()
830
                        ->end()
831
                        ->arrayNode('helper')
832
                            ->addDefaultsIfNotSet()
833
                            ->canBeUnset()
834
                            ->children()
835
                                ->arrayNode('pagination_config')
836
                                    ->addDefaultsIfNotSet()
837
                                    ->canBeUnset()
838
                                    ->children()
839
                                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\Helper\PaginationConfigHelper')->end()
840
                                    ->end()
841
                                ->end()
842
                                ->arrayNode('post_lock')
843
                                    ->addDefaultsIfNotSet()
844
                                    ->canBeUnset()
845
                                    ->children()
846
                                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\Helper\PostLockHelper')->end()
847
                                    ->end()
848
                                ->end()
849
                                ->arrayNode('role')
850
                                    ->addDefaultsIfNotSet()
851
                                    ->canBeUnset()
852
                                    ->children()
853
                                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\Helper\RoleHelper')->end()
854
                                    ->end()
855
                                ->end()
856
                            ->end()
857
                        ->end()
858
                        ->arrayNode('flood_control')
859
                            ->addDefaultsIfNotSet()
860
                            ->canBeUnset()
861
                            ->children()
862
                                ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\FloodControl')->end()
863
                            ->end()
864
                        ->end()
865
866
                        ->arrayNode('twig_extension')
867
                            ->addDefaultsIfNotSet()
868
                            ->canBeUnset()
869
                            ->children()
870
                                ->arrayNode('board_list')
871
                                    ->addDefaultsIfNotSet()
872
                                    ->canBeUnset()
873
                                    ->children()
874
                                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\TwigExtension\BoardListExtension')->end()
875
                                    ->end()
876
                                ->end()
877
                                ->arrayNode('authorizer')
878
                                    ->addDefaultsIfNotSet()
879
                                    ->canBeUnset()
880
                                    ->children()
881
                                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\TwigExtension\AuthorizerExtension')->end()
882
                                    ->end()
883
                                ->end()
884
                                ->arrayNode('forum_global')
885
                                    ->addDefaultsIfNotSet()
886
                                    ->canBeUnset()
887
                                    ->children()
888
                                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\TwigExtension\ForumGlobalExtension')->end()
889
                                    ->end()
890
                                ->end()
891
                            ->end()
892
                        ->end()
893
894
                        ->arrayNode('event_listener')
895
                            ->addDefaultsIfNotSet()
896
                            ->canBeUnset()
897
                            ->children()
898
                                ->arrayNode('flash')
899
                                    ->addDefaultsIfNotSet()
900
                                    ->canBeUnset()
901
                                    ->children()
902
                                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\Dispatcher\Listener\FlashListener')->end()
903
                                    ->end()
904
                                ->end()
905
                                ->arrayNode('subscriber')
906
                                    ->addDefaultsIfNotSet()
907
                                    ->canBeUnset()
908
                                    ->children()
909
                                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\Dispatcher\Listener\SubscriberListener')->end()
910
                                    ->end()
911
                                ->end()
912
                                ->arrayNode('stats')
913
                                    ->addDefaultsIfNotSet()
914
                                    ->canBeUnset()
915
                                    ->children()
916
                                        ->scalarNode('class')->defaultValue('CCDNForum\ForumBundle\Component\Dispatcher\Listener\StatListener')->end()
917
                                    ->end()
918
                                ->end()
919
                            ->end()
920
                        ->end()
921
922
                    ->end()
923
                ->end()
924
            ->end()
925
        ;
926
927
        return $this;
928
    }
929
930
    /**
931
     *
932
     * @access private
933
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
934
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
935
     */
936
    private function addForumSection(ArrayNodeDefinition $node)
937
    {
938
        $node
939
            ->addDefaultsIfNotSet()
940
            ->children()
941
                ->arrayNode('forum')
942
                    ->addDefaultsIfNotSet()
943
                    ->children()
944
                        ->append($this->addForumAdminSection())
945
                    ->end()
946
                ->end()
947
            ->end()
948
        ;
949
950
        return $this;
951
    }
952
953
    /**
954
     *
955
     * @access private
956
     * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
957
     */
958
    private function addForumAdminSection()
959
    {
960
        $treeBuilder = new TreeBuilder();
961
        $node = $treeBuilder->root('admin');
962
963
        $node
964
            ->addDefaultsIfNotSet()
965
            ->canBeUnset()
966
            ->children()
967
                ->arrayNode('create')
968
                    ->addDefaultsIfNotSet()
969
                    ->children()
970
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
971
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
972
                    ->end()
973
                ->end()
974
                ->arrayNode('delete')
975
                    ->addDefaultsIfNotSet()
976
                    ->children()
977
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
978
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
979
                    ->end()
980
                ->end()
981
                ->arrayNode('edit')
982
                    ->addDefaultsIfNotSet()
983
                    ->children()
984
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
985
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
986
                    ->end()
987
                ->end()
988
                ->arrayNode('list')
989
                    ->addDefaultsIfNotSet()
990
                    ->children()
991
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
992
                    ->end()
993
                ->end()
994
            ->end()
995
        ;
996
997
        return $node;
998
    }
999
1000
    /**
1001
     *
1002
     * @access private
1003
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
1004
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
1005
     */
1006
    private function addCategorySection(ArrayNodeDefinition $node)
1007
    {
1008
        $node
1009
            ->addDefaultsIfNotSet()
1010
            ->children()
1011
                ->arrayNode('category')
1012
                    ->addDefaultsIfNotSet()
1013
                    ->canBeUnset()
1014
                    ->children()
1015
                        ->append($this->addCategoryAdminSection())
1016
                        ->append($this->addCategoryUserSection())
1017
                    ->end()
1018
                ->end()
1019
            ->end()
1020
        ;
1021
1022
        return $this;
1023
    }
1024
1025
    /**
1026
     *
1027
     * @access private
1028
     * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
1029
     */
1030
    private function addCategoryAdminSection()
1031
    {
1032
        $treeBuilder = new TreeBuilder();
1033
        $node = $treeBuilder->root('admin');
1034
1035
        $node
1036
            ->addDefaultsIfNotSet()
1037
            ->canBeUnset()
1038
            ->children()
1039
                ->arrayNode('create')
1040
                    ->addDefaultsIfNotSet()
1041
                    ->children()
1042
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1043
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1044
                    ->end()
1045
                ->end()
1046
                ->arrayNode('delete')
1047
                    ->addDefaultsIfNotSet()
1048
                    ->children()
1049
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1050
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1051
                    ->end()
1052
                ->end()
1053
                ->arrayNode('edit')
1054
                    ->addDefaultsIfNotSet()
1055
                    ->children()
1056
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1057
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1058
                    ->end()
1059
                ->end()
1060
                ->arrayNode('list')
1061
                    ->addDefaultsIfNotSet()
1062
                    ->children()
1063
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1064
                    ->end()
1065
                ->end()
1066
            ->end()
1067
        ;
1068
1069
        return $node;
1070
    }
1071
1072
    /**
1073
     *
1074
     * @access private
1075
     * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
1076
     */
1077
    private function addCategoryUserSection()
1078
    {
1079
        $treeBuilder = new TreeBuilder();
1080
        $node = $treeBuilder->root('user');
1081
1082
        $node
1083
            ->addDefaultsIfNotSet()
1084
            ->canBeUnset()
1085
            ->children()
1086
                ->scalarNode('last_post_datetime_format')->defaultValue('d-m-Y - H:i')->end()
1087
                ->arrayNode('index')
1088
                    ->addDefaultsIfNotSet()
1089
                    ->children()
1090
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1091
                    ->end()
1092
                ->end()
1093
                ->arrayNode('show')
1094
                    ->addDefaultsIfNotSet()
1095
                    ->children()
1096
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1097
                    ->end()
1098
                ->end()
1099
            ->end()
1100
        ;
1101
1102
        return $node;
1103
    }
1104
1105
    /**
1106
     *
1107
     * @access private
1108
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
1109
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
1110
     */
1111
    private function addBoardSection(ArrayNodeDefinition $node)
1112
    {
1113
        $node
1114
            ->addDefaultsIfNotSet()
1115
            ->children()
1116
                ->arrayNode('board')
1117
                    ->addDefaultsIfNotSet()
1118
                    ->canBeUnset()
1119
                    ->children()
1120
                        ->append($this->addBoardAdminSection())
1121
                        ->append($this->addBoardUserSection())
1122
                    ->end()
1123
                ->end()
1124
            ->end()
1125
        ;
1126
1127
        return $this;
1128
    }
1129
1130
    /**
1131
     *
1132
     * @access private
1133
     * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
1134
     */
1135
    private function addBoardAdminSection()
1136
    {
1137
        $treeBuilder = new TreeBuilder();
1138
        $node = $treeBuilder->root('admin');
1139
1140
        $node
1141
            ->addDefaultsIfNotSet()
1142
            ->canBeUnset()
1143
            ->children()
1144
                ->arrayNode('create')
1145
                    ->addDefaultsIfNotSet()
1146
                    ->children()
1147
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1148
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1149
                    ->end()
1150
                ->end()
1151
                ->arrayNode('delete')
1152
                    ->addDefaultsIfNotSet()
1153
                    ->children()
1154
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1155
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1156
                    ->end()
1157
                ->end()
1158
                ->arrayNode('edit')
1159
                    ->addDefaultsIfNotSet()
1160
                    ->children()
1161
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1162
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1163
                    ->end()
1164
                ->end()
1165
                ->arrayNode('list')
1166
                    ->addDefaultsIfNotSet()
1167
                    ->children()
1168
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1169
                    ->end()
1170
                ->end()
1171
            ->end()
1172
        ;
1173
1174
        return $node;
1175
    }
1176
1177
    /**
1178
     *
1179
     * @access private
1180
     * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
1181
     */
1182
    private function addBoardUserSection()
1183
    {
1184
        $treeBuilder = new TreeBuilder();
1185
        $node = $treeBuilder->root('user');
1186
1187
        $node
1188
            ->addDefaultsIfNotSet()
1189
            ->canBeUnset()
1190
            ->children()
1191
                ->arrayNode('show')
1192
                    ->addDefaultsIfNotSet()
1193
                    ->children()
1194
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1195
                        ->scalarNode('topics_per_page')->defaultValue('50')->end()
1196
                        ->scalarNode('topic_title_truncate')->defaultValue('50')->end()
1197
                        ->scalarNode('first_post_datetime_format')->defaultValue('d-m-Y - H:i')->end()
1198
                        ->scalarNode('last_post_datetime_format')->defaultValue('d-m-Y - H:i')->end()
1199
                    ->end()
1200
                ->end()
1201
            ->end()
1202
        ;
1203
1204
        return $node;
1205
    }
1206
1207
    /**
1208
     *
1209
     * @access private
1210
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
1211
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
1212
     */
1213
    private function addTopicSection(ArrayNodeDefinition $node)
1214
    {
1215
        $node
1216
            ->addDefaultsIfNotSet()
1217
            ->children()
1218
                ->arrayNode('topic')
1219
                    ->addDefaultsIfNotSet()
1220
                    ->canBeUnset()
1221
                    ->children()
1222
                        ->append($this->addTopicModeratorSection())
1223
                        ->append($this->addTopicUserSection())
1224
                    ->end()
1225
                ->end()
1226
            ->end()
1227
        ;
1228
1229
        return $this;
1230
    }
1231
1232
    /**
1233
     *
1234
     * @access private
1235
     * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
1236
     */
1237
    private function addTopicModeratorSection()
1238
    {
1239
        $treeBuilder = new TreeBuilder();
1240
        $node = $treeBuilder->root('moderator');
1241
1242
        $node
1243
            ->addDefaultsIfNotSet()
1244
            ->canBeUnset()
1245
            ->children()
1246
                ->arrayNode('change_board')
1247
                    ->addDefaultsIfNotSet()
1248
                    ->children()
1249
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1250
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1251
                    ->end()
1252
                ->end()
1253
                ->arrayNode('delete')
1254
                    ->addDefaultsIfNotSet()
1255
                    ->children()
1256
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1257
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1258
                    ->end()
1259
                ->end()
1260
            ->end()
1261
        ;
1262
1263
        return $node;
1264
    }
1265
1266
    /**
1267
     *
1268
     * @access private
1269
     * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
1270
     */
1271
    private function addTopicUserSection()
1272
    {
1273
        $treeBuilder = new TreeBuilder();
1274
        $node = $treeBuilder->root('user');
1275
1276
        $node
1277
            ->addDefaultsIfNotSet()
1278
            ->canBeUnset()
1279
            ->children()
1280
                ->arrayNode('flood_control')
1281
                    ->addDefaultsIfNotSet()
1282
                    ->children()
1283
                        ->scalarNode('post_limit')->defaultValue(4)->end()
1284
                        ->scalarNode('block_for_minutes')->defaultValue(1)->end()
1285
                    ->end()
1286
                ->end()
1287
                ->arrayNode('show')
1288
                    ->addDefaultsIfNotSet()
1289
                    ->children()
1290
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1291
                        ->scalarNode('posts_per_page')->defaultValue('20')->end()
1292
                        ->scalarNode('closed_datetime_format')->defaultValue('d-m-Y - H:i')->end()
1293
                        ->scalarNode('deleted_datetime_format')->defaultValue('d-m-Y - H:i')->end()
1294
                    ->end()
1295
                ->end()
1296
                ->arrayNode('create')
1297
                    ->addDefaultsIfNotSet()
1298
                    ->children()
1299
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1300
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1301
                    ->end()
1302
                ->end()
1303
                ->arrayNode('reply')
1304
                    ->addDefaultsIfNotSet()
1305
                    ->children()
1306
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1307
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1308
                    ->end()
1309
                ->end()
1310
            ->end()
1311
        ;
1312
1313
        return $node;
1314
    }
1315
1316
    /**
1317
     *
1318
     * @access private
1319
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
1320
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
1321
     */
1322
    private function addPostSection(ArrayNodeDefinition $node)
1323
    {
1324
        $node
1325
            ->addDefaultsIfNotSet()
1326
            ->children()
1327
                ->arrayNode('post')
1328
                    ->addDefaultsIfNotSet()
1329
                    ->canBeUnset()
1330
                    ->children()
1331
                        ->append($this->addPostModeratorSection())
1332
                        ->append($this->addPostUserSection())
1333
                    ->end()
1334
                ->end()
1335
            ->end()
1336
        ;
1337
1338
        return $this;
1339
    }
1340
1341
    /**
1342
     *
1343
     * @access private
1344
     * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
1345
     */
1346
    private function addPostModeratorSection()
1347
    {
1348
        $treeBuilder = new TreeBuilder();
1349
        $node = $treeBuilder->root('moderator');
1350
1351
        $node
1352
            ->addDefaultsIfNotSet()
1353
            ->canBeUnset()
1354
            ->children()
1355
                ->arrayNode('unlock')
1356
                    ->addDefaultsIfNotSet()
1357
                    ->children()
1358
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1359
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1360
                    ->end()
1361
                ->end()
1362
            ->end()
1363
        ;
1364
1365
        return $node;
1366
    }
1367
1368
    /**
1369
     *
1370
     * @access private
1371
     * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition
1372
     */
1373
    private function addPostUserSection()
1374
    {
1375
        $treeBuilder = new TreeBuilder();
1376
        $node = $treeBuilder->root('user');
1377
1378
        $node
1379
            ->addDefaultsIfNotSet()
1380
            ->canBeUnset()
1381
            ->children()
1382
                ->arrayNode('show')
1383
                    ->addDefaultsIfNotSet()
1384
                    ->children()
1385
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1386
                    ->end()
1387
                ->end()
1388
                ->arrayNode('edit')
1389
                    ->addDefaultsIfNotSet()
1390
                    ->children()
1391
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1392
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1393
                    ->end()
1394
                ->end()
1395
                ->arrayNode('delete')
1396
                    ->addDefaultsIfNotSet()
1397
                    ->children()
1398
                        ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1399
                        ->scalarNode('form_theme')->defaultValue($this->defaultValueFormTheme)->end()
1400
                    ->end()
1401
                ->end()
1402
                ->arrayNode('lock')
1403
                    ->addDefaultsIfNotSet()
1404
                    ->children()
1405
                        ->booleanNode('enable')->defaultTrue()->end()
1406
                        ->scalarNode('after_days')->defaultValue('7')->end()
1407
                    ->end()
1408
                ->end()
1409
            ->end()
1410
        ;
1411
1412
        return $node;
1413
    }
1414
1415
    /**
1416
     *
1417
     * @access private
1418
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
1419
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
1420
     */
1421
    private function addItemPostSection(ArrayNodeDefinition $node)
1422
    {
1423
        $node
1424
            ->addDefaultsIfNotSet()
1425
            ->children()
1426
                ->arrayNode('item_post')
1427
                    ->addDefaultsIfNotSet()
1428
                    ->canBeUnset()
1429
                    ->children()
1430
                        ->scalarNode('created_datetime_format')->defaultValue('d-m-Y - H:i')->end()
1431
                        ->scalarNode('edited_datetime_format')->defaultValue('d-m-Y - H:i')->end()
1432
                        ->scalarNode('locked_datetime_format')->defaultValue('d-m-Y - H:i')->end()
1433
                        ->scalarNode('deleted_datetime_format')->defaultValue('d-m-Y - H:i')->end()
1434
                    ->end()
1435
                ->end()
1436
            ->end()
1437
        ;
1438
1439
        return $this;
1440
    }
1441
1442
    /**
1443
     *
1444
     * @access private
1445
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
1446
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
1447
     */
1448
    private function addSubscriptionSection(ArrayNodeDefinition $node)
1449
    {
1450
        $node
1451
            ->addDefaultsIfNotSet()
1452
            ->children()
1453
                ->arrayNode('subscription')
1454
                    ->addDefaultsIfNotSet()
1455
                    ->canBeUnset()
1456
                    ->children()
1457
                        ->arrayNode('list')
1458
                            ->addDefaultsIfNotSet()
1459
                            ->children()
1460
                                ->scalarNode('layout_template')->defaultValue($this->defaultValueLayoutTemplate)->end()
1461
                                ->scalarNode('topics_per_page')->defaultValue('50')->end()
1462
                                ->scalarNode('topic_title_truncate')->defaultValue('50')->end()
1463
                                ->scalarNode('first_post_datetime_format')->defaultValue('d-m-Y - H:i')->end()
1464
                                ->scalarNode('last_post_datetime_format')->defaultValue('d-m-Y - H:i')->end()
1465
                            ->end()
1466
                        ->end()
1467
                    ->end()
1468
                ->end()
1469
            ->end()
1470
        ;
1471
1472
        return $this;
1473
    }
1474
1475
    /**
1476
     *
1477
     * @access protected
1478
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
1479
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
1480
     */
1481
    protected function addFixtureReferenceSection(ArrayNodeDefinition $node)
1482
    {
1483
        $node
1484
            ->addDefaultsIfNotSet()
1485
            ->children()
1486
                ->arrayNode('fixtures')
1487
                    ->addDefaultsIfNotSet()
1488
                    ->children()
1489
                    ->scalarNode('user_admin')->defaultValue('user-admin')->end()
1490
                ->end()
1491
            ->end()
1492
        ;
1493
1494
        return $this;
1495
    }
1496
1497
    /**
1498
     *
1499
     * @access protected
1500
     * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
1501
     * @return \CCDNForum\ForumBundle\DependencyInjection\Configuration
1502
     */
1503
    protected function addSEOSection(ArrayNodeDefinition $node)
1504
    {
1505
        $node
1506
            ->addDefaultsIfNotSet()
1507
            ->children()
1508
                ->arrayNode('seo')
1509
                    ->addDefaultsIfNotSet()
1510
                    ->canBeUnset()
1511
                    ->children()
1512
                        ->scalarNode('title_length')->defaultValue('67')->end()
1513
                    ->end()
1514
                ->end()
1515
            ->end()
1516
        ;
1517
1518
        return $this;
1519
    }
1520
}
1521