}
    ?>
        <?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.');
 /**
  * Add all posted files virtual directory content to zip file.
  *
  * @param ZipArchive $zipFile
  *            The zip file to add the entries to
  * @param int $localPathPrefix
  *            where we currently are in the zip file
  */
 protected function archiveAllPostedFiles(&$zipFile, $localPathPrefix)
 {
     $files = $this->getAllPostedFilesList();
     foreach ($files['postedFiles'] as $file) {
         $this->archiveFile($file, $zipFile, $localPathPrefix, \humhub\modules\cfiles\models\File::getUserById($file->created_by)->username . '_' . $file->created_at . '_');
     }
 }
Example #3
0
 public function getEditor()
 {
     return File::getUserById($this->baseFile->updated_by);
 }