/** * Responsible for taking a particular version of a file and rescanning all its attributes * This will run any type-based import routines, and store those attributes, generate thumbnails, * etc... */ public function refreshAttributes($rescanThumbnails = true) { $fh = Core::make('helper/file'); $ext = $fh->getExtension($this->fvFilename); $ftl = FileTypeList::getType($ext); $db = Database::get(); $fsr = $this->getFileResource(); if (!$fsr->isFile()) { return Importer::E_FILE_INVALID; } $size = $fsr->getSize(); $this->fvExtension = $ext; $this->fvType = $ftl->getGenericType(); if ($this->fvTitle === null) { $this->fvTitle = $this->getFilename(); } $this->fvSize = $size; if (is_object($ftl)) { if ($ftl->getCustomImporter() != false) { $this->fvGenericType = $ftl->getGenericType(); $cl = $ftl->getCustomInspector(); $cl->inspect($this); } } if ($rescanThumbnails) { $this->rescanThumbnails(); } $this->save(); $f = $this->getFile(); $f->reindex(); }
<th width="10%" valign="middle" class="center theader"> <input type="checkbox" id="check-all-incoming"/> </th> <th width="20%" valign="middle" class="center theader"></th> <th width="45%" valign="middle" class="theader"><?php echo t('Filename'); ?> </th> <th width="25%" valign="middle" class="center theader"><?php echo t('Size'); ?> </th> </tr> <?php foreach ($incoming_contents as $i => $file) { $ft = \Concrete\Core\File\Type\TypeList::getType($file['basename']); ?> <tr> <td width="10%" style="vertical-align: middle" class="center"> <?php if ($fh->extension($file['basename'])) { ?> <input type="checkbox" name="send_file<?php echo $i; ?> " class="ccm-file-select-incoming" value="<?php echo $file['basename']; ?> " /> <?php }
/** * Responsible for taking a particular version of a file and rescanning all its attributes * This will run any type-based import routines, and store those attributes, generate thumbnails, * etc... */ public function refreshAttributes($firstRun = false) { $fh = Loader::helper('file'); $ext = $fh->getExtension($this->fvFilename); $ftl = FileTypeList::getType($ext); $db = Loader::db(); $fsr = $this->getFileResource(); if (!$fsr->isFile()) { return Importer::E_FILE_INVALID; } $size = $fsr->getSize(); $title = $firstRun ? $this->getFilename() : $this->getTitle(); $this->fvExtension = $ext; $this->fvType = $ftl->getGenericType(); $this->fvTitle = $title; $this->fvSize = $size; if (is_object($ftl)) { if ($ftl->getCustomImporter() != false) { $this->fvGenericType = $ftl->getGenericType(); $cl = $ftl->getCustomInspector(); $cl->inspect($this); } } $this->save(); $f = $this->getFile(); $f->reindex(); }