Skip to content

Commit eff3094

Browse files
committed
[K6.4] Protected attachments are not displayed (Revert changes and
indent correctly the code) #9879
1 parent cbe3f64 commit eff3094

File tree

1 file changed

+47
-52
lines changed
  • src/site/template/aurelia/layouts/message/item

1 file changed

+47
-52
lines changed

src/site/template/aurelia/layouts/message/item/default.php

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -124,61 +124,56 @@
124124

125125
<?php if (!empty($attachments)) :
126126
if (!$this->me->exists() && ($this->config->showImgForGuest || $this->config->showFileForGuest ) || $this->me->exists()) : ?>
127-
<div class="card pb-3 pd-3 mb-3">
128-
<?php if ($this->canSeeAttachments($attachments, $attachs, $this->topic)) : ?>
129-
<div class="card-header"><?php echo Text::_('COM_KUNENA_ATTACHMENTS'); ?></div>
130-
<div class="card-body kattach">
127+
<div class="card pb-3 pd-3 mb-3">
128+
<?php if ($this->canSeeAttachments($attachments, $attachs, $this->topic)) : ?>
129+
<div class="card-header"><?php echo Text::_('COM_KUNENA_ATTACHMENTS'); ?></div>
130+
<div class="card-body kattach">
131131
<?php endif; ?>
132-
<ul class="thumbnails" style="list-style:none;">
133-
<?php foreach ($attachments as $attachment) :
134-
135-
if (!$attachment->protected) : ?>
136-
<?php if ($attachment->isAudio()) :
137-
echo $attachment->getLayout()->render('audio'); ?>
138-
<?php elseif ($attachment->isVideo()) :
139-
echo $attachment->getLayout()->render('video'); ?>
140-
<?php else :
141-
if (!$attachment->inline) : ?>
142-
<li class="col-md-3 text-center">
143-
<div class="thumbnail">
144-
<?php echo $attachment->getLayout()->render('thumbnail'); ?>
145-
<?php echo $attachment->getLayout()->render('textlink'); ?>
146-
</div>
147-
</li>
148-
<?php endif; ?>
149-
<?php endif; ?>
150-
<?php elseif ($attachment->isAuthorised('private')): ?>
151-
<?php if ($attachment->isAudio()) :
152-
echo $attachment->getLayout()->render('audio'); ?>
153-
<?php elseif ($attachment->isVideo()) :
154-
echo $attachment->getLayout()->render('video'); ?>
155-
<?php else :
156-
if (!$attachment->inline) : ?>
157-
<li class="col-md-3 text-center">
158-
<div class="thumbnail">
159-
<?php echo $attachment->getLayout()->render('thumbnail'); ?>
160-
<?php echo $attachment->getLayout()->render('textlink'); ?>
161-
</div>
162-
</li>
163-
<?php endif; ?>
164-
<?php endif; ?>
165-
<?php elseif ($attachment->protected && !$attachment->inline) : ?>
132+
<ul class="thumbnails" style="list-style:none;">
133+
134+
<?php foreach ($attachments as $attachment) :
135+
if (!$attachment->protected) : ?>
136+
<?php if ($attachment->isAudio()) :
137+
echo $attachment->getLayout()->render('audio'); ?>
138+
<?php elseif ($attachment->isVideo()) :
139+
echo $attachment->getLayout()->render('video'); ?>
140+
<?php else :
141+
if (!$attachment->inline) : ?>
166142
<li class="col-md-3 text-center">
167-
<div class="thumbnail">
168-
<?php echo $attachment->getLayout()->render('thumbnail'); ?>
169-
<?php echo $attachment->getLayout()->render('textlink'); ?>
170-
</div>
171-
</li>
172-
<?php endif;
173-
174-
endforeach; ?>
175-
</ul>
176-
<?php if ($this->canSeeAttachments($attachments, $attachs, $this->topic)) : ?>
177-
178-
</div>
143+
<div class="thumbnail">
144+
<?php echo $attachment->getLayout()->render('thumbnail'); ?>
145+
<?php echo $attachment->getLayout()->render('textlink'); ?>
146+
</div>
147+
</li>
148+
<?php endif; ?>
149+
<?php endif; ?>
150+
<?php elseif ($attachment->isAuthorised('private')): ?>
151+
<?php if ($attachment->isAudio()) :
152+
echo $attachment->getLayout()->render('audio'); ?>
153+
<?php elseif ($attachment->isVideo()) :
154+
echo $attachment->getLayout()->render('video'); ?>
155+
<?php else :
156+
if (!$attachment->inline) : ?>
157+
<li class="col-md-3 text-center">
158+
<div class="thumbnail">
159+
<?php echo $attachment->getLayout()->render('thumbnail'); ?>
160+
<?php echo $attachment->getLayout()->render('textlink'); ?>
161+
</div>
162+
</li>
163+
<?php endif; ?>
164+
<?php endif; ?>
165+
<?php elseif ($this->config->privateMessage && $this->me->isModerator($this->topic->getCategory())) : ?>
166+
167+
<?php endif;
168+
endforeach; ?>
169+
170+
</ul>
171+
172+
<?php if ($this->canSeeAttachments($attachments, $attachs, $this->topic)) : ?>
173+
</div>
179174
<div class="clearfix"></div>
180-
<?php endif; ?>
181-
<?php endif; ?>
175+
<?php endif; ?>
176+
<?php endif; ?>
182177
<?php endif; ?>
183178

184179

0 commit comments

Comments
 (0)