1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Modules\Comments;
13
14 use Brickrouge\Element;
15 use Brickrouge\Form;
16 use Brickrouge\Text;
17
18 19 20
21 class EditBlock extends \Icybee\EditBlock
22 {
23 protected function lazy_get_children()
24 {
25 $values = $this->values;
26
27 return array
28 (
29 Comment::AUTHOR => new Text
30 (
31 array
32 (
33 Form::LABEL => 'Author',
34 Element::REQUIRED => true
35 )
36 ),
37
38 Comment::AUTHOR_EMAIL => new Text
39 (
40 array
41 (
42 Form::LABEL => 'E-mail',
43 Element::REQUIRED => true
44 )
45 ),
46
47 Comment::AUTHOR_URL => new Text
48 (
49 array
50 (
51 Form::LABEL => 'URL'
52 )
53 ),
54
55 Comment::AUTHOR_IP => new Text
56 (
57 array
58 (
59 Form::LABEL => 'Adresse IP',
60
61 'disabled' => true
62 )
63 ),
64
65 Comment::CONTENTS => new Element
66 (
67 'textarea', array
68 (
69 Form::LABEL => 'Message',
70 Element::REQUIRED => true,
71
72 'rows' => 10
73 )
74 ),
75
76 Comment::NOTIFY => new Element
77 (
78 Element::TYPE_RADIO_GROUP, array
79 (
80 Form::LABEL => 'Notification',
81 Element::DEFAULT_VALUE => 'no',
82 Element::REQUIRED => true,
83 Element::OPTIONS => array
84 (
85 'yes' => 'Bien sûr !',
86 'author' => "Seulement si c'est l'auteur du billet qui répond",
87 'no' => 'Pas la peine, je viens tous les jours',
88 'done' => 'Notification envoyée'
89 ),
90
91 Element::DESCRIPTION => (($values[Comment::NOTIFY] == 'done') ? "Un
92 message de notification a été envoyé." : null),
93
94 'class' => 'inputs-list'
95 )
96 ),
97
98 Comment::STATUS => new Element
99 (
100 'select', array
101 (
102 Form::LABEL => 'Status',
103 Element::REQUIRED => true,
104 Element::OPTIONS => array
105 (
106 null => '',
107 'pending' => 'Pending',
108 'approved' => 'Aprouvé',
109 'spam' => 'Spam'
110 )
111 )
112 )
113 );
114 }
115 }