}
    ?>
        <?php 
    foreach (array_key_exists('files', $items) ? $items['files'] : [] as $file) {
        ?>
        <?php 
        echo FileSystemItem::widget(['parentFolderId' => $parentFolderId, 'type' => $file->getItemType(), 'id' => $file->getItemId(), 'downloadUrl' => $file->getUrl(true), 'url' => $file->getUrl(), 'wallUrl' => $file->getWallUrl(), 'iconClass' => $file->getIconClass(), 'title' => $file->getTitle(), 'size' => $file->getSize(), 'creator' => $file->creator, 'editor' => $file->editor, 'updatedAt' => $file->content->updated_at, 'contentObject' => $file]);
        ?>
        <?php 
    }
    ?>
        <?php 
    foreach (array_key_exists('postedFiles', $items) ? $items['postedFiles'] : [] as $file) {
        ?>
        <?php 
        echo FileSystemItem::widget(['parentFolderId' => $parentFolderId, 'type' => \humhub\modules\cfiles\models\File::getItemTypeByExt($file->getExtension()), 'columns' => $itemsSelectable ? ['select', 'title', 'size', 'timestamp', 'creator'] : ['title', 'size', 'timestamp', 'creator'], 'id' => 'baseFile_' . $file->id, 'downloadUrl' => $file->getUrl() . '&' . http_build_query(['download' => true]), 'url' => $file->getUrl(), 'wallUrl' => \humhub\modules\cfiles\models\File::getBasePost($file)->getUrl(), 'iconClass' => \humhub\modules\cfiles\models\File::getIconClassByExt($file->getExtension()), 'title' => $file->file_name, 'size' => $file->size, 'creator' => \humhub\modules\cfiles\models\File::getUserById($file->created_by), 'editor' => \humhub\modules\cfiles\models\File::getUserById($file->updated_by), 'updatedAt' => $file->updated_at]);
        ?>
        <?php 
    }
    ?>
    </table>
</div>
<?php 
} else {
    ?>
<div class="folderEmptyMessage">
    <div class="panel">
        <div class="panel-body">
            <p>
                <strong><?php 
    echo Yii::t('CfilesModule.base', 'This folder is empty.');
Example #2
0
 public function getItemType()
 {
     return File::getItemTypeByExt(strtolower($this->baseFile->getExtension()));
 }
                            data-url="<?php 
        echo $item['file']->getUrl();
        ?>
"
                            data-content-url="<?php 
        echo empty($item['content']) ? "" : $item['content']->getUrl();
        ?>
">
                            <td class="text-left"
                                data-sort-value="icon examples"><i
                                class="fa <?php 
        echo File::getIconClassByExt($item['file']->getExtension());
        ?>
 fa-fw"></i>&nbsp;
                                <?php 
        if (File::getItemTypeByExt($item['file']->getExtension()) === "image") {
            ?>
                                <a class="preview-link"
                                data-toggle="lightbox"
                                href="<?php 
            echo $item['file']->getUrl();
            ?>
#.jpeg"
                                data-footer='<button  type="button"
                                class="btn btn-primary"
                                data-dismiss="modal"><?php 
            echo Yii::t('FileModule.base', 'Close');
            ?>
</button>'><?php 
            echo Html::encode($item['file']->file_name);
            ?>