This repository was archived by the owner on Nov 3, 2023. It is now read-only.
File tree 5 files changed +24
-34
lines changed
5 files changed +24
-34
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ Contao Open Source CMS changelog
4
4
Version 3.4.0-beta1 (2014-10-XX)
5
5
--------------------------------
6
6
7
+ ### Improved
8
+ Show a message if logging in is required to comment (see #7031 ).
9
+
7
10
### New
8
11
Added the "sendNewsletter" hook (see #7222 ).
9
12
Original file line number Diff line number Diff line change @@ -192,6 +192,8 @@ protected function renderCommentForm(\FrontendTemplate $objTemplate, \stdClass $
192
192
if ($ objConfig ->requireLogin && !BE_USER_LOGGED_IN && !FE_USER_LOGGED_IN )
193
193
{
194
194
$ objTemplate ->requireLogin = true ;
195
+ $ objTemplate ->login = $ GLOBALS ['TL_LANG ' ]['MSC ' ]['com_login ' ];
196
+
195
197
return ;
196
198
}
197
199
Original file line number Diff line number Diff line change 20
20
<trans-unit id =" MSC.com_submit" >
21
21
<source >Submit comment</source >
22
22
</trans-unit >
23
+ <trans-unit id =" MSC.com_login" >
24
+ <source >You need to be logged in to add comments.</source >
25
+ </trans-unit >
23
26
<trans-unit id =" MSC.com_by" >
24
27
<source >Comment by</source >
25
28
</trans-unit >
Original file line number Diff line number Diff line change 1
- <?php if (!$this->requireLogin): ?>
2
-
3
- <!-- indexer::stop -->
4
- <div class="form">
5
1
2
+ <!-- indexer::stop -->
3
+ <div class="form">
4
+ <?php if ($this->requireLogin): ?>
5
+ <p class="info"><?php echo $this->login; ?></p>
6
+ <?php else: ?>
6
7
<?php if ($this->confirm): ?>
7
8
<p class="confirm"><?php echo $this->confirm; ?></p>
8
9
<?php elseif ($this->allowComments): ?>
9
10
<form<?php if ($this->action): ?> action="<?php echo $this->action; ?>"<?php endif; ?> id="<?php echo $this->formId; ?>" method="post">
10
11
<div class="formbody">
11
12
<input type="hidden" name="FORM_SUBMIT" value="<?php echo $this->formId; ?>">
12
13
<input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}">
13
-
14
14
<div class="widget">
15
15
<?php echo $this->fields['name']->generateWithError(); ?> <?php echo $this->fields['name']->generateLabel(); ?>
16
16
</div>
17
-
18
17
<div class="widget">
19
18
<?php echo $this->fields['email']->generateWithError(); ?> <?php echo $this->fields['email']->generateLabel(); ?>
20
19
</div>
21
-
22
20
<div class="widget">
23
21
<?php echo $this->fields['website']->generateWithError(); ?> <?php echo $this->fields['website']->generateLabel(); ?>
24
22
</div>
25
-
26
23
<?php if (isset($this->fields['captcha'])): ?>
27
24
<div class="widget">
28
25
<?php echo $this->fields['captcha']->generateWithError(); ?> <label for="ctrl_captcha"><?php echo $this->fields['captcha']->generateQuestion(); ?><span class="mandatory">*</span></label>
29
26
</div>
30
27
<?php endif; ?>
31
-
32
28
<div class="widget">
33
29
<?php echo $this->fields['comment']->generateWithError(); ?> <label for="ctrl_<?php echo $this->fields['comment']->id; ?>" class="invisible"><?php echo $this->fields['comment']->label; ?></label>
34
30
</div>
35
-
36
31
<div class="widget">
37
32
<?php echo $this->fields['notify']->generateWithError(); ?>
38
33
</div>
39
-
40
34
<div class="submit_container">
41
35
<input type="submit" class="submit" value="<?php echo $this->submit; ?>">
42
36
</div>
43
-
44
37
</div>
45
38
</form>
46
39
<?php endif; ?>
47
-
48
- </div>
49
- <!-- indexer::continue -->
50
-
51
- <?php endif; ?>
40
+ <?php endif; ?>
41
+ </div>
42
+ <!-- indexer::continue -->
Original file line number Diff line number Diff line change 1
- < ?php if (!$this-> requireLogin): ?>
2
-
3
- <!-- indexer::stop -->
4
- < div class ="form ">
5
1
2
+ <!-- indexer::stop -->
3
+ < div class ="form ">
4
+ < ?php if ($this-> requireLogin): ?>
5
+ < p class ="info "> < ?php echo $this-> login; ?> </ p >
6
+ < ?php else: ?>
6
7
< ?php if ($this-> confirm): ?>
7
8
< p class ="confirm "> < ?php echo $this-> confirm; ?> </ p >
8
9
< ?php elseif ($this-> allowComments): ?>
9
10
< form action ="<?php echo $this->action; ?> " id ="<?php echo $this->formId; ?> " method ="post ">
10
11
< div class ="formbody ">
11
12
< input type ="hidden " name ="FORM_SUBMIT " value ="<?php echo $this->formId; ?> " />
12
13
< input type ="hidden " name ="REQUEST_TOKEN " value ="{{request_token}} " />
13
-
14
14
< div class ="widget ">
15
15
< ?php echo $this-> fields['name']-> generateWithError(); ?> < ?php echo $this-> fields['name']-> generateLabel(); ?>
16
16
</ div >
17
-
18
17
< div class ="widget ">
19
18
< ?php echo $this-> fields['email']-> generateWithError(); ?> < ?php echo $this-> fields['email']-> generateLabel(); ?>
20
19
</ div >
21
-
22
20
< div class ="widget ">
23
21
< ?php echo $this-> fields['website']-> generateWithError(); ?> < ?php echo $this-> fields['website']-> generateLabel(); ?>
24
22
</ div >
25
-
26
23
< ?php if (isset($this-> fields['captcha'])): ?>
27
24
< div class ="widget ">
28
25
< ?php echo $this-> fields['captcha']-> generateWithError(); ?> < label for ="ctrl_captcha "> < ?php echo $this-> fields['captcha']-> generateQuestion(); ?> < span class ="mandatory "> *</ span > </ label >
29
26
</ div >
30
27
< ?php endif; ?>
31
-
32
28
< div class ="widget ">
33
29
< ?php echo $this-> fields['comment']-> generateWithError(); ?> < label for ="ctrl_<?php echo $this->fields['comment']->id; ?> " class ="invisible "> < ?php echo $this-> fields['comment']-> label; ?> </ label >
34
30
</ div >
35
-
36
31
< div class ="widget ">
37
32
< ?php echo $this-> fields['notify']-> generateWithError(); ?>
38
33
</ div >
39
-
40
34
< div class ="submit_container ">
41
35
< input type ="submit " class ="submit " value ="<?php echo $this->submit; ?> " />
42
36
</ div >
43
-
44
37
</ div >
45
38
</ form >
46
39
< ?php endif; ?>
47
-
48
- </ div >
49
- <!-- indexer::continue -->
50
-
51
- < ?php endif; ?>
40
+ < ?php endif; ?>
41
+ </ div >
42
+ <!-- indexer::continue -->
You can’t perform that action at this time.
0 commit comments