echo scriptUrl . "/" . folderFiles . "/browseFiles.php?folderId=" . $subFolder->id; echo showPopup ? "&popup=1" : ""; echo !empty($fileTypes) ? "&fileTypes=" . $fileTypes : ""; ?> "><?php echo $subFolder->name; ?> </a> </td> <td width="50%" align="right" <?php echo $i % 2 == 0 ? " style=\"background:#ebebeb\"" : ""; ?> > <?php echo getFormattedSize($subFolder->getSize()); ?> </td> </tr> <?php $old = $i; } } if ($files->rows()) { for ($i = $old + 1; list($id) = $files->fetchrow_array(); $i++) { $file = new File($id); ?> <tr> <td height="25" width="16"<?php echo $i % 2 == 0 ? " style=\"background:#ebebeb\"" : ""; ?>
/** * Get total size of subfolders and files of this folder * @return size of this folder in bytes */ function getSize() { if (!empty($this->id)) { global $dbi; $totalSize = 0; /* Get size of subfolders */ $result = $dbi->query("SELECT id FROM " . folderTableName . " WHERE parentId=" . $this->id); for ($j = 0; list($id) = $result->fetchrow_array(); $j++) { $folder = new Folder($id); $totalSize += $folder->getSize(); } /* Get size of files */ $result = $dbi->query("SELECT id FROM " . fileTableName . " WHERE folderId=" . $this->id); for ($j = 0; list($id) = $result->fetchrow_array(); $j++) { $file = new File($id); $totalSize += $file->getSize(); } /* Return size of folder in bytes */ return $totalSize; } }
"> <a href="index.php?folderId=<?php echo $subFolder->id; ?> "><?php echo validateTextLength($subFolder->name, 30); ?> </a> </td> <td nowrap="nowrap" align="right" class="small1 <?php echo $class; ?> "> <?php $site->printFormattedSize($subFolder->getSize()); ?> </td> <td nowrap="nowrap" class="small1 <?php echo $class; ?> "> <?php $lastModified = $subFolder->getLastModified(); if ($lastModified != 0) { $site->printTimestamp($lastModified); } else { echo "-"; } ?>