?> <tr> <td align="center" class="padded_cell<?php echo ($part->path == '/') ? ' root_partition' : '' ?>"> <?php render_part_html($part) ?> </td> <td style="width:16px" class="padded_cell<?php echo ($part->path == '/') ? ' root_partition' : '' ?>"> <img alt="Working" class="theme-image" id="spinner-part-<?php echo $part->id ?>" src="<?php echo $base_url ?>images/working.gif?<?php echo time() ?>" style="display: none;" title="Working"> </td> <td class="padded_cell<?php echo ($part->path == '/') ? ' root_partition' : '' ?>"> <?php echo $part->path ?> </td> <td align="center" class="padded_cell<?php echo ($part->path == '/') ? ' root_partition' : '' ?>"> <?php echo bytes_to_human($part->bytes_total) ?> </td> <td align="center" class="padded_cell freespace temperature-<?php echo $spacecolor ?><?php echo ($part->path == '/') ? ' root_partition' : '' ?>"> <?php echo bytes_to_human($part->bytes_free) ?> </td> <td align="center" class="padded_cell freespace temperature-<?php echo $spacecolor ?><?php echo ($part->path == '/') ? ' root_partition' : '' ?>"> <?php echo number_format($part->bytes_free/$part->bytes_total*100, 1) ?>% </td> <?php if ($part->path == '/' && count($partitions) > 0): ?> <td rowspan="<?php echo count($partitions) ?>" style="max-width:500px" valign="top"> <div class="root_partition padded_cell"><span class="i18n-root_fs_warning">Note: Including the root partition in your storage pool could cause your server to behave erratically, if you ever fill your pool to capacity. Use with caution.</span></div> </td> <?php endif; ?> </tr> <?php } ?> </tbody> </table>
############################################################################### # modules ############################################################################### require_once __DIR__ . '/../lib/Dropbox/autoload.php'; use Dropbox as dbx; $client = new dbx\Client($accessToken, $clientIdentifier, $userLocale); ############################################################################### # program ############################################################################### // collect accountinfo to be used for human quota calculations $account_info = $client->getAccountInfo(); $quota_shared = bytes_to_human($account_info['quota_info']['shared']); $quota = bytes_to_human($account_info['quota_info']['quota']); $quota_used = bytes_to_human($account_info['quota_info']['normal']); $quota_left = $account_info['quota_info']['quota'] - $account_info['quota_info']['normal']; $quota_left = bytes_to_human($quota_left); $delta_page = array(); // get_previous_cursor if ($use_cursor == 1) { $cursor = get_previous_cursor($cursor_file); $delta_page['cursor'] = $cursor; } else { //$cursor = $cursor; $delta_page['cursor'] = $cursor; } // getDelta collets data per page // as long as we have more (pages) // fetch the delta (for the current page) and put entries in all_entries $dropbox_path_file_to_meta = array(); $all_entries = array(); $has_more = '1';
function get_legend($path, $size, $simplified=FALSE) { global $shares_options; $share = substr($path, 1, strpos(substr($path, 1), '/')); $num_copies = $shares_options[$share]['num_copies']; if (!$simplified) { if (strpos($path, '/*') == strlen($path)-2) { $path .= " (files)"; } } if ($simplified || $num_copies == null) { return "$path (". bytes_to_human($size, FALSE) .")"; } else { return "$path (". bytes_to_human($size/$num_copies, FALSE) ." x $num_copies = ". bytes_to_human($size, FALSE) .")"; } }