<?php
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
?>
<div class="list">
    <table>
        <tr>
            <th>Name</th>
            <th>Description</th>
            <th>Size</th>
            <th></th>
            <th></th>
            <th></th>
        </tr>
        <?php foreach ($this->files as $fileInfo) {
            $file = $fileInfo['name'];
            $important = $fileInfo['important'];
            $size = $fileInfo['size'];
            $description = $fileInfo['description'];

            // replace directory separator with ":" as Plesk for Windows environment does not allow
            // to pass "/" or "\" as separator in GET argument;
            // backward replace is performed in \PleskExt\PanelMigrator\Controller\ManageSessionFiles::_getFullFileName
            $filenameEncoded = urlencode(str_replace(DIRECTORY_SEPARATOR, ':', $file));

            $viewUrl =  $this->urlViewSessionFile . '/filename/' . $filenameEncoded;
            $downloadUrl =  $this->urlDownloadSessionFile . '/filename/' . $filenameEncoded;
            $editUrl =  $this->urlEditSessionFile . '/filename/' . $filenameEncoded;
        ?>
            <tr style="<?php if ($important) { echo 'font-weight: bold'; } ?>">
                <td><?php echo htmlspecialchars($file); ?></td>
                <td><?php echo htmlspecialchars($description); ?></td>
                <td><?php echo htmlspecialchars($size); ?></td>
                <td><a href="<?php echo htmlentities($viewUrl); ?>">View</a></td>
                <td><a href="<?php echo htmlentities($downloadUrl); ?>">Download</a></td>
                <td><a href="<?php echo htmlentities($editUrl); ?>">Edit</a></td>
            </tr>
        <?php } ?>
    </table>
</div>