From c7bd5fb64003c42f9299b7203af9a13bcd48948f Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 15:50:06 -0400 Subject: added quota back --- views/default/photos/sidebar.php | 6 ++++++ views/default/photos/sidebar/quota.php | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 views/default/photos/sidebar/quota.php (limited to 'views/default/photos') diff --git a/views/default/photos/sidebar.php b/views/default/photos/sidebar.php index 4c0feb72c..fd5202691 100644 --- a/views/default/photos/sidebar.php +++ b/views/default/photos/sidebar.php @@ -10,3 +10,9 @@ if ($image && $page == 'view') { echo elgg_view('photos/sidebar/exif', $vars); } } + +if ($page == 'upload') { + if (elgg_get_plugin_setting('quota', 'tidypics')) { + echo elgg_view('photos/sidebar/quota', $vars); + } +} \ No newline at end of file diff --git a/views/default/photos/sidebar/quota.php b/views/default/photos/sidebar/quota.php new file mode 100644 index 000000000..16b7885c4 --- /dev/null +++ b/views/default/photos/sidebar/quota.php @@ -0,0 +1,27 @@ +image_repo_size; + $image_repo_size = $image_repo_size / 1024 / 1024; + $quote_percentage = round(100 * ($image_repo_size / $quota)); + // for small quotas, so one decimal place + if ($quota < 10) { + $image_repo_size = sprintf('%.1f', $image_repo_size); + } else { + $image_repo_size = round($image_repo_size); + } + if ($image_repo_size > $quota) { + $image_repo_size = $quota; + } + + $title = elgg_echo('tidypics:title:quota'); + $body = elgg_echo("tidypics:quota") . ' ' . $image_repo_size . '/' . $quota . " MB ({$quote_percentage}%)"; + echo elgg_view_module('aside', $title, $body); +} -- cgit v1.2.3