Skip to content
Snippets Groups Projects
Commit f03bce01 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

avoid creating empty tbody elements, fixes #1730

Closes #1730

Merge request studip/studip!1127
parent 3bd0327f
No related branches found
No related tags found
No related merge requests found
...@@ -85,39 +85,41 @@ if (Request::get('to_folder_id')) { ...@@ -85,39 +85,41 @@ if (Request::get('to_folder_id')) {
</tr> </tr>
</tbody> </tbody>
<? else : ?> <? else : ?>
<tbody> <? if (count($top_folder->getSubfolders()) > 0) : ?>
<? foreach ($top_folder->getSubfolders() as $subfolder) : ?> <tbody>
<? if (!$subfolder->isVisible($GLOBALS['user']->id)) continue; ?> <? foreach ($top_folder->getSubfolders() as $subfolder) : ?>
<tr> <? if (!$subfolder->isVisible($GLOBALS['user']->id)) continue; ?>
<td class="document-icon" data-sort-value="0"> <tr>
<? if ($subfolder->isReadable($GLOBALS['user']->id)) : ?> <td class="document-icon" data-sort-value="0">
<a href="<?= $controller->link_for('file/choose_file/' . $subfolder->id, $options) ?>" data-dialog> <? if ($subfolder->isReadable($GLOBALS['user']->id)) : ?>
<? endif ?> <a href="<?= $controller->link_for('file/choose_file/' . $subfolder->id, $options) ?>" data-dialog>
<? if ($is_empty): ?> <? endif ?>
<?= Icon::create('folder-empty')->asImg(24) ?> <? if ($is_empty): ?>
<? else: ?> <?= Icon::create('folder-empty')->asImg(24) ?>
<?= Icon::create('folder-full')->asImg(24) ?> <? else: ?>
<? endif; ?> <?= Icon::create('folder-full')->asImg(24) ?>
<? if ($subfolder->isReadable($GLOBALS['user']->id)) : ?> <? endif; ?>
</a> <? if ($subfolder->isReadable($GLOBALS['user']->id)) : ?>
<? endif ?> </a>
</td> <? endif ?>
<td> </td>
<? if ($subfolder->isReadable($GLOBALS['user']->id)) : ?> <td>
<a href="<?= $controller->link_for('file/choose_file/' . $subfolder->id, $options) ?>" data-dialog> <? if ($subfolder->isReadable($GLOBALS['user']->id)) : ?>
<a href="<?= $controller->link_for('file/choose_file/' . $subfolder->id, $options) ?>" data-dialog>
<?= htmlReady($subfolder->name) ?>
</a>
<? else: ?>
<?= htmlReady($subfolder->name) ?> <?= htmlReady($subfolder->name) ?>
</a> <? endif ?>
<? else: ?> <? if ($subfolder->description): ?>
<?= htmlReady($subfolder->name) ?> <small class="responsive-hidden"><?= htmlReady($subfolder->description) ?></small>
<? endif ?> <? endif; ?>
<? if ($subfolder->description): ?> </td>
<small class="responsive-hidden"><?= htmlReady($subfolder->description) ?></small> </tr>
<? endif; ?> <? endforeach; ?>
</td> </tbody>
</tr> <? endif ?>
<? endforeach; ?> <? if (count($top_folder->getFiles()) > 0) : ?>
</tbody>
<? if (count($top_folder->getFiles())) : ?>
<tbody> <tbody>
<? foreach ($top_folder->getFiles() as $file) : ?> <? foreach ($top_folder->getFiles() as $file) : ?>
<tr> <tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment